QGIS/python/core/annotations/qgsannotationmanager.sip
Nyall Dawson 4058f4734b Annotations are now handled at a project level
This commit implements a new QgsAnnotationManager class, which
handles storage, writing and retrieval of annotations.

QgsProject has an annotationManager() attached to it. Map canvases
sync their visible QgsMapCanvasAnnotationItems to the annotations
contained within the project's annotation manager.

This moves all management, storage and retrieval of annotations
up to core and out of app/canvas.
2017-01-30 14:57:16 +10:00

25 lines
684 B
Plaintext

class QgsAnnotationManager : QObject
{
%TypeHeaderCode
#include <qgsannotationmanager.h>
%End
public:
explicit QgsAnnotationManager( QgsProject* project = nullptr );
~QgsAnnotationManager();
bool addAnnotation( QgsAnnotation* annotation /Transfer/ );
bool removeAnnotation( QgsAnnotation* annotation );
void clear();
QList< QgsAnnotation* > annotations() const;
bool readXml( const QDomElement& element, const QDomDocument& doc );
QDomElement writeXml( QDomDocument& doc ) const;
signals:
void annotationAdded( QgsAnnotation* annotation );
void annotationRemoved();
void annotationAboutToBeRemoved( QgsAnnotation* annotation );
};