InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICommandProcessor.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Roey Horns
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //
23 // Reviewed: 10/06/98
24 //
25 // Purpose: Global interface for execution of commands.
26 // In order to use commands and/or command sequences
27 // please refer to CmdUtils.h.
28 //
29 //========================================================================================
30 
31 #ifndef __ICOMMANDPROCESSSOR__
32 #define __ICOMMANDPROCESSSOR__
33 
34 #include "CommandID.h"
35 #include "IPMUnknown.h"
36 #include "ICommand.h"
37 #include "ICommandSequence.h"
38 
40 class WideString;
41 
42 #define NEW_TARGET
43 
53 {
54  public:
55  enum { kDefaultIID = IID_ICOMMANDPROCESSOR };
56 
57  // regular cmd processing = default method for cmd execution
58  virtual ErrorCode ProcessCommand(ICommand * cmd) = 0;
59  virtual ErrorCode LWProcessCommand(ICommand * cmd) = 0;
60 
61  // command sequences
62  //@param trackingData : string identifier of the caller. This is to help track if any command sequence was lost without EndCommandSequence
63  virtual ICommandSequence *BeginCommandSequence(const char* trackingData = nullptr) = 0;
64  virtual ErrorCode EndCommandSequence(ICommandSequence *sequence) = 0;
65 
66  // Abortable command sequences
67  // @param trackingData : string identifier of the caller. This is to help track if any abortable command sequence was lost without EndCommandSequence or AbortCommandSequence
68 
69  virtual IAbortableCmdSeq *BeginAbortableCmdSeq(const char* trackingData = nullptr) = 0;
70  virtual ErrorCode EndCommandSequence(IAbortableCmdSeq *sequence) = 0;
71  virtual ErrorCode AbortCommandSequence(IAbortableCmdSeq *sequence) = 0;
72 
73  // use sequence marks to define points in your sequence where
74  // you might want to roll back to later (before you end or abort the sequence).
75  virtual SequenceMark SetSequenceMark(const IAbortableCmdSeq *sequence) = 0;
76  virtual ErrorCode RollBackCommandSequence(const IAbortableCmdSeq *sequence, SequenceMark upToMark = SequenceMark()) = 0; // will undo all cmds up to and including upToMark
77 
78 
82  virtual void EnableBusyCursor(bool16 bEnable) = 0;
83 
88  virtual bool16 IsBusyCursorEnabled() const = 0;
89 
93  // execute cmds dynamically
94  virtual ErrorCode ExecuteDynamic(ICommand * cmd) = 0;
95  // these methods will eventually go away
96  virtual ErrorCode ExecuteImmediate(ICommand * cmd) = 0;
97 
98  // support for command interception
99  // there can be more than one cmd interceptor at once
100  // see ICommandInterceptor.h for details
101  virtual void InstallInterceptor(ICommandInterceptor *newInterceptor) = 0;
102  virtual void DeinstallInterceptor(ICommandInterceptor *theInterceptor) = 0;
103 
104  //
105  // for internal use only
106  virtual bool16 InterceptScheduledCmd(ICommand *cmd) = 0;
107  virtual void PartialPurge() = 0;
108  virtual I_Base_CommandSequence *GetCurrentCommandSequence() const = 0;
109  virtual ICommand*GetCurrentCommand() const = 0;
110  virtual bool8 IsProcessorStackEmpty() const = 0;
111 
112 #ifdef DEBUG
113  virtual void EnableCmdBehaviorMonitor(bool8 ) = 0;
114  virtual bool8 IsCmdBehaviorMonitorEnabled() const = 0;
115 #endif
116  // @param trackingData : string identifier of the caller. This is to help track if any auto undo sequence was lost without EndAutoUndoSequence
117  virtual IAutoUndoSequence *BeginAutoUndoSequence(IDataBase* target, const char* trackingData = nullptr) = 0;
118  virtual ErrorCode EndAutoUndoSequence(IAutoUndoSequence *arg) = 0;
119 
120 };
121 
122 // For private use only
123 #define kInterfaceSnapshotTrace "AutoUndo Trace"
124 
125 #endif // __ICOMMANDPROCESSSOR__