auicommand.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #pragma once
11 
12 #include "ecimagekey.h"
13 #include "ecpresentationtypedefs.h"
14 #include "auiprovider.h"
15 
17 
19 
20 /*=================================================================================**/
22 
24 struct IUICommand : public RefCountedBase
25  {
26 private:
27  virtual void MakeClassAbstract() = 0;
28 public:
29  public:
30  /*=================================================================================**/
32 
35  {
42  };
43 
44  /*=================================================================================**/
46 
49  {
56 
62 
67 
70 
77 
78  #if defined (BEIJING_DGNPLATFORM_WIP_SWW)
79  #endif // defined (BEIJING_DGNPLATFORM_WIP_SWW)
86  };
87 
88  /*=================================================================================**/
90 
93  {
94  Unknown = 0,
96  ToolBar = 2,
98  };
99 
100 
101  protected:
102 
104  virtual BentleyStatus _ExecuteCmd(IAUIDataContextCP instance) = 0;
105 
108  virtual WCharCP _GetCommandId() const = 0;
109 
112  virtual WString _GetLabel() const = 0;
113 
116  virtual void _SetLabel(WCharCP label) {}
117 
120  virtual WString _GetDescription() const { return WString(); }
121 
124  virtual void _SetDescription(WCharCP description) {}
125 
128  virtual ECImageKeyCP _GetImageId() const = 0;
129 
132  virtual void _SetImageId(ECImageKeyCR key) {}
133 
136  virtual bool _GetIsEnabled() const { return false; }
137 
140  virtual void _SetIsEnabled(bool enabled) { ; }
141 
142  public:
144  virtual ~IUICommand () {}
145 
149  ECOBJECTS_EXPORT BentleyStatus ExecuteCmd (IAUIDataContextCP instance);
150 
152  ECOBJECTS_EXPORT void Journal (IJournalItemR journalEntry);
153 
157 
161 
164  ECOBJECTS_EXPORT void SetLabel (WCharCP label);
165 
169 
172  ECOBJECTS_EXPORT void SetDescription (WCharCP description);
173 
176  ECOBJECTS_EXPORT ECImageKeyCP GetImageId () const;
177 
180  ECOBJECTS_EXPORT void SetImageId (ECImageKeyCR key);
181 
183  ECOBJECTS_EXPORT bool IsSeparator () const;
184 
187 
190 
193 
196 
199  ECOBJECTS_EXPORT bool GetIsEnabled () const;
200 
203  ECOBJECTS_EXPORT void SetIsEnabled (bool enabled);
204 
206  ECOBJECTS_EXPORT IUICommand* GetParent() const;
207 
209  ECOBJECTS_EXPORT void GetChildren (bvector<IUICommandPtr>& children) const;
211  ECOBJECTS_EXPORT void GetChildren(bvector<IUICommandPtr>& children);
212 
216 
219 
220  };
221 
223 /*=================================================================================**/
225 
228  {
229  bool operator () (IUICommandPtr const& lhs, IUICommandPtr const& rhs)
230  {
231  return lhs->GetPriority() > rhs->GetPriority();
232  }
233  };
234 
235 /*=================================================================================**/
237 
239 struct UICommand : public IUICommand
240  {
241 
242  };
243 
244 /*=================================================================================**/
247 
249 struct ECPresentationCommandProvider : public IECPresentationProvider
250  {
251 
252  public:
255 
260  ECOBJECTS_EXPORT void GetCommand (bvector<IUICommandPtr>&commands, IAUIDataContextCR instance, int purpose);
261  };
262 
263 
265 
Definition: auicommand.h:95
virtual WString _GetDescription() const
Gets the Description for UI associated with this Command.
Definition: auicommand.h:120
Definition: auicommand.h:96
EditActionMenuMark
! The possible "marks" that can be placed to the left of menu entries for Edit Actions.
Definition: auicommand.h:34
void SetIsEnabled(bool enabled)
Sets whether the UI associated with this Command is enabled.
void Journal(IJournalItemR journalEntry)
Describe how you want to journal your command by calling methods on journal item entry.
! NEEDSWORK: Add comment here
Definition: auicommand.h:227
void SetLabel(WCharCP label)
Sets the Label for UI associated with this Command.
Definition: auicommand.h:40
void GetChildren(bvector< IUICommandPtr > &children) const
Get the child commands if there is a heirarchy of commands.
bool GetIsEnabled() const
Gets whether the UI associated with this Command is enabled.
EditActionMenuMark GetMenuMark() const
Gets the menu mark type for this command.
virtual ~ECPresentationCommandProvider()
Virtual destructor.
Definition: auicommand.h:254
bool operator()(IUICommandPtr const &lhs, IUICommandPtr const &rhs)
Definition: auicommand.h:229
BentleyStatus ExecuteCmd(IAUIDataContextCP instance)
Execute the action associated with this command.
Definition: auicommand.h:37
void SetMenuMark(EditActionMenuMark mark)
Sets the menu mark type for this command.
virtual ECImageKeyCP _GetImageId() const =0
Gets the Image Key for UI associated with this Command.
virtual BentleyStatus _ExecuteCmd(IAUIDataContextCP instance)=0
Execute the action associated with this command.
Definition: auicommand.h:76
Definition: auicommand.h:39
EditActionPriority GetPriority() const
Get the priority value for this Edit Action.
virtual void _SetIsEnabled(bool enabled)
Sets whether the UI associated with this Command is enabled.
Definition: auicommand.h:140
Definition: auicommand.h:38
virtual void _SetLabel(WCharCP label)
Sets the Label for UI associated with this Command.
Definition: auicommand.h:116
IUICommand * GetParent() const
Get the parent command if there is a heirarchy of commands.
wchar_t const * WCharCP
Definition: Bentley.h:224
Definition: auicommand.h:41
virtual WString _GetLabel() const =0
Gets the Label for UI associated with this Command.
BEGIN_BENTLEY_ECOBJECT_NAMESPACE typedef RefCountedPtr< IUICommand > IUICommandPtr
Definition: auicommand.h:18
WString GetApplicatonArg() const
Gets the application data stored with this command.
void SetPriority(EditActionPriority priority)
Set the priority value for the current command.
void GetCommand(bvector< IUICommandPtr > &commands, IAUIDataContextCR instance, int purpose)
NEEDSWORK: Add comment here.
#define ECOBJECTS_EXPORT
Definition: ECObjects.h:20
void SetApplicationArg(WCharCP arg)
Sets the application data stored with this command.
EditActionPriority
! Recommended priority values for Edit Actions.
Definition: auicommand.h:48
RefCountedPtr< UICommand > UICommandPtr
Definition: auicommand.h:222
ECImageKeyCP GetImageId() const
Gets the Image Key for UI associated with this Command.
Definition: auicommand.h:50
void SetImageId(ECImageKeyCR key)
Sets the Image Key for UI associated with this Command.
BentleyStatus
Definition: Bentley.h:208
Definition: auicommand.h:94
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
virtual void _SetDescription(WCharCP description)
Sets the Description for UI associated with this Command.
Definition: auicommand.h:124
WString GetLabel() const
Gets the Label for UI associated with this Command.
#define END_BENTLEY_ECOBJECT_NAMESPACE
Definition: DgnPlatform.h:41
virtual bool _GetIsEnabled() const
Gets whether the UI associated with this Command is enabled.
Definition: auicommand.h:136
bool IsSeparator() const
Gets whether the command is a used as a special seperator marker.
Definition: auicommand.h:97
virtual WCharCP _GetCommandId() const =0
Gets the Id of this Command.
! NEEDSWORK: Add comment here
Definition: auiprovider.h:17
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
Definition: auicommand.h:36
virtual void _SetImageId(ECImageKeyCR key)
Sets the Image Key for UI associated with this Command.
Definition: auicommand.h:132
virtual ~IUICommand()
Virtual destructor.
Definition: auicommand.h:144
WString GetDescription() const
Gets the Description for UI associated with this Command.
void SetDescription(WCharCP description)
Sets the Description for UI associated with this Command.
ApplicationPurpose
! NEEDSWORK: Add comment here
Definition: auicommand.h:92
! A UICommand represents an action that can be applied on a data context.
Definition: auicommand.h:239
WCharCP GetCommandId() const
Gets the Id of this Command.
! NEEDSWORK: Add comment here
Definition: auicommand.h:24
Definition: auicommand.h:66
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
#define BEGIN_BENTLEY_ECOBJECT_NAMESPACE
Definition: DgnPlatform.h:40

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.