QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgstextbuffersettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstextbuffersettings.h
3  -----------------
4  begin : May 2020
5  copyright : (C) Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7 
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSTEXTBUFFERSETTINGS_H
18 #define QGSTEXTBUFFERSETTINGS_H
19 
20 #include "qgis_sip.h"
21 #include "qgis_core.h"
22 #include "qgsmapunitscale.h"
23 #include "qgsunittypes.h"
24 
25 #include <QSharedData>
26 #include <QPainter>
27 #include <QDomElement>
28 
30 class QgsTextBufferSettingsPrivate;
31 class QgsVectorLayer;
32 class QgsPaintEffect;
34 
42 class CORE_EXPORT QgsTextBufferSettings
43 {
44  public:
45 
47 
53 
58  QgsTextBufferSettings &operator=( const QgsTextBufferSettings &other );
59 
61 
66  bool enabled() const;
67 
73  void setEnabled( bool enabled );
74 
80  double size() const;
81 
88  void setSize( double size );
89 
95  QgsUnitTypes::RenderUnit sizeUnit() const;
96 
103  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
104 
111  QgsMapUnitScale sizeMapUnitScale() const;
112 
120  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
121 
126  QColor color() const;
127 
133  void setColor( const QColor &color );
134 
141  bool fillBufferInterior() const;
142 
149  void setFillBufferInterior( bool fill );
150 
156  double opacity() const;
157 
164  void setOpacity( double opacity );
165 
170  Qt::PenJoinStyle joinStyle() const;
171 
177  void setJoinStyle( Qt::PenJoinStyle style );
178 
183  QPainter::CompositionMode blendMode() const;
184 
190  void setBlendMode( QPainter::CompositionMode mode );
191 
196  void readFromLayer( QgsVectorLayer *layer );
197 
202  void readXml( const QDomElement &elem );
203 
208  QDomElement writeXml( QDomDocument &doc ) const;
209 
215  QgsPaintEffect *paintEffect() const;
216 
222  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
223 
228  void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
229 
234  QSet<QString> referencedFields( const QgsRenderContext &context ) const;
235 
236  private:
237 
238  QSharedDataPointer<QgsTextBufferSettingsPrivate> d;
239 
240 };
241 
242 #endif // QGSTEXTBUFFERSETTINGS_H
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
QgsRenderContext
Definition: qgsrendercontext.h:57
qgsunittypes.h
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:37
QgsTextBufferSettings
Definition: qgstextbuffersettings.h:42
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:318
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsPaintEffect
Base class for visual effects which can be applied to QPicture drawings.
Definition: qgspainteffect.h:53
qgsmapunitscale.h