2017-04-02 21:24:19 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/annotations/qgsannotationmanager.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-30 14:57:16 +10:00
|
|
|
class QgsAnnotationManager : QObject
|
|
|
|
{
|
2017-04-02 21:24:19 +10:00
|
|
|
%Docstring
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
2017-04-02 21:28:20 +10:00
|
|
|
Manages storage of a set of QgsAnnotation annotation objects.
|
2017-04-02 21:24:19 +10:00
|
|
|
|
|
|
|
QgsAnnotationManager handles the storage, serializing and deserializing
|
|
|
|
of QgsAnnotations. Usually this class is not constructed directly, but
|
2017-04-05 10:32:27 +10:00
|
|
|
rather accessed through a QgsProject via QgsProject.annotationManager().
|
2017-04-02 21:24:19 +10:00
|
|
|
|
|
|
|
QgsAnnotationManager retains ownership of all the annotations contained
|
|
|
|
in the manager.
|
|
|
|
%End
|
|
|
|
|
2017-01-30 14:57:16 +10:00
|
|
|
%TypeHeaderCode
|
2017-04-02 21:24:19 +10:00
|
|
|
#include "qgsannotationmanager.h"
|
2017-01-30 14:57:16 +10:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-04-02 21:24:19 +10:00
|
|
|
explicit QgsAnnotationManager( QgsProject *project /TransferThis/ = 0 );
|
|
|
|
%Docstring
|
|
|
|
Constructor for QgsAnnotationManager. The project will become the parent object for this
|
|
|
|
manager.
|
|
|
|
%End
|
|
|
|
|
2017-01-30 14:57:16 +10:00
|
|
|
~QgsAnnotationManager();
|
|
|
|
|
2017-04-02 21:24:19 +10:00
|
|
|
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.
|
2017-04-03 11:59:45 +10:00
|
|
|
\see removeAnnotation()
|
|
|
|
\see annotationAdded()
|
2017-04-02 21:24:19 +10:00
|
|
|
%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).
|
2017-04-03 11:59:45 +10:00
|
|
|
\see addAnnotation()
|
|
|
|
\see compositionRemoved()
|
|
|
|
\see compositionAboutToBeRemoved()
|
|
|
|
\see clear()
|
2017-04-02 21:24:19 +10:00
|
|
|
%End
|
|
|
|
|
2017-01-30 14:57:16 +10:00
|
|
|
void clear();
|
2017-04-02 21:24:19 +10:00
|
|
|
%Docstring
|
|
|
|
Removes and deletes all annotations from the manager.
|
2017-04-03 11:59:45 +10:00
|
|
|
\see removeAnnotation()
|
2017-04-02 21:24:19 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QList< QgsAnnotation * > annotations() const;
|
|
|
|
%Docstring
|
|
|
|
Returns a list of all annotations contained in the manager.
|
|
|
|
%End
|
|
|
|
|
|
|
|
bool readXml( const QDomElement &element, const QDomDocument &doc );
|
|
|
|
%Docstring
|
|
|
|
Reads the manager's state from a DOM element, restoring all annotations
|
|
|
|
present in the XML document.
|
2017-04-03 11:59:45 +10:00
|
|
|
\see writeXml()
|
2017-04-02 21:24:19 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QDomElement writeXml( QDomDocument &doc ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns a DOM element representing the state of the manager.
|
2017-04-03 11:59:45 +10:00
|
|
|
\see readXml()
|
2017-04-02 21:24:19 +10:00
|
|
|
%End
|
2017-01-30 14:57:16 +10:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
2017-04-02 21:24:19 +10:00
|
|
|
void annotationAdded( QgsAnnotation *annotation );
|
|
|
|
%Docstring
|
|
|
|
Emitted when a annotation has been added to the manager
|
|
|
|
%End
|
|
|
|
|
2017-01-30 14:57:16 +10:00
|
|
|
void annotationRemoved();
|
2017-04-02 21:24:19 +10:00
|
|
|
%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
|
2017-01-30 14:57:16 +10:00
|
|
|
|
|
|
|
};
|
2017-04-02 21:24:19 +10:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/annotations/qgsannotationmanager.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|