QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgssymbolwidgetcontext.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssymbolwidgetcontext.h
3 ------------------------
4 begin : September 2016
5 copyright : (C) 2016 by Nyall Dawson
6 email : nyall dot dawson 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#ifndef QGSSYMBOLWIDGETCONTEXT_H
16#define QGSSYMBOLWIDGETCONTEXT_H
17
18#include <memory>
19
21#include "qgis_gui.h"
22
23class QgsMapLayer;
24class QgsMapCanvas;
25class QgsMessageBar;
26
34class GUI_EXPORT QgsSymbolWidgetContext // clazy:exclude=rule-of-three
35{
36 public:
37
42
48
49 QgsSymbolWidgetContext &operator=( const QgsSymbolWidgetContext &other );
50
57 void setMapCanvas( QgsMapCanvas *canvas );
58
63 QgsMapCanvas *mapCanvas() const;
64
71 void setMessageBar( QgsMessageBar *bar );
72
78 QgsMessageBar *messageBar() const;
79
88 void setExpressionContext( QgsExpressionContext *context );
89
96 QgsExpressionContext *expressionContext() const;
97
103 void setAdditionalExpressionContextScopes( const QList< QgsExpressionContextScope > &scopes );
104
109 QList< QgsExpressionContextScope > additionalExpressionContextScopes() const;
110
115 QList<QgsExpressionContextScope *> globalProjectAtlasMapLayerScopes( const QgsMapLayer *layer ) const SIP_FACTORY;
116
124 Qgis::SymbolType symbolType() const;
125
133 void setSymbolType( Qgis::SymbolType type );
134
135 private:
136
137 QgsMapCanvas *mMapCanvas = nullptr;
138 QgsMessageBar *mMessageBar = nullptr;
139 std::unique_ptr< QgsExpressionContext > mExpressionContext;
140 QList< QgsExpressionContextScope > mAdditionalScopes;
142
143};
144
145#endif // QGSSYMBOLWIDGETCONTEXT_H
SymbolType
Symbol types.
Definition: qgis.h:401
@ Hybrid
Hybrid symbol.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:93
Base class for all map layer types.
Definition: qgsmaplayer.h:75
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:61
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QgsSymbolWidgetContext()=default
Constructor for QgsSymbolWidgetContext.
#define SIP_FACTORY
Definition: qgis_sip.h:76