dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
coreimpl.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 COREIMPL_H
29 #define COREIMPL_H
30 
31 #include "icore.h"
32 #include "mainwindow.h"
33 
34 namespace Core {
35 namespace Internal {
36 
37  class CoreImpl : public ICore
38  {
39  Q_OBJECT
40 
41  public:
42  CoreImpl(MainWindow *mainwindow);
43  ~CoreImpl() {}
44 
45  bool showOptionsDialog(const QString &group = QString(), const QString &page = QString(),
46  QWidget *parent = nullptr);
50  BoardManager *boardManager() const;
53  ModeManager *modeManager() const;
54 
55  QSettings *settings(QSettings::Scope scope = QSettings::UserScope) const;
56  void readMainSettings(QSettings *qs, bool workspaceDiffOnly);
57  void saveMainSettings(QSettings *qs);
58  void readSettings(IConfigurablePlugin *plugin, QSettings *qs = nullptr);
59  void saveSettings(IConfigurablePlugin *plugin, QSettings *qs = nullptr);
60  void deleteSettings();
61 
62  QString resourcePath() const;
63 
65 
66  QMainWindow *mainWindow() const;
67 
68  // adds and removes additional active contexts, this context is appended to the
69  // currently active contexts. call updateContext after changing
70  void addAdditionalContext(int context);
71  void removeAdditionalContext(int context);
72  bool hasContext(int context) const;
73  void addContextObject(IContext *contex);
74  void removeContextObject(IContext *contex);
75 
76  void updateContext();
77 
78  void openFiles(const QStringList &fileNames);
79 
80  private:
81  MainWindow *m_mainwindow;
82  friend class MainWindow;
83  };
84 
85 } // namespace Internal
86 } // namespace Core
87 
88 #endif // COREIMPL_H
GlobalMessaging * globalMessaging() const
Definition: coreimpl.cpp:82
void addContextObject(IContext *contex)
Registers an additional context object.
Definition: coreimpl.cpp:140
ModeManager * modeManager() const
Returns the application's mode manager.
Definition: coreimpl.cpp:92
void openFiles(const QStringList &fileNames)
Open all files from a list of fileNames like it would be done if they were given to the GCS on the co...
Definition: coreimpl.cpp:155
void removeAdditionalContext(int context)
Removes the given context from the list of currently active contexts.
Definition: coreimpl.cpp:130
bool hasContext(int context) const
Returns if the given context is currently one of the active contexts.
Definition: coreimpl.cpp:135
UniqueIDManager * uniqueIDManager() const
Returns the application's id manager.
Definition: coreimpl.cpp:67
void addAdditionalContext(int context)
Register additional context to be currently active.
Definition: coreimpl.cpp:125
UAVGadgetInstanceManager * uavGadgetInstanceManager() const
Definition: coreimpl.cpp:87
The ICore class allows access to the different part that make up the basic functionality of the GCS...
Definition: icore.h:58
void removeContextObject(IContext *contex)
Unregisters a context object from the list of know contexts.
Definition: coreimpl.cpp:145
void saveMainSettings(QSettings *qs)
Definition: coreimpl.cpp:166
QMainWindow * mainWindow() const
Returns the main application window.
Definition: coreimpl.cpp:118
ActionManager * actionManager() const
Returns the application's action manager.
Definition: coreimpl.cpp:62
void saveSettings(IConfigurablePlugin *plugin, QSettings *qs=nullptr)
Definition: coreimpl.cpp:175
QSettings * settings(QSettings::Scope scope=QSettings::UserScope) const
Returns the application's main settings object.
Definition: coreimpl.cpp:97
void readSettings(IConfigurablePlugin *plugin, QSettings *qs=nullptr)
Definition: coreimpl.cpp:171
bool showOptionsDialog(const QString &group=QString(), const QString &page=QString(), QWidget *parent=nullptr)
Opens the application options/preferences dialog with preselected page in a specified group...
Definition: coreimpl.cpp:57
The action manager is responsible for registration of menus and menu items and keyboard shortcuts...
Definition: actionmanager.h:47
CoreImpl(MainWindow *mainwindow)
Definition: coreimpl.cpp:51
BoardManager * boardManager() const
Definition: coreimpl.cpp:77
void updateContext()
Update the list of active contexts after adding or removing additional ones.
Definition: coreimpl.cpp:150
void readMainSettings(QSettings *qs, bool workspaceDiffOnly)
Definition: coreimpl.cpp:161
ConnectionManager * connectionManager() const
Definition: coreimpl.cpp:72
IContext * currentContextObject() const
Returns the context object of the current main context.
Definition: coreimpl.cpp:113
QString resourcePath() const
Returns the absolute path that is used for resources like project templates and the debugger macros...
Definition: coreimpl.cpp:108