QGIS API Documentation
3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
src
core
annotations
qgsannotationmanager.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsannotationmanager.h
3
----------------------
4
Date : January 2017
5
Copyright : (C) 2017 Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSANNOTATIONMANAGER_H
17
#define QGSANNOTATIONMANAGER_H
18
19
#include "qgis_core.h"
20
#include "
qgis.h
"
21
#include <QObject>
22
#include <QDomElement>
23
24
class
QgsReadWriteContext
;
25
class
QgsProject
;
26
class
QgsAnnotation
;
27
class
QgsStyleEntityVisitorInterface
;
28
class
QgsAnnotationLayer
;
29
class
QgsAnnotationItem
;
30
class
QgsCoordinateTransformContext
;
31
46
class
CORE_EXPORT
QgsAnnotationManager
:
public
QObject
47
{
48
Q_OBJECT
49
50
public
:
51
56
explicit
QgsAnnotationManager
(
QgsProject
*project
SIP_TRANSFERTHIS
=
nullptr
);
57
58
~QgsAnnotationManager
()
override
;
59
66
bool
addAnnotation(
QgsAnnotation
*annotation
SIP_TRANSFER
);
67
77
bool
removeAnnotation(
QgsAnnotation
*annotation );
78
83
void
clear();
84
89
QList< QgsAnnotation * > annotations()
const
;
90
97
QList< QgsAnnotation * > cloneAnnotations()
const
SIP_FACTORY
;
98
104
bool
readXml(
const
QDomElement &element,
const
QgsReadWriteContext
&context );
105
118
bool
readXmlAndUpgradeToAnnotationLayerItems(
const
QDomElement &element,
const
QgsReadWriteContext
&context,
119
QgsAnnotationLayer
*layer,
const
QgsCoordinateTransformContext
&transformContext )
SIP_SKIP
;
120
125
QDomElement writeXml( QDomDocument &doc,
const
QgsReadWriteContext
&context )
const
;
126
136
bool
accept(
QgsStyleEntityVisitorInterface
*visitor )
const
;
137
138
signals:
139
141
void
annotationAdded
(
QgsAnnotation
*annotation );
142
144
void
annotationRemoved
();
145
147
void
annotationAboutToBeRemoved
(
QgsAnnotation
*annotation );
148
149
private
:
150
151
bool
readXmlPrivate(
const
QDomElement &element,
const
QgsReadWriteContext
&context,
QgsAnnotationLayer
*layer,
const
QgsCoordinateTransformContext
&transformContext );
152
static
std::unique_ptr< QgsAnnotationItem > convertToAnnotationItem(
QgsAnnotation
*annotation,
QgsAnnotationLayer
*layer,
153
const
QgsCoordinateTransformContext
&transformContext );
154
155
QgsProject
*mProject =
nullptr
;
156
157
QList< QgsAnnotation * > mAnnotations;
158
159
QgsAnnotation
*createAnnotationFromXml(
const
QDomElement &element,
const
QgsReadWriteContext
&context );
160
161
};
162
163
#endif
// QGSANNOTATIONMANAGER_H
QgsAnnotationItem
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Definition
qgsannotationitem.h:44
QgsAnnotationLayer
Represents a map layer containing a set of georeferenced annotations, e.g.
Definition
qgsannotationlayer.h:48
QgsAnnotationManager
Manages storage of a set of QgsAnnotation annotation objects.
Definition
qgsannotationmanager.h:47
QgsAnnotationManager::annotationRemoved
void annotationRemoved()
Emitted when an annotation was removed from the manager.
QgsAnnotationManager::annotationAboutToBeRemoved
void annotationAboutToBeRemoved(QgsAnnotation *annotation)
Emitted when an annotation is about to be removed from the manager.
QgsAnnotationManager::annotationAdded
void annotationAdded(QgsAnnotation *annotation)
Emitted when a annotation has been added to the manager.
QgsAnnotation
Abstract base class for annotation items which are drawn over a map.
Definition
qgsannotation.h:53
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition
qgscoordinatetransformcontext.h:57
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:107
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition
qgsreadwritecontext.h:34
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g.
Definition
qgsstyleentityvisitor.h:34
qgis.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:53
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:126
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:36
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:76
Generated on Tue Nov 19 2024 18:20:01 for QGIS API Documentation by
1.9.8