17#ifndef QGSANNOTATIONITEM_H
18#define QGSANNOTATIONITEM_H
48 if ( sipCpp->type() == QLatin1String(
"marker" ) )
50 sipType = sipType_QgsAnnotationMarkerItem;
52 else if ( sipCpp->type() == QLatin1String(
"linestring" ) )
54 sipType = sipType_QgsAnnotationLineItem;
56 else if ( sipCpp->type() == QLatin1String(
"polygon" ) )
58 sipType = sipType_QgsAnnotationPolygonItem;
60 else if ( sipCpp->type() == QLatin1String(
"pointtext" ) )
62 sipType = sipType_QgsAnnotationPointTextItem;
64 else if ( sipCpp->type() == QLatin1String(
"linetext" ) )
66 sipType = sipType_QgsAnnotationLineTextItem;
68 else if ( sipCpp->type() == QLatin1String(
"recttext" ) )
70 sipType = sipType_QgsAnnotationRectangleTextItem;
72 else if ( sipCpp->type() == QLatin1String(
"picture" ) )
74 sipType = sipType_QgsAnnotationPictureItem;
113 virtual QString
type()
const = 0;
218 Q_DECL_DEPRECATED
virtual QList< QgsAnnotationItemNode > nodes() const
SIP_DEPRECATED;
233 bool useSymbologyReferenceScale()
const {
return mUseReferenceScale; }
335 void setCalloutAnchor(
const QgsGeometry &anchor );
349 QSizeF offsetFromCallout()
const;
363 void setOffsetFromCallout(
const QSizeF &offset );
400 virtual bool writeCommonProperties( QDomElement &element, QDomDocument &document,
const QgsReadWriteContext &context )
const;
408 virtual bool readCommonProperties(
const QDomElement &element,
const QgsReadWriteContext &context );
422 bool mEnabled =
true;
423 bool mUseReferenceScale =
false;
424 double mReferenceScale = 0;
426 std::unique_ptr< QgsCallout > mCallout;
428 QSizeF mOffsetFromCallout;
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
QFlags< AnnotationItemFlag > AnnotationItemFlags
Annotation item flags.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
Abstract base class for annotation item edit operations.
Encapsulates the context for an annotation item edit operation.
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...
virtual ~QgsAnnotationItem()
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 & operator=(const QgsAnnotationItem &other)=delete
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 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.
Contains additional contextual information about the context in which a callout is being rendered.
Abstract base class for callout renderers.
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 geometry is the spatial representation of a feature.
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)