dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
actionmanager.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 ACTIONMANAGER_H
29 #define ACTIONMANAGER_H
30 
31 #include "coreplugin/core_global.h"
32 
35 
36 #include <QtCore/QObject>
37 #include <QtCore/QList>
38 
39 QT_BEGIN_NAMESPACE
40 class QAction;
41 class QShortcut;
42 class QString;
43 QT_END_NAMESPACE
44 
45 namespace Core {
46 
47 class CORE_EXPORT ActionManager : public QObject
48 {
49  Q_OBJECT
50 public:
51  ActionManager(QObject *parent = nullptr)
52  : QObject(parent)
53  {
54  }
55  virtual ~ActionManager() {}
56 
57  virtual ActionContainer *createMenu(const QString &id) = 0;
58  virtual ActionContainer *createMenuBar(const QString &id) = 0;
59 
60  virtual Command *registerAction(QAction *action, const QString &id,
61  const QList<int> &context) = 0;
62  virtual Command *registerShortcut(QShortcut *shortcut, const QString &id,
63  const QList<int> &context) = 0;
64 
65  virtual Command *command(const QString &id) const = 0;
66  virtual ActionContainer *actionContainer(const QString &id) const = 0;
67 };
68 
69 } // namespace Core
70 
71 #endif // ACTIONMANAGER_H
virtual ~ActionManager()
Definition: actionmanager.h:55
ActionManager(QObject *parent=nullptr)
Definition: actionmanager.h:51
The action manager is responsible for registration of menus and menu items and keyboard shortcuts...
Definition: actionmanager.h:47
The class Command represents an action like a menu item, tool button, or shortcut. You don't create Command objects directly, instead use {ActionManager::registerAction()} to register an action and retrieve a Command. The Command object represents the user visible action and its properties. If multiple actions are registered with the same ID (but different contexts) the returned Command is the shared one between these actions.
Definition: command.h:43