QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 class QgsLayerTreeGroup;
27 
35 {
36  public:
37 
44  enum class ParentPage : int
45  {
46  NoParent,
47  Temporal,
48  };
49 
52 
54  QgsMapLayerConfigWidgetFactory( const QString &title, const QIcon &icon );
55 
56  virtual ~QgsMapLayerConfigWidgetFactory() = default;
57 
62  virtual QIcon icon() const { return mIcon; }
63 
68  void setIcon( const QIcon &icon ) { mIcon = icon; }
69 
75  virtual QString title() const { return mTitle; }
76 
83  void setTitle( const QString &title ) { mTitle = title; }
84 
90  virtual bool supportsStyleDock() const { return false; }
91 
96  void setSupportsStyleDock( bool supports ) { mSupportsDock = supports; }
97 
103  virtual bool supportLayerPropertiesDialog() const { return false; }
104 
117  virtual QString layerPropertiesPagePositionHint() const;
118 
123  void setSupportLayerPropertiesDialog( bool supports ) { mSupportsProperties = supports; }
124 
129  virtual bool supportsLayer( QgsMapLayer *layer ) const;
130 
136  virtual bool supportsLayerTreeGroup( QgsLayerTreeGroup *group ) const;
137 
146  virtual ParentPage parentPage() const;
147 
157  virtual QgsMapLayerConfigWidget *createWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockWidget = true, QWidget *parent = nullptr ) const = 0 SIP_FACTORY;
158 
159  private:
160  QIcon mIcon;
161  QString mTitle;
162  bool mSupportsDock = true;
163  bool mSupportsProperties = true;
164 };
165 
166 #endif // QGSMAPLAYERCONFIGWIDGETFACTORY_H
QgsMapLayerConfigWidgetFactory::title
virtual QString title() const
The title of the panel.
Definition: qgsmaplayerconfigwidgetfactory.h:75
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsMapLayerConfigWidgetFactory::setTitle
void setTitle(const QString &title)
Set the title for the interface.
Definition: qgsmaplayerconfigwidgetfactory.h:83
QgsMapLayerConfigWidgetFactory::supportsStyleDock
virtual bool supportsStyleDock() const
Flag if widget is supported for use in style dock.
Definition: qgsmaplayerconfigwidgetfactory.h:90
QgsMapLayerConfigWidgetFactory::ParentPage
ParentPage
Available parent pages, for factories which create a widget which is a sub-component of a standard pa...
Definition: qgsmaplayerconfigwidgetfactory.h:44
QgsMapLayerConfigWidget
A panel widget that can be shown in the map style dock.
Definition: qgsmaplayerconfigwidget.h:115
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsMapLayerConfigWidgetFactory::setIcon
void setIcon(const QIcon &icon)
Set the icon for the factory object.
Definition: qgsmaplayerconfigwidgetfactory.h:68
qgis_sip.h
QgsLayerTreeGroup
Layer tree group node serves as a container for layers and further groups.
Definition: qgslayertreegroup.h:40
QgsMapLayerConfigWidgetFactory::setSupportLayerPropertiesDialog
void setSupportLayerPropertiesDialog(bool supports)
Set support flag for style dock.
Definition: qgsmaplayerconfigwidgetfactory.h:123
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
QgsMapLayerConfigWidgetFactory::setSupportsStyleDock
void setSupportsStyleDock(bool supports)
Set support flag for style dock.
Definition: qgsmaplayerconfigwidgetfactory.h:96
QgsMapLayerConfigWidgetFactory::supportLayerPropertiesDialog
virtual bool supportLayerPropertiesDialog() const
Flag if widget is supported for use in layer properties dialog.
Definition: qgsmaplayerconfigwidgetfactory.h:103
QgsMapLayerConfigWidgetFactory::icon
virtual QIcon icon() const
The icon that will be shown in the UI for the panel.
Definition: qgsmaplayerconfigwidgetfactory.h:62
QgsMapLayerConfigWidgetFactory
Factory class for creating custom map layer property pages.
Definition: qgsmaplayerconfigwidgetfactory.h:34