QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
64  bool operator==( const QgsTextShadowSettings &other ) const;
65  bool operator!=( const QgsTextShadowSettings &other ) const;
66 
71  bool enabled() const;
72 
78  void setEnabled( bool enabled );
79 
86  QgsTextShadowSettings::ShadowPlacement shadowPlacement() const;
87 
95  void setShadowPlacement( QgsTextShadowSettings::ShadowPlacement placement );
96 
102  int offsetAngle() const;
103 
110  void setOffsetAngle( int angle );
111 
118  double offsetDistance() const;
119 
127  void setOffsetDistance( double distance );
128 
134  QgsUnitTypes::RenderUnit offsetUnit() const;
135 
142  void setOffsetUnit( QgsUnitTypes::RenderUnit units );
143 
150  QgsMapUnitScale offsetMapUnitScale() const;
151 
159  void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
160 
165  bool offsetGlobal() const;
166 
171  void setOffsetGlobal( bool global );
172 
178  double blurRadius() const;
179 
186  void setBlurRadius( double blurRadius );
187 
193  QgsUnitTypes::RenderUnit blurRadiusUnit() const;
194 
201  void setBlurRadiusUnit( QgsUnitTypes::RenderUnit units );
202 
209  QgsMapUnitScale blurRadiusMapUnitScale() const;
210 
218  void setBlurRadiusMapUnitScale( const QgsMapUnitScale &scale );
219 
224  bool blurAlphaOnly() const;
225 
232  void setBlurAlphaOnly( bool alphaOnly );
233 
239  double opacity() const;
240 
247  void setOpacity( double opacity );
248 
253  int scale() const;
254 
260  void setScale( int scale );
261 
266  QColor color() const;
267 
273  void setColor( const QColor &color );
274 
279  QPainter::CompositionMode blendMode() const;
280 
286  void setBlendMode( QPainter::CompositionMode mode );
287 
292  void readFromLayer( QgsVectorLayer *layer );
293 
298  void readXml( const QDomElement &elem );
299 
304  QDomElement writeXml( QDomDocument &doc ) const;
305 
310  void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
311 
316  QSet<QString> referencedFields( const QgsRenderContext &context ) const;
317 
318  private:
319 
320  QSharedDataPointer<QgsTextShadowSettingsPrivate> d;
321 
322 };
323 
324 #endif // QGSTEXTSHADOWSETTINGS_H
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:400
QgsTextShadowSettings::ShadowBuffer
@ ShadowBuffer
Draw shadow under buffer.
Definition: qgstextshadowsettings.h:48
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
qgsunittypes.h
operator!=
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:405
QgsTextShadowSettings::ShadowPlacement
ShadowPlacement
Placement positions for text shadow.
Definition: qgstextshadowsettings.h:45
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:38
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:319
QgsTextShadowSettings
Container for settings relating to a text shadow.
Definition: qgstextshadowsettings.h:38
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
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