QGIS API Documentation 3.39.0-Master (3783037d301)
Loading...
Searching...
No Matches
qgsinputcontrollermanager.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsinputcontroller.h
3 ---------------------
4 begin : March 2023
5 copyright : (C) 2023 by 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 QGSINPUTCONTROLLER_H
17#define QGSINPUTCONTROLLER_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21#include "qgis.h"
22
23#include <QObject>
24#include <QMap>
25
28
39class GUI_EXPORT QgsInputControllerManager : public QObject
40{
41 Q_OBJECT
42
43 public:
44
51 QgsInputControllerManager( QObject *parent SIP_TRANSFERTHIS = nullptr );
53
60 QStringList available2DMapControllers() const;
61
62 /*
63 * IMPORTANT: While it seems like /Factory/ would be the correct annotation here, that's not
64 * the case.
65 * As per Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:
66 *
67 * "
68 * /Factory/ is used when the instance returned is guaranteed to be new to Python.
69 * In this case it isn't because it has already been seen when being returned by QgsProcessingAlgorithm::createInstance()
70 * (However for a different sub-class implemented in C++ then it would be the first time it was seen
71 * by Python so the /Factory/ on create() would be correct.)
72 *
73 * You might try using /TransferBack/ on create() instead - that might be the best compromise.
74 * "
75 */
76
86 QgsAbstract2DMapController *create2DMapController( const QString &deviceId ) const SIP_TRANSFERBACK;
87
98 bool register2DMapController( QgsAbstract2DMapController *controller SIP_TRANSFER );
99
106 QStringList available3DMapControllers() const;
107
108 /*
109 * IMPORTANT: While it seems like /Factory/ would be the correct annotation here, that's not
110 * the case.
111 * As per Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:
112 *
113 * "
114 * /Factory/ is used when the instance returned is guaranteed to be new to Python.
115 * In this case it isn't because it has already been seen when being returned by QgsProcessingAlgorithm::createInstance()
116 * (However for a different sub-class implemented in C++ then it would be the first time it was seen
117 * by Python so the /Factory/ on create() would be correct.)
118 *
119 * You might try using /TransferBack/ on create() instead - that might be the best compromise.
120 * "
121 */
122
132 QgsAbstract3DMapController *create3DMapController( const QString &deviceId ) const SIP_TRANSFERBACK;
133
144 bool register3DMapController( QgsAbstract3DMapController *controller SIP_TRANSFER );
145
146 private:
147
148 QMap< QString, QgsAbstract2DMapController * > m2DMapControllers;
149 QMap< QString, QgsAbstract3DMapController * > m3DMapControllers;
150
151};
152
153#endif // QGSINPUTCONTROLLER_H
Abstract base class for all 2D map controllers.
Abstract base class for all 3D map controllers.
Manages input control devices.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48