QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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;
38 
45 class GUI_EXPORT QgsGui : public QObject
46 {
47  Q_OBJECT
48 
49  public:
50 
55  {
56  UseCrsOfFirstLayerAdded = 1,
57  UsePresetCrs = 2,
58  };
59  Q_ENUM( ProjectCrsBehavior )
60 
61 
62  QgsGui( const QgsGui &other ) = delete;
63 
65  QgsGui &operator=( const QgsGui &other ) = delete;
66 
70  static QgsGui *instance();
71 
77  SIP_SKIP static QgsNative *nativePlatformInterface();
78 
82  static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
83 
87  static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
88 
92  static QgsShortcutsManager *shortcutsManager();
93 
97  static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
98 
102  static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
103 
107  static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
108 
113  static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
114 
119  static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
120 
126  static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
127 
132  static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
133 
139  static QgsWindowManagerInterface *windowManager();
140 
146  static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
147 
152  enum HigFlag
153  {
154  HigMenuTextIsTitleCase = 1 << 0,
155  HigDialogTitleIsTitleCase = 1 << 1
156  };
157  Q_DECLARE_FLAGS( HigFlags, HigFlag )
158 
159 
163  static QgsGui::HigFlags higFlags();
164 
165  ~QgsGui();
166 
167  private:
168 
169  QgsGui();
170 
171  QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
172  QgsNative *mNative = nullptr;
173  QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
174  QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
175  QgsShortcutsManager *mShortcutsManager = nullptr;
176  QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
177  QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
178  QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
179  QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
180  QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
181  QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
182  std::unique_ptr< QgsWindowManagerInterface > mWindowManager;
183 
184 #ifdef SIP_RUN
185  QgsGui( const QgsGui &other );
186 #endif
187 
188 };
189 
190 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsGui::HigFlags )
191 
192 #endif // QGSGUI_H
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:45
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:119
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_KEEPREFERENCE
Definition: qgis_sip.h:79
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:152
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:54