QGIS API Documentation  3.6.0-Noosa (5873452)
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
46 {
47  public:
48 
50  QgsGui( const QgsGui &other ) = delete;
51 
53  QgsGui &operator=( const QgsGui &other ) = delete;
54 
58  static QgsGui *instance();
59 
65  SIP_SKIP static QgsNative *nativePlatformInterface();
66 
70  static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
71 
75  static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
76 
80  static QgsShortcutsManager *shortcutsManager();
81 
85  static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
86 
90  static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
91 
95  static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
96 
101  static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
102 
107  static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
108 
114  static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
115 
120  static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
121 
127  static QgsWindowManagerInterface *windowManager();
128 
134  static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
135 
140  enum HigFlag
141  {
142  HigMenuTextIsTitleCase = 1 << 0,
143  HigDialogTitleIsTitleCase = 1 << 1
144  };
145  Q_DECLARE_FLAGS( HigFlags, HigFlag )
146 
147 
151  static QgsGui::HigFlags higFlags();
152 
153  ~QgsGui();
154 
155  private:
156 
157  QgsGui();
158 
159  QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
160  QgsNative *mNative = nullptr;
161  QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
162  QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
163  QgsShortcutsManager *mShortcutsManager = nullptr;
164  QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
165  QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
166  QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
167  QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
168  QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
169  QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
170  std::unique_ptr< QgsWindowManagerInterface > mWindowManager;
171 
172 #ifdef SIP_RUN
173  QgsGui( const QgsGui &other );
174 #endif
175 
176 };
177 
178 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsGui::HigFlags )
179 
180 #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:140
QgsWidgetStateHelper is a helper class to save and restore the geometry of QWidgets in the applicatio...