CFx SDK Documentation  2022 SP0
EdCommandStack.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _ODEDCOMMANDSTACK_H_INCLUDED_
25 #define _ODEDCOMMANDSTACK_H_INCLUDED_
26 
27 
28 
29 #define ODRX_COMMAND_DOCK OD_T("ODRX_REGISTERED_COMMANDS")
30 
31 typedef void (*OdRxFunctionPtr) ();
32 
33 class OdEdCommand;
34 class OdEdCommandContext;
35 
36 #include "RxObject.h"
37 
38 class OdRxIterator;
39 
44 
45 class OdRxDictionary;
46 // class OdEdUIContext;
47 
48 #include "TD_PackPush.h"
49 
50 class OdEdCommand;
51 
53 
58 
75 {
76 protected:
78 public:
80 
82  enum
83  {
84  kModal = 0x00000000,
85  kTransparent = 0x00000001,
86  kUsePickset = 0x00000002,
87  kRedraw = 0x00000004,
88  kNoPerspective = 0x00000008,
89  kNoMultiple = 0x00000010,
90  kNoTilemode = 0x00000020,
91  kNoPaperspace = 0x00000040,
92  kPlotOnly = 0x00000080,
93  kNoOEM = 0x00000100,
94  kUndefined = 0x00000200,
95  kInProgress = 0x00000400,
96  kDefun = 0x00000800,
97  kNoNewStack = 0x00010000,
98  kNoInternalLock = 0x00020000,
99  kDocReadLock = 0x00080000,
100  kDocExclusiveLock = 0x00100000,
101  kSession = 0x00200000,
102  kInterruptible = 0x00400000,
103  kNoHistory = 0x00800000,
104 
105  kNoUndoMarker = 0x01000000,
106  kNoBedit = 0x02000000
107  };
108 
110  const OdString& sGroupName,
111  const OdString& sGlobalName,
112  const OdString& sLocalName,
113  OdUInt32 commandFlags,
114  OdEdCommandFunction *pFunction,
115  OdRxModule *pModule = 0
116  );
117 
124  virtual const OdString groupName() const = 0;
125 
132  virtual const OdString globalName() const = 0;
133 
140  virtual const OdString localName() const;
141 
157  virtual void execute(OdEdCommandContext* pCommandContext) = 0;
158 
159  virtual const OdRxModule* module() const;
160 
161  virtual void undefine(bool undefIt);
162 
163  virtual OdInt32 flags() const;
164 
165  /*
166  virtual OdEdUIContext *UIContext() const = 0;
167  virtual int functionCode() const = 0;
168  virtual void functionCode(int fcode) = 0;
169  virtual const HINSTANCE resourceHandle() const = 0;
170  */
171 };
172 
173 
194 {
195 public:
197 
206  virtual void commandAdded(OdEdCommand* pCommand);
207 
216  virtual void commandWillBeRemoved(OdEdCommand* pCommand);
217 
226  virtual void commandWillStart(OdEdCommand* pCommand, OdEdCommandContext* pCmdCtx);
227 
236  virtual void commandEnded(OdEdCommand* pCommand, OdEdCommandContext* pCmdCtx);
237 
246  virtual void commandCancelled(OdEdCommand* pCommand, OdEdCommandContext* pCmdCtx);
247 
256  virtual void commandFailed(OdEdCommand* pCommand, OdEdCommandContext* pCmdCtx);
257 
266  virtual OdEdCommandPtr unknownCommand(const OdString& commandName, OdEdCommandContext* pCmdCtx);
267 };
268 
273 
278 
285 
307 {
308 public:
310 
316  virtual void addReactor(OdEdCommandStackReactor* pReactor) = 0;
317 
323  virtual void removeReactor(OdEdCommandStackReactor* pReactor) = 0;
324 
329 
341  virtual void addCommand(OdEdCommand* pCommand) = 0;
342 
355  const OdString& sGroupName,
356  const OdString& sGlobalName,
357  const OdString& sLocalName,
358  OdUInt32 commandFlags,
359  OdEdCommandFunction *pFunction,
360  OdRxModule *pModule = 0);
361 
370 
381  virtual OdRxIteratorPtr newIterator(const OdString& groupName) = 0;
382 
383 
392 
394  {
395  kGlobal = 0x01, // Search global (untranslated) names.
396  kLocal = 0x02, // Search local (translated) names.
397  kSpecifedGroup= 0x04, // Search in specified group only.
398  kUndefed = 0x08, // Do not fire unknownCommand() event.
399  kThrowUnknown = 0x10 // Throw OdEdUnknownCommand exception if command was not found.
400  };
427  const OdString& commandName,
428  int lookupFlags = kGlobal|kLocal,
429  const OdString& groupName = OdString::kEmpty) = 0;
430 
449  virtual void executeCommand(OdEdCommand* pCmd, OdEdCommandContext* pCmdCtx) = 0;
450 
486  virtual void executeCommand(const OdString& cmdName,
487  OdEdCommandContext* pCmdCtx,
488  int lookupFlags = kGlobal|kLocal,
489  const OdString& groupName = OdString::kEmpty) = 0;
490 
502  virtual void removeCmd(const OdString& groupName, const OdString& globalName) = 0;
503 
504 
505  virtual void removeCmd(const OdEdCommand* pCommand) = 0;
506 
515  virtual void removeGroup(const OdString& groupName) = 0;
526  virtual OdResult popGroupToTop(const OdString& cmdGroupName) = 0;
527 };
532 
537 
538 //FELIX_CHANGE_BEGIN
540 //FELIX_CHANGE_END
541 
542 #include "TD_PackPop.h"
543 
544 #endif //#ifndef _ODEDCOMMANDSTACK_H_INCLUDED_
OdArray< OdEdCommandStackReactorPtr > OdEdCommandStackReactorArray
OdSmartPtr< OdEdCommandStack > OdEdCommandStackPtr
OdSmartPtr< OdEdCommandStackReactor > OdEdCommandStackReactorPtr
OdSmartPtr< OdEdCommand > OdEdCommandPtr
FIRSTDLL_EXPORT OdEdCommandStackPtr odedRegCmds()
FIRSTDLL_EXPORT OdEdCommandPtr odedFireUnknownCommand(OdEdCommandStack *pCmdStack, const OdString &sCmd, OdEdCommandContext *pCmdCtx)
void() OdEdCommandFunction(OdEdCommandContext *pCmdCtx)
void(* OdRxFunctionPtr)()
OdSmartPtr< OdRxIterator > OdRxIteratorPtr
unsigned int OdUInt32
int OdInt32
#define ODRX_ABSTRACT
OdResult
Definition: OdResult.h:29
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
static OdEdCommandPtr createObject(const OdString &sGroupName, const OdString &sGlobalName, const OdString &sLocalName, OdUInt32 commandFlags, OdEdCommandFunction *pFunction, OdRxModule *pModule=0)
virtual const OdString groupName() const =0
ODRX_DECLARE_MEMBERS(OdEdCommand)
virtual OdInt32 flags() const
virtual const OdString localName() const
virtual void execute(OdEdCommandContext *pCommandContext)=0
virtual const OdString globalName() const =0
virtual void undefine(bool undefIt)
virtual const OdRxModule * module() const
virtual void addCommand(OdEdCommand *pCommand)=0
virtual OdRxIteratorPtr newIterator(const OdString &groupName)=0
virtual OdEdCommand * addCommand(const OdString &sGroupName, const OdString &sGlobalName, const OdString &sLocalName, OdUInt32 commandFlags, OdEdCommandFunction *pFunction, OdRxModule *pModule=0)
virtual OdResult popGroupToTop(const OdString &cmdGroupName)=0
virtual void addReactor(OdEdCommandStackReactor *pReactor)=0
virtual OdEdCommandStackReactorArray getCommandStackReactors() const =0
virtual OdRxIteratorPtr newIterator()=0
virtual void removeCmd(const OdEdCommand *pCommand)=0
virtual void removeCmd(const OdString &groupName, const OdString &globalName)=0
virtual void executeCommand(const OdString &cmdName, OdEdCommandContext *pCmdCtx, int lookupFlags=kGlobal|kLocal, const OdString &groupName=OdString::kEmpty)=0
virtual OdEdCommandPtr lookupCmd(const OdString &commandName, int lookupFlags=kGlobal|kLocal, const OdString &groupName=OdString::kEmpty)=0
virtual void executeCommand(OdEdCommand *pCmd, OdEdCommandContext *pCmdCtx)=0
ODRX_DECLARE_MEMBERS(OdEdCommandStack)
virtual void removeGroup(const OdString &groupName)=0
virtual void removeReactor(OdEdCommandStackReactor *pReactor)=0
virtual OdRxIteratorPtr newGroupIterator()=0
virtual OdEdCommandPtr unknownCommand(const OdString &commandName, OdEdCommandContext *pCmdCtx)
virtual void commandFailed(OdEdCommand *pCommand, OdEdCommandContext *pCmdCtx)
ODRX_DECLARE_MEMBERS(OdEdCommandStackReactor)
virtual void commandWillStart(OdEdCommand *pCommand, OdEdCommandContext *pCmdCtx)
virtual void commandEnded(OdEdCommand *pCommand, OdEdCommandContext *pCmdCtx)
virtual void commandCancelled(OdEdCommand *pCommand, OdEdCommandContext *pCmdCtx)
virtual void commandAdded(OdEdCommand *pCommand)
virtual void commandWillBeRemoved(OdEdCommand *pCommand)
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)