2828class GUI_EXPORT QgsMapLayerConfigWidgetFactory
2929{
3030 public:
31+
3132 /* * Constructor */
3233 QgsMapLayerConfigWidgetFactory ();
3334
35+ /* * Constructor */
36+ QgsMapLayerConfigWidgetFactory ( QString title, QIcon icon );
37+
3438 /* * Destructor */
3539 virtual ~QgsMapLayerConfigWidgetFactory ();
3640
3741 /* *
3842 * @brief The icon that will be shown in the UI for the panel.
3943 * @return A QIcon for the panel icon.
4044 */
41- virtual QIcon icon () const { return QIcon (); }
45+ virtual QIcon icon () const { return mIcon ; }
46+
47+ /* *
48+ * Set the icon for the factory object.
49+ * @param icon The icon to show in the interface.
50+ */
51+ void setIcon ( QIcon icon ) { mIcon = icon; }
4252
4353 /* *
4454 * @brief The title of the panel.
4555 * @note This may or may not be shown to the user.
4656 * @return Title of the panel
4757 */
48- virtual QString title () const { return QString (); }
58+ virtual QString title () const { return mTitle ; }
59+
60+ /* *
61+ * Set the title for the interface
62+ * @note Not all users may show this as a label
63+ * e.g style dock uses this as a tooltip.
64+ * @param title The title to set.
65+ */
66+ void setTitlte ( QString title ) { mTitle = title; }
4967
5068 /* *
5169 * Flag if widget is supported for use in style dock.
5270 * @return True if supported
5371 */
5472 virtual bool supportsStyleDock () const { return false ; }
5573
74+ /* *
75+ * Set support flag for style dock
76+ * @param supports True if this widget is supported in the style dock.
77+ */
78+ void setSupportsStyleDock ( bool supports ) { mSuppprtsDock = supports; }
79+
5680 /* *
5781 * Flag if widget is supported for use in layer properties dialog.
5882 * @return True if supported
5983 */
6084 virtual bool supportLayerPropertiesDialog () const { return false ; }
6185
86+ /* *
87+ * Set support flag for style dock
88+ * @param supports True if this widget is supported in the style dock.
89+ */
90+ void setSupportLayerPropertiesDialog ( bool supports ) { mSuppprtsProperties = supports; }
91+
6292 /* *
6393 * @brief Check if the layer is supported for this widget.
6494 * @return True if this layer is supported for this widget
@@ -75,6 +105,12 @@ class GUI_EXPORT QgsMapLayerConfigWidgetFactory
75105 * @return A new QgsMapStylePanel which is shown in the map style dock.
76106 */
77107 virtual QgsMapLayerConfigWidget* createWidget ( QgsMapLayer* layer, QgsMapCanvas *canvas, bool dockWidget = true , QWidget* parent = 0 ) const = 0;
108+
109+ private:
110+ QIcon mIcon ;
111+ QString mTitle ;
112+ bool mSuppprtsDock ;
113+ bool mSuppprtsProperties ;
78114};
79115
80116#endif // QGSMAPLAYERCONFIGWIDGETFACTORY_H
0 commit comments