QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgscreateannotationitemmaptool.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscreateannotationitemmaptool.h
3  ------------------------
4  Date : September 2021
5  Copyright : (C) 2021 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 #ifndef QGSCREATEANNOTATIONITEMMAPTOOL_H
16 #define QGSCREATEANNOTATIONITEMMAPTOOL_H
17 
18 #include "qgis_gui.h"
19 #include "qgis_sip.h"
21 
22 class QgsAnnotationItem;
23 class QgsAnnotationLayer;
24 
40 class GUI_EXPORT QgsCreateAnnotationItemMapToolHandler : public QObject
41 {
42  Q_OBJECT
43 
44  public:
45 
49  QgsCreateAnnotationItemMapToolHandler( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, QObject *parent = nullptr );
50 
52 
56  QgsAnnotationItem *takeCreatedItem() SIP_TRANSFERBACK;
57 
61  QgsAnnotationLayer *targetLayer();
62 
71  void pushCreatedItem( QgsAnnotationItem *item SIP_TRANSFER );
72 
73  signals:
74 
80  void itemCreated();
81 
82  private:
83 
84  QgsMapCanvas *mMapCanvas = nullptr;
85  QgsAdvancedDigitizingDockWidget *mCadDockWidget = nullptr;
86  std::unique_ptr< QgsAnnotationItem > mCreatedItem;
87 
88 };
89 
103 {
104  public:
105 
106  virtual ~QgsCreateAnnotationItemMapToolInterface() = default;
107 
111  virtual QgsCreateAnnotationItemMapToolHandler *handler() = 0;
112 
116  virtual QgsMapTool *mapTool() = 0;
117 };
118 
119 #endif // QGSCREATEANNOTATIONITEMMAPTOOL_H
qgsmaptooladvanceddigitizing.h
QgsCreateAnnotationItemMapToolInterface
An interface for map tools which create annotation items.
Definition: qgscreateannotationitemmaptool.h:102
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsCreateAnnotationItemMapToolHandler
A handler object for map tools which create annotation items.
Definition: qgscreateannotationitemmaptool.h:40
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition: qgis_sip.h:48
QgsMapTool
Abstract base class for all map tools. Map tools are user interactive tools for manipulating the map ...
Definition: qgsmaptool.h:70
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsAdvancedDigitizingDockWidget
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
Definition: qgsadvanceddigitizingdockwidget.h:50
QgsAnnotationLayer
Represents a map layer containing a set of georeferenced annotations, e.g. markers,...
Definition: qgsannotationlayer.h:46
QgsAnnotationItem
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Definition: qgsannotationitem.h:42