QGIS/python/core/auto_generated/annotations/qgsannotationmanager.sip.in
Nyall Dawson 590d1aae9d [FEATURE][API] Visitor API for style entities
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.

E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
2019-07-06 12:36:54 +10:00

141 lines
4.3 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAnnotationManager : QObject
{
%Docstring
Manages storage of a set of QgsAnnotation annotation objects.
QgsAnnotationManager handles the storage, serializing and deserializing
of QgsAnnotations. Usually this class is not constructed directly, but
rather accessed through a QgsProject via :py:func:`QgsProject.annotationManager()`
QgsAnnotationManager retains ownership of all the annotations contained
in the manager.
.. versionadded:: 3.0
%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.pl again *
************************************************************************/