dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
icore.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef ICORE_H
29 #define ICORE_H
30 
31 #include "core_global.h"
32 #include <QtCore/QObject>
33 #include <QSettings>
34 
35 QT_BEGIN_NAMESPACE
36 class QMainWindow;
37 class QSettings;
38 template <class T>
39 class QList;
40 QT_END_NAMESPACE
41 
42 namespace Core {
43 
44 class ActionManager;
45 class IContext;
46 class IWizard;
47 class ConnectionManager;
48 class BoardManager;
49 class GlobalMessaging;
50 class MessageManager;
51 class ModeManager;
52 class UniqueIDManager;
53 class ThreadManager;
54 class UAVGadgetManager;
55 class UAVGadgetInstanceManager;
56 class IConfigurablePlugin;
57 
58 class CORE_EXPORT ICore : public QObject
59 {
60  Q_OBJECT
61 
62 public:
63  ICore() {}
64  virtual ~ICore() {}
65 
66  static ICore *instance();
67 
68  virtual bool showOptionsDialog(const QString &group = QString(),
69  const QString &page = QString(), QWidget *parent = nullptr) = 0;
70 
71  virtual ActionManager *actionManager() const = 0;
72  virtual UniqueIDManager *uniqueIDManager() const = 0;
73  virtual ModeManager *modeManager() const = 0;
74  virtual ConnectionManager *connectionManager() const = 0;
75  virtual GlobalMessaging *globalMessaging() const = 0;
76  virtual BoardManager *boardManager() const = 0;
77  virtual UAVGadgetInstanceManager *uavGadgetInstanceManager() const = 0;
78 
79  virtual QSettings *settings(QSettings::Scope scope = QSettings::UserScope) const = 0;
80  virtual void readMainSettings(QSettings *qs, bool workspaceDiffOnly = false) = 0;
81  virtual void saveMainSettings(QSettings *qs) = 0;
82  virtual void readSettings(IConfigurablePlugin *plugin, QSettings *qs = nullptr) = 0;
83  virtual void saveSettings(IConfigurablePlugin *plugin, QSettings *qs = nullptr) = 0;
84  virtual void deleteSettings() = 0;
85 
86  virtual QString resourcePath() const = 0;
87 
88  virtual QMainWindow *mainWindow() const = 0;
89 
90  // adds and removes additional active contexts, this context is appended to the
91  // currently active contexts. call updateContext after changing
92  virtual IContext *currentContextObject() const = 0;
93  virtual void addAdditionalContext(int context) = 0;
94  virtual void removeAdditionalContext(int context) = 0;
95  virtual bool hasContext(int context) const = 0;
96  virtual void addContextObject(IContext *context) = 0;
97  virtual void removeContextObject(IContext *context) = 0;
98 
99  virtual void updateContext() = 0;
100 
101  virtual void openFiles(const QStringList &fileNames) = 0;
102 
103 signals:
104  void coreAboutToOpen();
105  void coreOpened();
106  void saveSettingsRequested();
107  void optionsDialogRequested();
108  void coreAboutToClose();
109  void contextAboutToChange(Core::IContext *context);
110  void contextChanged(Core::IContext *context);
111 };
112 
113 } // namespace Core
114 
115 #endif // ICORE_H
The ICore class allows access to the different part that make up the basic functionality of the GCS...
Definition: icore.h:58
ICore()
Definition: icore.h:63
virtual ~ICore()
Definition: icore.h:64
The action manager is responsible for registration of menus and menu items and keyboard shortcuts...
Definition: actionmanager.h:47
Definition: icore.h:39