dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
actioncontainer.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 ACTIONCONTAINER_H
29 #define ACTIONCONTAINER_H
30 
31 #include <QtCore/QObject>
32 #include <QMenu>
33 #include <QMenuBar>
34 #include <QAction>
35 
36 namespace Core {
37 
38 class Command;
39 
40 class ActionContainer : public QObject
41 {
42 public:
43  enum EmptyAction { EA_Mask = 0xFF00, EA_None = 0x0100, EA_Hide = 0x0200, EA_Disable = 0x0300 };
44 
45  virtual void setEmptyAction(EmptyAction ea) = 0;
46 
47  virtual int id() const = 0;
48 
49  virtual QMenu *menu() const = 0;
50  virtual QMenuBar *menuBar() const = 0;
51 
52  virtual QAction *insertLocation(const QString &group) const = 0;
53  virtual void appendGroup(const QString &group) = 0;
54  virtual void addAction(Core::Command *action, const QString &group = QString()) = 0;
55  virtual void addMenu(Core::ActionContainer *menu, const QString &group = QString()) = 0;
56 
57  virtual bool update() = 0;
58  virtual ~ActionContainer() {}
59 };
60 
61 } // namespace Core
62 
63 #endif // ACTIONCONTAINER_H
virtual QMenuBar * menuBar() const =0
virtual QAction * insertLocation(const QString &group) const =0
virtual QMenu * menu() const =0
virtual void appendGroup(const QString &group)=0
virtual void addAction(Core::Command *action, const QString &group=QString())=0
virtual void setEmptyAction(EmptyAction ea)=0
virtual int id() const =0
virtual void addMenu(Core::ActionContainer *menu, const QString &group=QString())=0
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
virtual bool update()=0