QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsmaplayerconfigwidgetfactory.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayerconfigwidgetfactoryfactory.h
3  --------------------------------------
4  Date : 9.7.2013
5  Copyright : (C) 2013 Matthias Kuhn
6  Email : matthias dot kuhn at gmx dot ch
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 QGSMAPLAYERCONFIGWIDGETFACTORY_H
17 #define QGSMAPLAYERCONFIGWIDGETFACTORY_H
18 
19 #include <QListWidgetItem>
20 #include "qgis_gui.h"
21 #include "qgis_sip.h"
22 
23 class QgsMapLayer;
25 class QgsMapCanvas;
26 
34 {
35  public:
36 
39 
41  QgsMapLayerConfigWidgetFactory( const QString &title, const QIcon &icon );
42 
43  virtual ~QgsMapLayerConfigWidgetFactory() = default;
44 
49  virtual QIcon icon() const { return mIcon; }
50 
55  void setIcon( const QIcon &icon ) { mIcon = icon; }
56 
62  virtual QString title() const { return mTitle; }
63 
70  void setTitle( const QString &title ) { mTitle = title; }
71 
77  virtual bool supportsStyleDock() const { return false; }
78 
83  void setSupportsStyleDock( bool supports ) { mSupportsDock = supports; }
84 
90  virtual bool supportLayerPropertiesDialog() const { return false; }
91 
96  void setSupportLayerPropertiesDialog( bool supports ) { mSupportsProperties = supports; }
97 
102  virtual bool supportsLayer( QgsMapLayer *layer ) const;
103 
113  virtual QgsMapLayerConfigWidget *createWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockWidget = true, QWidget *parent SIP_TRANSFERTHIS = nullptr ) const = 0 SIP_FACTORY;
114 
115  private:
116  QIcon mIcon;
117  QString mTitle;
118  bool mSupportsDock = true;
119  bool mSupportsProperties = true;
120 };
121 
122 #endif // QGSMAPLAYERCONFIGWIDGETFACTORY_H
A panel widget that can be shown in the map style dock.
Base class for all map layer types.
Definition: qgsmaplayer.h:61
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Factory class for creating custom map layer property pages.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74
void setSupportsStyleDock(bool supports)
Set support flag for style dock.
void setTitle(const QString &title)
Set the title for the interface.
#define SIP_FACTORY
Definition: qgis_sip.h:69
virtual QString title() const
The title of the panel.
virtual bool supportsStyleDock() const
Flag if widget is supported for use in style dock.
void setIcon(const QIcon &icon)
Set the icon for the factory object.
virtual QIcon icon() const
The icon that will be shown in the UI for the panel.
void setSupportLayerPropertiesDialog(bool supports)
Set support flag for style dock.
virtual bool supportLayerPropertiesDialog() const
Flag if widget is supported for use in layer properties dialog.