Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / coreplugin / icore.h
blob5e2ba66b3334b40c8fbcc862696468bab8f7039a
1 /**
2 ******************************************************************************
4 * @file icore.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @addtogroup GCSPlugins GCS Plugins
8 * @{
9 * @addtogroup CorePlugin Core Plugin
10 * @{
11 * @brief The Core GCS plugin
12 *****************************************************************************/
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.
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.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef ICORE_H
30 #define ICORE_H
32 #include "core_global.h"
34 #include <QObject>
36 QT_BEGIN_NAMESPACE
37 class QMainWindow;
38 class QSettings;
39 QT_END_NAMESPACE
41 namespace Core {
42 class ActionManager;
43 class IContext;
44 class IWizard;
45 class ConnectionManager;
46 class MessageManager;
47 class MimeDatabase;
48 class ModeManager;
49 class SettingsDatabase;
50 class UniqueIDManager;
51 class VariableManager;
52 class ThreadManager;
53 class UAVGadgetManager;
54 class UAVGadgetInstanceManager;
55 class IConfigurablePlugin;
57 class CORE_EXPORT ICore : public QObject {
58 Q_OBJECT
60 public:
61 ICore() {}
62 virtual ~ICore() {}
64 static ICore *instance();
66 virtual bool showOptionsDialog(const QString &group = QString(),
67 const QString &page = QString(),
68 QWidget *parent = 0) = 0;
70 virtual bool showWarningWithOptions(const QString &title, const QString &text,
71 const QString &details = QString(),
72 const QString &settingsCategory = QString(),
73 const QString &settingsId = QString(),
74 QWidget *parent = 0) = 0;
76 virtual ActionManager *actionManager() const = 0;
77 virtual UniqueIDManager *uniqueIDManager() const = 0;
78 virtual MessageManager *messageManager() const = 0;
79 virtual VariableManager *variableManager() const = 0;
80 virtual ThreadManager *threadManager() const = 0;
81 virtual ModeManager *modeManager() const = 0;
82 virtual ConnectionManager *connectionManager() const = 0;
83 virtual UAVGadgetInstanceManager *uavGadgetInstanceManager() const = 0;
84 virtual MimeDatabase *mimeDatabase() const = 0;
86 virtual SettingsDatabase *settingsDatabase() const = 0;
88 virtual void readMainSettings(QSettings &settings, bool workspaceDiffOnly = false) = 0;
89 virtual void saveMainSettings(QSettings &settings) const = 0;
90 virtual void readSettings(IConfigurablePlugin *plugin) = 0;
91 virtual void saveSettings(IConfigurablePlugin *plugin) const = 0;
92 virtual void readSettings(IConfigurablePlugin *plugin, QSettings &settings) = 0;
93 virtual void saveSettings(IConfigurablePlugin *plugin, QSettings &settings) const = 0;
94 virtual void deleteSettings() = 0;
96 virtual QString resourcePath() const = 0;
98 virtual QMainWindow *mainWindow() const = 0;
100 // adds and removes additional active contexts, this context is appended to the
101 // currently active contexts. call updateContext after changing
102 virtual IContext *currentContextObject() const = 0;
103 virtual void addAdditionalContext(int context) = 0;
104 virtual void removeAdditionalContext(int context) = 0;
105 virtual bool hasContext(int context) const = 0;
106 virtual void addContextObject(IContext *context) = 0;
107 virtual void removeContextObject(IContext *context) = 0;
109 virtual void updateContext() = 0;
111 virtual void openFiles(const QStringList &fileNames) = 0;
113 signals:
114 void coreAboutToOpen();
115 void coreOpened();
116 void saveSettingsRequested();
117 void optionsDialogRequested();
118 void coreAboutToClose();
119 void contextAboutToChange(Core::IContext *context);
120 void contextChanged(Core::IContext *context);
122 } // namespace Core
124 #endif // ICORE_H