IXCommand.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 #include <Mstn\MstnDefs.h>
11 #include <Mstn\MdlApi\mstypes.h>
12 
13 #include <Mstn\IEditAction.h>
15 
17 
18 //=======================================================================================
20 // @bsiinterface
21 //=======================================================================================
23 {
24 protected:
29  virtual BentleyStatus _ExecuteCmd (Bentley::ECN::IAUIDataContextCP instance, WCharCP unparsed) = 0;
30 
35  virtual void _SetCmdNumber (CommandNumber cmdNumber, WCharCP taskId, WCharCP unparsed) = 0;
36 
39  virtual bool _CanExecute () const = 0;
40 
43  virtual void _SetCanExecute (bool value) {}
44 
47  virtual void _CanExecuteChanged (bool newValue) {}
48 
51  virtual bool _CanDisplay () const = 0;
52 
54  virtual bool _IsUserDefined () const { return false; };
55 
58  virtual void _SetCanDisplay (bool value) {}
59 
62  virtual void _CanDisplayChanged (bool newValue) {}
63 
66  virtual void _GetIconName (WStringR iconName) const {}
67 
70  virtual void _GetShowExpression (WStringR expression) const { expression.clear (); }
71 
74  virtual void _SetShowExpression (WCharCP expression) {}
75 
78  virtual bool _EvaluateShowExpression (bool defaultValue) const { return defaultValue; }
79 
82  virtual bool _HasShowExpression () const { return false; }
83 
86  virtual void _GetEnableExpression (WStringR expression) const { expression.clear (); }
87 
90  virtual void _SetEnableExpression (WCharCP expression) {}
91 
94  virtual bool _EvaluateEnableExpression (bool defaultValue) const { return defaultValue; }
95 
98  virtual bool _HasEnableExpression () const { return false; }
99 
102  virtual void _GetToggleExpression (WStringR expression) const { expression.clear (); }
103 
106  virtual void _SetToggleExpression (WCharCP expression) {}
107 
110  virtual bool _EvaluateToggleExpression (bool defaultValue) const { return defaultValue; }
111 
114  virtual bool _HasToggleExpression () const { return false; }
115 
118  virtual void _GetMarkExpression (WStringR expression) const { expression.clear (); }
119 
122  virtual void _SetMarkExpression (WCharCP expression) {}
123 
126  virtual MenuMarkType _EvaluateMarkExpression (MenuMarkType defaultValue) const { return defaultValue; }
127 
130  virtual bool _HasMarkExpression () const { return false; }
131 
134  virtual void _GetUISyncEvents (WStringR value) const { value.clear (); }
135 
138  virtual void _SetUISyncEvents (WCharCP value) {}
139 
142  virtual void _GetFeatureTrackingId (WStringR featureTrackingId) const { featureTrackingId.clear (); }
143 
146  virtual void _SetFeatureTrackingId (WCharCP featureTrackingId) {}
147 
150  virtual UInt32 _GetAttributes () const { return 0; }
151 
154  virtual void _SetAttributes (UInt32 attributes) {}
155 
158  virtual UInt32 _GetAccelerator () const { return 0; }
159 
162  virtual void _SetAccelerator (UInt32 accelerator) {}
163 
167  virtual bool _GetAcceleratorString (WStringR accelStr) const { accelStr.clear (); return false; }
168 
171  virtual bool _IsAllowed () const { return true; }
172 
173 public:
179  MSCORE_EXPORT BentleyStatus ExecuteCmd (Bentley::ECN::IAUIDataContextCP instance, WCharCP unparsed);
180 
184  MSCORE_EXPORT bool CanExecute() const;
185 
189  MSCORE_EXPORT void SetCanExecute(bool value);
190 
194  MSCORE_EXPORT void CanExecuteChanged(bool newValue);
195 
199  MSCORE_EXPORT bool CanDisplay() const;
200 
204  MSCORE_EXPORT void SetCanDisplay(bool value);
205 
209  MSCORE_EXPORT void CanDisplayChanged(bool newValue);
210 
214  MSCORE_EXPORT void GetIconName(WStringR iconName) const;
215 
219  MSCORE_EXPORT void GetShowExpression(WStringR expression) const;
220 
224  MSCORE_EXPORT void SetShowExpression(WCharCP expression);
225 
229  MSCORE_EXPORT bool EvaluateShowExpression(bool defaultValue) const;
230 
234  MSCORE_EXPORT bool HasShowExpression() const;
235 
239  MSCORE_EXPORT void GetEnableExpression(WStringR expression) const;
240 
244  MSCORE_EXPORT void SetEnableExpression(WCharCP expression);
245 
249  MSCORE_EXPORT bool EvaluateEnableExpression(bool defaultValue) const;
250 
254  MSCORE_EXPORT bool HasEnableExpression() const;
255 
259  MSCORE_EXPORT void GetToggleExpression(WStringR expression) const;
260 
264  MSCORE_EXPORT void SetToggleExpression(WCharCP expression);
265 
269  MSCORE_EXPORT bool EvaluateToggleExpression(bool defaultValue) const;
270 
274  MSCORE_EXPORT bool HasToggleExpression() const;
275 
279  MSCORE_EXPORT void GetMarkExpression(WStringR expression) const;
280 
284  MSCORE_EXPORT void SetMarkExpression(WCharCP expression);
285 
289  MSCORE_EXPORT MenuMarkType EvaluateMarkExpression(MenuMarkType defaultValue) const;
290 
294  MSCORE_EXPORT bool HasMarkExpression() const;
295 
299  MSCORE_EXPORT void GetUISyncEvents(WStringR expression) const;
300 
304  MSCORE_EXPORT void SetUISyncEvents(WCharCP expression);
305 
309  MSCORE_EXPORT void GetFeatureTrackingId(WStringR featureTrackingId) const;
310 
314  MSCORE_EXPORT void SetFeatureTrackingId(WCharCP featureTrackingId);
315 
319  MSCORE_EXPORT UInt32 GetAttributes() const;
320 
324  MSCORE_EXPORT void SetAttributes(UInt32 attributes);
325 
329  MSCORE_EXPORT UInt32 GetAccelerator() const;
330 
334  MSCORE_EXPORT void SetAccelerator(UInt32 accelerator);
335 
340  MSCORE_EXPORT bool GetAcceleratorString(WStringR accelStr) const;
341 
345  MSCORE_EXPORT bool IsAllowed() const;
346 
349  MSCORE_EXPORT bool IsUserDefined() const;
350 
351 };
352 
353 typedef struct IXCommand* IXCommandP;
354 typedef struct IXCommand& IXCommandR;
355 typedef struct IXCommand const* IXCommandCP;
356 typedef struct IXCommand const& IXCommandCR;
357 
359 
virtual void _GetIconName(WStringR iconName) const
Gets the icon name for any UI associated with this command.
Definition: IXCommand.h:66
virtual void _SetToggleExpression(WCharCP expression)
Sets the Named Expression controlling Toggle state for any UI associated with this command...
Definition: IXCommand.h:106
virtual void _GetMarkExpression(WStringR expression) const
Gets the Named Expression controlling Menu Mark state for any UI associated with this command...
Definition: IXCommand.h:118
#define END_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:30
virtual void _CanDisplayChanged(bool newValue)
Called when the CanDisplay status changes.
Definition: IXCommand.h:62
virtual void _SetAccelerator(UInt32 accelerator)
Sets the accelerator value associated with this command.
Definition: IXCommand.h:162
struct IXCommand const * IXCommandCP
Definition: IXCommand.h:355
Default class for an edit action.
Definition: IEditAction.h:90
#define BEGIN_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:29
struct IXCommand & IXCommandR
Definition: IXCommand.h:354
virtual void _GetEnableExpression(WStringR expression) const
Gets the Named Expression controlling Enable/Disable for any UI associated with this command...
Definition: IXCommand.h:86
wchar_t const * WCharCP
Definition: Bentley.h:224
virtual bool _EvaluateShowExpression(bool defaultValue) const
Evaluates the Named Expression controlling Show/Hide for any UI associated with this command...
Definition: IXCommand.h:78
uint32_t UInt32
Definition: Bentley.r.h:128
virtual void _SetShowExpression(WCharCP expression)
Sets the Named Expression controlling Show/Hide for any UI associated with this command.
Definition: IXCommand.h:74
virtual void _GetUISyncEvents(WStringR value) const
Gets the UISyncEvent associated with this command.
Definition: IXCommand.h:134
virtual bool _EvaluateEnableExpression(bool defaultValue) const
Evaluates the Named Expression controlling Enable/Disable for any UI associated with this command...
Definition: IXCommand.h:94
virtual void _SetUISyncEvents(WCharCP value)
Sets the UISyncEvent associated with this command.
Definition: IXCommand.h:138
virtual void _GetShowExpression(WStringR expression) const
Gets the Named Expression controlling Show/Hide for any UI associated with this command.
Definition: IXCommand.h:70
virtual UInt32 _GetAccelerator() const
Gets the accelerator value associated with this command.
Definition: IXCommand.h:158
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
BentleyStatus
Definition: Bentley.h:208
virtual void _GetToggleExpression(WStringR expression) const
Gets the Named Expression controlling Toggle state for any UI associated with this command...
Definition: IXCommand.h:102
virtual bool _HasToggleExpression() const
Determines if this command has a Named Expression controlling Toggle state for any UI associate with ...
Definition: IXCommand.h:114
MenuMarkType
Definition: dlogbox.r.h:470
virtual void _SetFeatureTrackingId(WCharCP featureTrackingId)
Sets the Feature Tracking GUID associated with this command.
Definition: IXCommand.h:146
struct IXCommand const & IXCommandCR
Definition: IXCommand.h:356
virtual void _SetCanExecute(bool value)
Sets a flag for whether the command can be executed.
Definition: IXCommand.h:43
virtual bool _HasShowExpression() const
Determines if this command has a Named Expression controlling Show/Hide for any UI associate with thi...
Definition: IXCommand.h:82
virtual bool _HasMarkExpression() const
Determines if this command has a Named Expression controlling Menu Mark state for any UI associate wi...
Definition: IXCommand.h:130
UInt64 CommandNumber
Definition: DgnPlatformBaseType.r.h:76
Cross UI Framework PowerPlatform Command interface.
Definition: IXCommand.h:22
virtual bool _EvaluateToggleExpression(bool defaultValue) const
Evaluates the Named Expression controlling Toggle state for any UI associated with this command...
Definition: IXCommand.h:110
struct IXCommand * IXCommandP
Definition: IXCommand.h:353
virtual UInt32 _GetAttributes() const
Gets the attributes associated with this command.
Definition: IXCommand.h:150
virtual bool _HasEnableExpression() const
Determines if this command has a Named Expression controlling Enable/Disable for any UI associate wit...
Definition: IXCommand.h:98
virtual void _SetMarkExpression(WCharCP expression)
Sets the Named Expression controlling Menu Mark state for any UI associated with this command...
Definition: IXCommand.h:122
virtual void _GetFeatureTrackingId(WStringR featureTrackingId) const
Gets the Feature Tracking GUID associated with this command.
Definition: IXCommand.h:142
virtual MenuMarkType _EvaluateMarkExpression(MenuMarkType defaultValue) const
Evaluates the Named Expression controlling Menu Mark state for any UI associated with this command...
Definition: IXCommand.h:126
virtual void _SetCanDisplay(bool value)
Sets a flag for whether the command's UI can be displayed.
Definition: IXCommand.h:58
virtual bool _GetAcceleratorString(WStringR accelStr) const
Gets the string representation of the accelerator value associated with this command.
Definition: IXCommand.h:167
virtual void _SetAttributes(UInt32 attributes)
Sets the attributes associated with this command.
Definition: IXCommand.h:154
virtual void _SetEnableExpression(WCharCP expression)
Sets the Named Expression controlling Enable/Disable for any UI associated with this command...
Definition: IXCommand.h:90
virtual bool _IsUserDefined() const
Return true if command was loaded via MS_NAMEDCOMMANDSLIST; otherwise, false.
Definition: IXCommand.h:54
virtual bool _IsAllowed() const
Determines if this command is allowed to execute in the given product context.
Definition: IXCommand.h:171
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
virtual void _CanExecuteChanged(bool newValue)
Called when the CanExecute status changes.
Definition: IXCommand.h:47

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