InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPMPersist.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Robin_Briggs
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 
24 #ifndef __IPMPersist__
25 #define __IPMPersist__
26 
27 #include "IPMUnknown.h"
28 #include "ShuksanID.h"
29 
30 class IDataBase;
31 class IPMStream;
32 class IPMPersist;
33 class IContentTracker;
36 class ISnapshotCache;
37 
43 class IPMPersist : public IPMUnknown
44 {
45 public:
46  enum { kDefaultIID = IID_IPMPERSIST };
47 
53  virtual UID GetUID() const = 0;
54 
58  virtual IDataBase *GetDataBase() const = 0;
59 
70  virtual void LoadAll(IPMStream *s, bool16 setDirty, int32 length = 0) = 0;
71 
80  virtual void SaveAll(IPMStream *s, bool16 clearDirty) = 0;
81 
82 
92  virtual void SetDirty(IPMUnknown *p, ImplementationID prop, bool16 allowModification = kTrue) = 0;
93 
94  virtual void SetDirtyAllowDuplicateMessage(IPMUnknown *p, ImplementationID prop, bool16 allowModification = kTrue) = 0;
95 
96  virtual void SetDirtyOverrideMessage(IPMUnknown *p, PMIID overrideIID, ImplementationID prop, bool16 allowModification = kTrue) = 0;
97 
98  virtual void SetDirtyOverrideAllowDuplicateMessage(IPMUnknown *p, PMIID overrideIID, ImplementationID prop, bool16 allowModification = kTrue) = 0;
99 
100 
102 
103  // -----------------------------------------------------------
104  // INTERNAL USE ONLY
105  // -----------------------------------------------------------
106 
107 
108  // Internal Use Only
109  // Tell the object what its persistent key is. This is called
110  // once from the database when an object is instantiated.
111  // It should never be called from anywhere else.
112  virtual void Init(IDataBase *db, UID id) = 0;
113 
114  // Internal Use Only
115  // Creates a content iterator that can be used to iterate through the
116  // data in the stream. Caller is responsible for deleting
117  // @return The new iterator.
118  virtual IContentReadIterator *NewReadIterator(IPMStream *s) = 0;
119 
120  // Internal Use Only
121  // Creates a content iterator that can be used to iterate through the
122  // data in the object, writing to the stream. Caller is responsible
123  // for deleting
124  // @return The new iterator.
125  virtual IContentWriteIterator *NewWriteIterator(IPMStream *s) = 0;
126 
127  // Internal Use Only.
128  // Load a single interface in from the stream.
129  virtual void LoadOne(IPMStream *s, ImplementationID prop, IPMUnknown *loadThis, bool16 setDirty) = 0;
130 
138  virtual void SaveDirty(IPMStream *s, bool16 clearDirty = kTrue) = 0;
139 
140  // Internal Use Only
141  virtual void SaveSingleInterface(InterfaceReadWrite readWriter, IPMUnknown *face, IPMStream *s, ImplementationID tag, IContentTracker *contentTracker) = 0;
142 
143  // allowModification indicates whether on not to consider the pub changed (i.e. prompt the user to save).
144  virtual bool16 IsDirty(const IPMUnknown *p) const = 0;
145 
146  // for internal use - please do not call
147  virtual void ClearDirty() = 0;
148 
149  // for internal use - please do not call
150  virtual void ResetOneToSnapshot(ImplementationID prop, SnapshotID snapshotID, ISnapshotCache* snapshotCache) = 0;
151 
152  // for internal use - please do not call
153  virtual SnapshotID SnapshotDirty (ImplementationID prop) = 0;
154  // for internal use - please do not call
155  virtual void SnapshotDirty () = 0;
156 
157  // for internal use - please do not call
158  virtual void RefreshCachedLastRevInfoAfterDBClone(bool objIsReferenced) = 0;
159 
160  // for internal use - please do not call
161  virtual void UpdateReadStamps() = 0;
162 
163  // for internal use - please do not call
164  virtual void MarkDirtyInterfacesToBeCopiedAtNextMiniSave() = 0;
165 
166  // for internal use - please do not call
167  virtual void SaveThisToComposite(IDataBase* source, IDataBase* target, UID thisUID) = 0;
169 };
170 
171 
172 
173 #endif // __IPMPersist__