LP-56 - Better txpid option namings, fix tabs-spaces, tooltips. headers, variable...
[librepilot.git] / ground / openpilotgcs / src / plugins / coreplugin / icore.h
bloba0b67e820d9a6cfa4566ec7be239e65c41a16a43
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"
33 #include <QtCore/QObject>
34 #include <QSettings>
36 QT_BEGIN_NAMESPACE
37 class QMainWindow;
38 class QSettings;
39 template <class T> class QList;
40 QT_END_NAMESPACE
42 namespace Core {
43 class ActionManager;
44 class IContext;
45 class IWizard;
46 class ConnectionManager;
47 class MessageManager;
48 class MimeDatabase;
49 class ModeManager;
50 class SettingsDatabase;
51 class UniqueIDManager;
52 class VariableManager;
53 class ThreadManager;
54 class UAVGadgetManager;
55 class UAVGadgetInstanceManager;
56 class IConfigurablePlugin;
58 class CORE_EXPORT ICore : public QObject {
59 Q_OBJECT
61 public:
62 ICore() {}
63 virtual ~ICore() {}
65 static ICore *instance();
67 virtual bool showOptionsDialog(const QString &group = QString(),
68 const QString &page = QString(),
69 QWidget *parent = 0) = 0;
71 virtual bool showWarningWithOptions(const QString &title, const QString &text,
72 const QString &details = QString(),
73 const QString &settingsCategory = QString(),
74 const QString &settingsId = QString(),
75 QWidget *parent = 0) = 0;
77 virtual ActionManager *actionManager() const = 0;
78 virtual UniqueIDManager *uniqueIDManager() const = 0;
79 virtual MessageManager *messageManager() const = 0;
80 virtual VariableManager *variableManager() const = 0;
81 virtual ThreadManager *threadManager() const = 0;
82 virtual ModeManager *modeManager() const = 0;
83 virtual ConnectionManager *connectionManager() const = 0;
84 virtual UAVGadgetInstanceManager *uavGadgetInstanceManager() const = 0;
85 virtual MimeDatabase *mimeDatabase() const = 0;
87 virtual QSettings *settings(QSettings::Scope scope = QSettings::UserScope) const = 0;
88 virtual SettingsDatabase *settingsDatabase() const = 0;
89 virtual void readMainSettings(QSettings *qs, bool workspaceDiffOnly = false) = 0;
90 virtual void saveMainSettings(QSettings *qs) = 0;
91 virtual void readSettings(IConfigurablePlugin *plugin, QSettings *qs = 0) = 0;
92 virtual void saveSettings(IConfigurablePlugin *plugin, QSettings *qs = 0) = 0;
93 virtual void deleteSettings() = 0;
95 virtual QString resourcePath() const = 0;
97 virtual QMainWindow *mainWindow() const = 0;
99 // adds and removes additional active contexts, this context is appended to the
100 // currently active contexts. call updateContext after changing
101 virtual IContext *currentContextObject() const = 0;
102 virtual void addAdditionalContext(int context) = 0;
103 virtual void removeAdditionalContext(int context) = 0;
104 virtual bool hasContext(int context) const = 0;
105 virtual void addContextObject(IContext *context) = 0;
106 virtual void removeContextObject(IContext *context) = 0;
108 virtual void updateContext() = 0;
110 virtual void openFiles(const QStringList &fileNames) = 0;
112 signals:
113 void coreAboutToOpen();
114 void coreOpened();
115 void saveSettingsRequested();
116 void optionsDialogRequested();
117 void coreAboutToClose();
118 void contextAboutToChange(Core::IContext *context);
119 void contextChanged(Core::IContext *context);
121 } // namespace Core
123 #endif // ICORE_H