QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
20 #include "qgsexpressioncontext.h"
21 #include "qgssymbol.h"
22 #include "qgis_gui.h"
23 
24 
25 class QgsMapCanvas;
26 class QgsMessageBar;
27 
36 class GUI_EXPORT QgsSymbolWidgetContext // clazy:exclude=rule-of-three
37 {
38  public:
39 
44 
50 
51  QgsSymbolWidgetContext &operator=( const QgsSymbolWidgetContext &other );
52 
59  void setMapCanvas( QgsMapCanvas *canvas );
60 
65  QgsMapCanvas *mapCanvas() const;
66 
73  void setMessageBar( QgsMessageBar *bar );
74 
80  QgsMessageBar *messageBar() const;
81 
90  void setExpressionContext( QgsExpressionContext *context );
91 
98  QgsExpressionContext *expressionContext() const;
99 
105  void setAdditionalExpressionContextScopes( const QList< QgsExpressionContextScope > &scopes );
106 
111  QList< QgsExpressionContextScope > additionalExpressionContextScopes() const;
112 
118  QList<QgsExpressionContextScope *> globalProjectAtlasMapLayerScopes( const QgsMapLayer *layer ) const SIP_FACTORY;
119 
127  QgsSymbol::SymbolType symbolType() const;
128 
136  void setSymbolType( QgsSymbol::SymbolType type );
137 
138  private:
139 
140  QgsMapCanvas *mMapCanvas = nullptr;
141  QgsMessageBar *mMessageBar = nullptr;
142  std::unique_ptr< QgsExpressionContext > mExpressionContext;
143  QList< QgsExpressionContextScope > mAdditionalScopes;
145 
146 };
147 
148 #endif // QGSSYMBOLWIDGETCONTEXT_H
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:86
Base class for all map layer types.
Definition: qgsmaplayer.h:85
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.
SymbolType
Type of the symbol.
Definition: qgssymbol.h:87
@ Hybrid
Hybrid symbol.
Definition: qgssymbol.h:91
#define SIP_FACTORY
Definition: qgis_sip.h:76