InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICmdHistory.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 //========================================================================================
26 
27 #ifndef __ICMDHISTORY__
28 #define __ICMDHISTORY__
29 
30 #include "CommandID.h"
31 #include "IPMUnknown.h"
32 
33 class PMString;
34 class CmdStackItem;
35 
48 class ICmdHistory : public IPMUnknown
49 {
50  public:
51  enum { kDefaultIID = IID_ICMDHISTORY };
52 
53  // ---- In all the methods below, if target == UIDRef::gNull the application defaults
54  // document will be used as the target. Otherwise the target should be valid. These
55  // methods no longer target the front document when pass UIDRef::gNull. Callers
56  // should get the front document if that is the intended target. [mburbidg 11-14-03]
57 
58  // the undo history
59  virtual bool16 CanUndo(const UIDRef &target) = 0;
60  virtual int32 GetUndoStepCount(const UIDRef &target) = 0;
61  virtual void GetNthUndoStepName(PMString *text, int32 n, const UIDRef &target) = 0;
62  virtual ErrorCode Undo(int32 steps, const UIDRef &target) = 0;
63 
64  // the redo history
65  virtual bool16 CanRedo(const UIDRef &target) = 0;
66  virtual int32 GetRedoStepCount(const UIDRef &target) = 0;
67  virtual void GetNthRedoStepName(PMString *text, int32 n, const UIDRef &target) = 0;
68  virtual ErrorCode Redo(int32 steps, const UIDRef &target) = 0;
69 
70  // delete all history data for the given target
71  virtual void Discard(const UIDRef &target) = 0;
72  virtual void Disable(const UIDRef &target) = 0;
73  virtual void Enable(const UIDRef &target) = 0;
74  virtual bool16 BeginPush(int32 numItems) = 0;
75  virtual void Push(const CmdStackItem &item) = 0;
76  virtual void EndPush() = 0;
77  virtual bool16 Enabled(const UIDRef &target) const = 0;
78 
79  // For Internal use only.
80  virtual bool16 DiscardRedo(const UIDRef &target) = 0;
81 };
82 
83 #endif // __ICMDHISTORY__