ICommand.h
Go to the documentation of this file.
1 #ifndef ibase_ICommand_included
2 #define ibase_ICommand_included
3 
4 
5 // ACF includes
6 #include <istd/TIHierarchical.h>
7 #include <iprm/INameParam.h>
9 
10 
11 namespace ibase
12 {
13 
14 
18 class ICommand:
19  virtual public iprm::INameParam,
20  virtual public iprm::IEnableableParam
21 {
22 public:
28  {
33  CF_PERMANENT = 0x0001,
34 
38  CF_GLOBAL_MENU = 0x0010,
39 
43  CF_CONTEXT_MENU = 0x0020,
44 
48  CF_TOOLBAR = 0x0040,
49 
53  CF_TOOLBOX = 0x0080,
54 
58  CF_ONOFF = 0x0100,
59 
63  CF_EXCLUSIVE = 0x0200
64  };
65 
66  enum GroupId
67  {
68  GI_NONE = -1,
69  GI_NORMAL = 0,
70  GI_USER = 0x1000
71  };
72 
76  virtual int GetPriority() const = 0;
77 
83  virtual int GetGroupId() const = 0;
84 
89  virtual int GetStaticFlags() const = 0;
90 
96  virtual bool Execute(istd::IPolymorphic* contextPtr) = 0;
97 };
98 
99 
104 
105 
106 } // namespace ibase
107 
108 
109 #endif // !ibase_ICommand_included
110 
111 
Enable to use this command in global application menu.
Definition: ICommand.h:38
Interface for a object containing simple text.
Definition: INameParam.h:20
Inform that this command can be turned on or off (checkable).
Definition: ICommand.h:58
Enable to use this command in separated toolbox.
Definition: ICommand.h:53
virtual int GetPriority() const =0
Get priority in the same group.
StaticFlags
Flags indicating attributes of command.
Definition: ICommand.h:27
Enable to use this command in context menu.
Definition: ICommand.h:43
Provides single command for interaction with user.
Definition: ICommand.h:18
virtual int GetStaticFlags() const =0
Get static flags of this command.
Interface for objects which can be enabled/disabled.
Base interface for all used interfaces and implementations.
Definition: IPolymorphic.h:17
Enable to use this command in application toolbar.
Definition: ICommand.h:48
Common interface to define the hierarchical graph structures.
istd::TIHierarchical< ICommand > IHierarchicalCommand
Hierarchical command structure used to create dynamic menu structures.
Definition: ICommand.h:103
If this is enabled command will be permanent accessible, even if context is not active.
Definition: ICommand.h:33
Enable exclusive selection of this command with other commands in the same node with the same group I...
Definition: ICommand.h:63
virtual int GetGroupId() const =0
Get group ID used to decide if separator should be used.
virtual bool Execute(istd::IPolymorphic *contextPtr)=0
Execute this command.

© 2007-2017 Witold Gantzke and Kirill Lepskiy