QGIS API Documentation  3.9.0-Master (224899f119)
qgsgui.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgui.h
3  --------
4  begin : May 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSGUI_H
19 #define QGSGUI_H
20 
21 #include "qgis_gui.h"
22 #include "qgis_sip.h"
23 #include <QWidget>
24 #include <memory>
25 
31 class QgsNative;
35 class QgsProcessingRecentAlgorithmLog;
36 class QgsWindowManagerInterface;
40 
47 class GUI_EXPORT QgsGui : public QObject
48 {
49  Q_OBJECT
50 
51  public:
52 
57  {
58  UseCrsOfFirstLayerAdded = 1,
59  UsePresetCrs = 2,
60  };
61  Q_ENUM( ProjectCrsBehavior )
62 
63 
64  QgsGui( const QgsGui &other ) = delete;
65 
67  QgsGui &operator=( const QgsGui &other ) = delete;
68 
72  static QgsGui *instance();
73 
79  SIP_SKIP static QgsNative *nativePlatformInterface();
80 
84  static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
85 
89  static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
90 
94  static QgsShortcutsManager *shortcutsManager();
95 
99  static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
100 
104  static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
105 
109  static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
110 
115  static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
116 
121  static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
122 
128  static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
129 
134  static QgsProjectStorageGuiRegistry *projectStorageGuiRegistry() SIP_KEEPREFERENCE;
135 
140  static QgsProviderGuiRegistry *providerGuiRegistry() SIP_KEEPREFERENCE;
141 
146  static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
147 
153  static QgsWindowManagerInterface *windowManager();
154 
160  static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
161 
166  enum HigFlag
167  {
168  HigMenuTextIsTitleCase = 1 << 0,
169  HigDialogTitleIsTitleCase = 1 << 1
170  };
171  Q_DECLARE_FLAGS( HigFlags, HigFlag )
172 
173 
177  static QgsGui::HigFlags higFlags();
178 
179  ~QgsGui();
180 
181  private:
182 
183  QgsGui();
184 
185  QgsProviderGuiRegistry *mProviderGuiRegistry = nullptr;
186  QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
187  QgsNative *mNative = nullptr;
188  QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
189  QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
190  QgsShortcutsManager *mShortcutsManager = nullptr;
191  QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
192  QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
193  QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
194  QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
195  QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
196  QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
197  QgsProjectStorageGuiRegistry *mProjectStorageGuiRegistry = nullptr;
198  std::unique_ptr< QgsWindowManagerInterface > mWindowManager;
199 
200 #ifdef SIP_RUN
201  QgsGui( const QgsGui &other );
202 #endif
203 
204 };
205 
206 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsGui::HigFlags )
207 
208 #endif // QGSGUI_H
A registry / canonical manager of GUI parts of project storage backends.
This class manages all known edit widget factories.
QgsGui is a singleton class containing various registry and other global members related to GUI class...
Definition: qgsgui.h:47
Shortcuts manager is a class that contains a list of QActions and QShortcuts that have been registere...
The QgsProcessingGuiRegistry is a home for widgets for processing configuration widgets.
Registry of available layout item GUI behavior.
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_KEEPREFERENCE
Definition: qgis_sip.h:86
Registry of widgets that may be embedded into layer tree view.
This class tracks map layer actions.
This class keeps a list of source select providers that may add items to the QgsDataSourceManagerDial...
This class keeps a list of data item GUI providers that may affect how QgsDataItems behave within the...
HigFlag
HIG flags, which indicate the Human Interface Guidelines for the current platform.
Definition: qgsgui.h:166
QgsWidgetStateHelper is a helper class to save and restore the geometry of QWidgets in the applicatio...
ProjectCrsBehavior
Defines the behavior to use when setting the CRS for a newly created project.
Definition: qgsgui.h:56
A registry / canonical manager of GUI parts of data providers.