1 /***************************************************************************
2                              qgscreateannotationitemmaptool_impl.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 QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
16 #define QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
17 
18 #include "qgis_gui.h"
19 #include "qgis_sip.h"
20 #include "qgscreateannotationitemmaptool.h"
21 #include "qgsmaptoolcapture.h"
22 
23 #define SIP_NO_FILE
24 
25 ///@cond PRIVATE
26 
27 class QgsMapToolCaptureAnnotationItem: public QgsMapToolCapture, public QgsCreateAnnotationItemMapToolInterface
28 {
29     Q_OBJECT
30   public:
31     QgsMapToolCaptureAnnotationItem( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode );
32     QgsCreateAnnotationItemMapToolHandler *handler() override;
33     QgsMapTool *mapTool() override;
34     QgsMapLayer *layer() const override;
35     QgsMapToolCapture::Capabilities capabilities() const override;
36     bool supportsTechnique( CaptureTechnique technique ) const override;
37 
38   protected:
39 
40     QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
41 
42 };
43 
44 class QgsCreatePointTextItemMapTool: public QgsMapToolAdvancedDigitizing, public QgsCreateAnnotationItemMapToolInterface
45 {
46     Q_OBJECT
47 
48   public:
49 
50     QgsCreatePointTextItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
51     ~QgsCreatePointTextItemMapTool() override;
52 
53     void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
54     QgsCreateAnnotationItemMapToolHandler *handler() override;
55     QgsMapTool *mapTool() override;
56 
57   private:
58 
59     QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
60 
61 };
62 
63 
64 class QgsCreateMarkerItemMapTool: public QgsMapToolCaptureAnnotationItem
65 {
66     Q_OBJECT
67 
68   public:
69 
70     QgsCreateMarkerItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
71 
72     void cadCanvasReleaseEvent( QgsMapMouseEvent *event ) override;
73 
74 };
75 
76 class QgsCreateLineItemMapTool: public QgsMapToolCaptureAnnotationItem
77 {
78     Q_OBJECT
79 
80   public:
81 
82     QgsCreateLineItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
83 
84     void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
85 
86 };
87 
88 class QgsCreatePolygonItemMapTool: public QgsMapToolCaptureAnnotationItem
89 {
90     Q_OBJECT
91 
92   public:
93 
94     QgsCreatePolygonItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
95 
96     void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
97 
98 };
99 
100 ///@endcond PRIVATE
101 
102 #endif // QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
103