17#ifndef QGSANNOTATIONITEM_H
18#define QGSANNOTATIONITEM_H
45 if ( sipCpp->type() == QLatin1String(
"marker" ) )
47 sipType = sipType_QgsAnnotationMarkerItem;
49 else if ( sipCpp->type() == QLatin1String(
"linestring" ) )
51 sipType = sipType_QgsAnnotationLineItem;
53 else if ( sipCpp->type() == QLatin1String(
"polygon" ) )
55 sipType = sipType_QgsAnnotationPolygonItem;
57 else if ( sipCpp->type() == QLatin1String(
"pointtext" ) )
59 sipType = sipType_QgsAnnotationPointTextItem;
61 else if ( sipCpp->type() == QLatin1String(
"linetext" ) )
63 sipType = sipType_QgsAnnotationLineTextItem;
93 virtual Qgis::AnnotationItemFlags flags()
const;
107 virtual QString
type()
const = 0;
198 virtual QList< QgsAnnotationItemNode > nodes()
const;
265 bool writeCommonProperties( QDomElement &element, QDomDocument &document,
const QgsReadWriteContext &context )
const;
273 bool readCommonProperties(
const QDomElement &element,
const QgsReadWriteContext &context );
278 bool mEnabled =
true;
279 bool mUseReferenceScale =
false;
280 double mReferenceScale = 0;
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Abstract base class for annotation item edit operations.
Encapsulates the transient results of an in-progress annotation edit operation.
Contains information about a node used for editing an annotation item.
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
void setUseSymbologyReferenceScale(bool enabled)
Sets whether the annotation item uses a symbology reference scale.
void setZIndex(int index)
Sets the item's z index, which controls the order in which annotation items are rendered in the layer...
bool useSymbologyReferenceScale() const
Returns true if the annotation item uses a symbology reference scale.
virtual bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const =0
Writes the item's state into an XML element.
virtual QgsRectangle boundingBox() const =0
Returns the bounding box of the item's geographic location, in the parent layer's coordinate referenc...
void setEnabled(bool enabled)
Sets if the item will be rendered or not in the layer.
virtual QString type() const =0
Returns a unique (untranslated) string identifying the type of item.
virtual void render(QgsRenderContext &context, QgsFeedback *feedback)=0
Renders the item to the specified render context.
bool enabled() const
Returns true if the item is enabled and will be rendered in the layer.
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the item's state from the given DOM element.
QgsAnnotationItem(const QgsAnnotationItem &other)=delete
QgsAnnotationItem cannot be copied.
QgsAnnotationItem & operator=(const QgsAnnotationItem &other)=delete
QgsAnnotationItem cannot be copied.
void setSymbologyReferenceScale(double scale)
Sets the annotation's symbology reference scale.
int zIndex() const
Returns the item's z index, which controls the order in which annotation items are rendered in the la...
virtual ~QgsAnnotationItem()=default
QgsAnnotationItem()=default
Constructor for an annotation item.
virtual QgsRectangle boundingBox(QgsRenderContext &context) const
Returns the bounding box of the item's geographic location, in the parent layer's coordinate referenc...
double symbologyReferenceScale() const
Returns the annotation's symbology reference scale.
virtual QgsAnnotationItem * clone() const =0
Returns a clone of the item.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
A marker symbol type, for rendering Point and MultiPoint geometries.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)