QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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;
37 
44 class GUI_EXPORT QgsGui : public QObject
45 {
46  Q_OBJECT
47 
48  public:
49 
54  {
55  UseCrsOfFirstLayerAdded = 1,
56  UsePresetCrs = 2,
57  };
58  Q_ENUM( ProjectCrsBehavior )
59 
60 
61  QgsGui( const QgsGui &other ) = delete;
62 
64  QgsGui &operator=( const QgsGui &other ) = delete;
65 
69  static QgsGui *instance();
70 
76  SIP_SKIP static QgsNative *nativePlatformInterface();
77 
81  static QgsEditorWidgetRegistry *editorWidgetRegistry();
82 
86  static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry();
87 
91  static QgsShortcutsManager *shortcutsManager();
92 
96  static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry();
97 
101  static QgsMapLayerActionRegistry *mapLayerActionRegistry();
102 
106  static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry();
107 
112  static QgsProcessingGuiRegistry *processingGuiRegistry();
113 
118  static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
119 
124  static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
125 
131  static QgsWindowManagerInterface *windowManager();
132 
138  static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
139 
144  enum HigFlag
145  {
146  HigMenuTextIsTitleCase = 1 << 0,
147  HigDialogTitleIsTitleCase = 1 << 1
148  };
149  Q_DECLARE_FLAGS( HigFlags, HigFlag )
150 
151 
155  static QgsGui::HigFlags higFlags();
156 
157  ~QgsGui();
158 
159  private:
160 
161  QgsGui();
162 
163  QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
164  QgsNative *mNative = nullptr;
165  QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
166  QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
167  QgsShortcutsManager *mShortcutsManager = nullptr;
168  QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
169  QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
170  QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
171  QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
172  QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
173  std::unique_ptr< QgsWindowManagerInterface > mWindowManager;
174 
175 #ifdef SIP_RUN
176  QgsGui( const QgsGui &other );
177 #endif
178 
179 };
180 
181 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsGui::HigFlags )
182 
183 #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:44
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
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
#define SIP_TRANSFER
Definition: qgis_sip.h:36
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...
HigFlag
HIG flags, which indicate the Human Interface Guidelines for the current platform.
Definition: qgsgui.h:144
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:53