QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgslayertreeembeddedwidgetregistry.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayertreeembeddedwidgetregistry.h
3  --------------------------------------
4  Date : May 2016
5  Copyright : (C) 2016 by Martin Dobias
6  Email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSLAYERTREEEMBEDDEDWIDGETREGISTRY_H
17 #define QGSLAYERTREEEMBEDDEDWIDGETREGISTRY_H
18 
19 #include <QMap>
20 #include <QWidget>
21 
22 
23 class QgsMapLayer;
24 
33 {
34  public:
36 
38  virtual QString id() const = 0;
39 
41  virtual QString name() const = 0;
42 
46  virtual QWidget* createWidget( QgsMapLayer* layer, int widgetIndex ) = 0;
47 
49  virtual bool supportsLayer( QgsMapLayer* layer ) = 0;
50 };
51 
62 {
63  public:
64 
66  static QgsLayerTreeEmbeddedWidgetRegistry* instance();
67 
69 
71  QStringList providers() const;
72 
74  QgsLayerTreeEmbeddedWidgetProvider* provider( const QString& providerId ) const;
75 
78  bool addProvider( QgsLayerTreeEmbeddedWidgetProvider* provider );
79 
82  bool removeProvider( const QString& providerId );
83 
84  protected:
87 
90 };
91 
92 
93 #endif // QGSLAYERTREEEMBEDDEDWIDGETREGISTRY_H
Base class for all map layer types.
Definition: qgsmaplayer.h:49
QMap< QString, QgsLayerTreeEmbeddedWidgetProvider * > mProviders
storage of all the providers
Provider interface to be implemented in order to introduce new kinds of embedded widgets for use in l...
Registry of widgets that may be embedded into layer tree view.