1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationlayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAnnotationLayer : QgsMapLayer
{
%Docstring(signature="appended")
Represents a map layer containing a set of georeferenced annotations,
e.g. markers, lines, polygons or text items.
Annotation layers store a set of :py:class:`QgsAnnotationItem` items,
which are rendered according to the item's z-order.
.. versionadded:: 3.16
%End
%TypeHeaderCode
#include "qgsannotationlayer.h"
%End
public:
struct LayerOptions
{
explicit LayerOptions( const QgsCoordinateTransformContext &transformContext );
%Docstring
Constructor for LayerOptions.
%End
QgsCoordinateTransformContext transformContext;
};
QgsAnnotationLayer( const QString &name, const QgsAnnotationLayer::LayerOptions &options );
%Docstring
Constructor for a new QgsAnnotationLayer with the specified layer
``name``.
The ``options`` argument specifies load-time layer options.
%End
~QgsAnnotationLayer();
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsAnnotationLayer: '%1'>" ).arg( sipCpp->name() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
void reset();
%Docstring
Resets the annotation layer to a default state, and clears all items
from it.
%End
QString addItem( QgsAnnotationItem *item /Transfer/ );
%Docstring
Adds an ``item`` to the layer.
Ownership of ``item`` is transferred to the layer.
Returns the unique ID assigned to the item.
%End
void replaceItem( const QString &id, QgsAnnotationItem *item /Transfer/ );
%Docstring
Replaces the existing item with matching ``id`` with a new ``item``.
Ownership of ``item`` is transferred to the layer.
.. versionadded:: 3.22
%End
bool removeItem( const QString &id );
%Docstring
Removes (and deletes) the item with matching ``id``.
%End
void clear();
%Docstring
Removes all items from the layer.
%End
bool isEmpty() const;
%Docstring
Returns ``True`` if the annotation layer is empty and contains no
annotations.
%End
QMap<QString, QgsAnnotationItem *> items() const;
%Docstring
Returns a map of items contained in the layer, by unique item ID.
This map contains references to items owned by the layer, and ownership
of these remains with the layer.
%End
QgsAnnotationItem *item( const QString &id ) const;
%Docstring
Returns the item with the specified ``id``, or ``None`` if no matching
item was found.
.. versionadded:: 3.22
%End
QStringList itemsInBounds( const QgsRectangle &bounds, QgsRenderContext &context, QgsFeedback *feedback = 0 ) const;
%Docstring
Returns a list of the IDs of all annotation items within the specified
``bounds`` (in layer CRS), when rendered using the given render
``context``.
The optional ``feedback`` argument can be used to cancel the search
early.
.. versionadded:: 3.22
%End
Qgis::AnnotationItemEditOperationResult applyEdit( QgsAbstractAnnotationItemEditOperation *operation ) /Deprecated/;
%Docstring
Applies an edit ``operation`` to the layer.
Returns ``True`` if the operation was successfully applied.
.. deprecated:: 3.40
Use :py:func:`~QgsAnnotationLayer.applyEditV2` instead.
%End
Qgis::AnnotationItemEditOperationResult applyEditV2( QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context );
%Docstring
Applies an edit ``operation`` to the layer.
Returns ``True`` if the operation was successfully applied.
.. versionadded:: 3.40
%End
virtual Qgis::MapLayerProperties properties() const;
virtual QgsAnnotationLayer *clone() const /Factory/;
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /Factory/;
virtual QgsRectangle extent() const;
virtual void setTransformContext( const QgsCoordinateTransformContext &context );
virtual bool readXml( const QDomNode &layerNode, QgsReadWriteContext &context );
virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &, StyleCategories categories = AllStyleCategories ) const;
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories );
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories ) const;
virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories );
virtual bool isEditable() const;
virtual bool supportsEditing() const;
virtual QgsDataProvider *dataProvider();
virtual QString htmlMetadata() const;
virtual void resolveReferences( QgsProject *project );
QgsPaintEffect *paintEffect() const;
%Docstring
Returns the current paint effect for the layer.
.. seealso:: :py:func:`setPaintEffect`
.. versionadded:: 3.22
%End
void setPaintEffect( QgsPaintEffect *effect /Transfer/ );
%Docstring
Sets the current paint ``effect`` for the layer.
Ownership is transferred to the renderer.
.. seealso:: :py:func:`paintEffect`
.. versionadded:: 3.22
%End
QgsMapLayer *linkedVisibilityLayer();
%Docstring
Returns a linked layer, where the items in this annotation layer will
only be visible when the linked layer is also visible.
.. seealso:: :py:func:`setLinkedVisibilityLayer`
.. versionadded:: 3.40
%End
void setLinkedVisibilityLayer( QgsMapLayer *layer );
%Docstring
Sets a linked ``layer``, where the items in this annotation layer will
only be visible when the linked layer is also visible.
.. seealso:: :py:func:`linkedVisibilityLayer`
.. versionadded:: 3.40
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationlayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|