QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgstextshadowsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstextshadowsettings.h
3  -----------------
4  begin : May 2020
5  copyright : (C) 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 
16 #ifndef QGSTEXTSHADOWSETTINGS_H
17 #define QGSTEXTSHADOWSETTINGS_H
18 
19 #include "qgsunittypes.h"
20 #include "qgsmapunitscale.h"
21 
22 #include <QSharedDataPointer>
23 #include <QPainter>
24 #include <QDomElement>
25 
26 class QgsTextShadowSettingsPrivate;
27 class QgsVectorLayer;
29 
37 class CORE_EXPORT QgsTextShadowSettings
38 {
39  public:
40 
45  {
46  ShadowLowest = 0,
49  ShadowShape
50  };
51 
53 
59 
60  QgsTextShadowSettings &operator=( const QgsTextShadowSettings &other );
61 
63 
68  bool enabled() const;
69 
75  void setEnabled( bool enabled );
76 
83  QgsTextShadowSettings::ShadowPlacement shadowPlacement() const;
84 
92  void setShadowPlacement( QgsTextShadowSettings::ShadowPlacement placement );
93 
99  int offsetAngle() const;
100 
107  void setOffsetAngle( int angle );
108 
115  double offsetDistance() const;
116 
124  void setOffsetDistance( double distance );
125 
131  QgsUnitTypes::RenderUnit offsetUnit() const;
132 
139  void setOffsetUnit( QgsUnitTypes::RenderUnit units );
140 
147  QgsMapUnitScale offsetMapUnitScale() const;
148 
156  void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
157 
162  bool offsetGlobal() const;
163 
168  void setOffsetGlobal( bool global );
169 
175  double blurRadius() const;
176 
183  void setBlurRadius( double blurRadius );
184 
190  QgsUnitTypes::RenderUnit blurRadiusUnit() const;
191 
198  void setBlurRadiusUnit( QgsUnitTypes::RenderUnit units );
199 
206  QgsMapUnitScale blurRadiusMapUnitScale() const;
207 
215  void setBlurRadiusMapUnitScale( const QgsMapUnitScale &scale );
216 
221  bool blurAlphaOnly() const;
222 
229  void setBlurAlphaOnly( bool alphaOnly );
230 
236  double opacity() const;
237 
244  void setOpacity( double opacity );
245 
250  int scale() const;
251 
257  void setScale( int scale );
258 
263  QColor color() const;
264 
270  void setColor( const QColor &color );
271 
276  QPainter::CompositionMode blendMode() const;
277 
283  void setBlendMode( QPainter::CompositionMode mode );
284 
289  void readFromLayer( QgsVectorLayer *layer );
290 
295  void readXml( const QDomElement &elem );
296 
301  QDomElement writeXml( QDomDocument &doc ) const;
302 
307  void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
308 
313  QSet<QString> referencedFields( const QgsRenderContext &context ) const;
314 
315  private:
316 
317  QSharedDataPointer<QgsTextShadowSettingsPrivate> d;
318 
319 };
320 
321 #endif // QGSTEXTSHADOWSETTINGS_H
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsTextShadowSettings::ShadowBuffer
@ ShadowBuffer
Draw shadow under buffer.
Definition: qgstextshadowsettings.h:48
QgsRenderContext
Definition: qgsrendercontext.h:57
qgsunittypes.h
QgsTextShadowSettings::ShadowPlacement
ShadowPlacement
Placement positions for text shadow.
Definition: qgstextshadowsettings.h:44
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:37
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:318
QgsTextShadowSettings
Definition: qgstextshadowsettings.h:37
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsTextShadowSettings::ShadowText
@ ShadowText
Draw shadow under text.
Definition: qgstextshadowsettings.h:47
qgsmapunitscale.h
MathUtils::angle
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
Definition: MathUtils.cpp:786