QGIS API Documentation 3.41.0-Master (af5edcb665c)
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:
50 QgsInputControllerManager( QObject *parent SIP_TRANSFERTHIS = nullptr );
52
59 QStringList available2DMapControllers() const;
60
61 /*
62 * IMPORTANT: While it seems like /Factory/ would be the correct annotation here, that's not
63 * the case.
64 * As per Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:
65 *
66 * "
67 * /Factory/ is used when the instance returned is guaranteed to be new to Python.
68 * In this case it isn't because it has already been seen when being returned by QgsProcessingAlgorithm::createInstance()
69 * (However for a different sub-class implemented in C++ then it would be the first time it was seen
70 * by Python so the /Factory/ on create() would be correct.)
71 *
72 * You might try using /TransferBack/ on create() instead - that might be the best compromise.
73 * "
74 */
75
85 QgsAbstract2DMapController *create2DMapController( const QString &deviceId ) const SIP_TRANSFERBACK;
86
97 bool register2DMapController( QgsAbstract2DMapController *controller SIP_TRANSFER );
98
105 QStringList available3DMapControllers() const;
106
107 /*
108 * IMPORTANT: While it seems like /Factory/ would be the correct annotation here, that's not
109 * the case.
110 * As per Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:
111 *
112 * "
113 * /Factory/ is used when the instance returned is guaranteed to be new to Python.
114 * In this case it isn't because it has already been seen when being returned by QgsProcessingAlgorithm::createInstance()
115 * (However for a different sub-class implemented in C++ then it would be the first time it was seen
116 * by Python so the /Factory/ on create() would be correct.)
117 *
118 * You might try using /TransferBack/ on create() instead - that might be the best compromise.
119 * "
120 */
121
131 QgsAbstract3DMapController *create3DMapController( const QString &deviceId ) const SIP_TRANSFERBACK;
132
143 bool register3DMapController( QgsAbstract3DMapController *controller SIP_TRANSFER );
144
145 private:
146 QMap<QString, QgsAbstract2DMapController *> m2DMapControllers;
147 QMap<QString, QgsAbstract3DMapController *> m3DMapControllers;
148};
149
150#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