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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAnnotationManager : QObject
{
%Docstring(signature="appended")
Manages storage of a set of :py:class:`QgsAnnotation` annotation
objects.
:py:class:`QgsAnnotationManager` handles the storage, serializing and
deserializing of :py:class:`QgsAnnotations`. Usually this class is not
constructed directly, but rather accessed through a
:py:class:`QgsProject` via :py:func:`QgsProject.annotationManager()`.
:py:class:`QgsAnnotationManager` retains ownership of all the
annotations contained in the manager.
%End
%TypeHeaderCode
#include "qgsannotationmanager.h"
%End
public:
explicit QgsAnnotationManager( QgsProject *project /TransferThis/ = 0 );
%Docstring
Constructor for QgsAnnotationManager. The project will become the parent
object for this manager.
%End
~QgsAnnotationManager();
bool addAnnotation( QgsAnnotation *annotation /Transfer/ );
%Docstring
Adds an annotation to the manager. Ownership of the annotation is
transferred to the manager. Returns ``True`` if the addition was
successful, or ``False`` if the annotation could not be added.
.. seealso:: :py:func:`removeAnnotation`
.. seealso:: :py:func:`annotationAdded`
%End
bool removeAnnotation( QgsAnnotation *annotation );
%Docstring
Removes an annotation from the manager. The annotation is deleted.
Returns ``True`` if the removal was successful, or ``False`` if the
removal failed (eg as a result of removing an annotation which is not
contained in the manager).
.. seealso:: :py:func:`addAnnotation`
.. seealso:: :py:func:`annotationRemoved`
.. seealso:: :py:func:`annotationAboutToBeRemoved`
.. seealso:: :py:func:`clear`
%End
void clear();
%Docstring
Removes and deletes all annotations from the manager.
.. seealso:: :py:func:`removeAnnotation`
%End
QList< QgsAnnotation * > annotations() const;
%Docstring
Returns a list of all annotations contained in the manager.
.. seealso:: :py:func:`cloneAnnotations`
%End
QList< QgsAnnotation * > cloneAnnotations() const /Factory/;
%Docstring
Returns a list containing clones of all annotations contained in the
manager. The caller takes responsibility for deleting all returned
annotations.
.. seealso:: :py:func:`annotations`
%End
bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
%Docstring
Reads the manager's state from a DOM element, restoring all annotations
present in the XML document.
.. seealso:: :py:func:`writeXml`
%End
QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Returns a DOM element representing the state of the manager.
.. seealso:: :py:func:`readXml`
%End
bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
%Docstring
Accepts the specified style entity ``visitor``, causing it to visit all
style entities associated within the contained annotations.
Returns ``True`` if the visitor should continue visiting other objects,
or ``False`` if visiting should be canceled.
.. versionadded:: 3.10
%End
signals:
void annotationAdded( QgsAnnotation *annotation );
%Docstring
Emitted when a annotation has been added to the manager
%End
void annotationRemoved();
%Docstring
Emitted when an annotation was removed from the manager
%End
void annotationAboutToBeRemoved( QgsAnnotation *annotation );
%Docstring
Emitted when an annotation is about to be removed from the manager
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|