InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IVOSDiskPage.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: EricM
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 // This is an interface that manages the virtual-memory-paging scheme
24 // used by the text storage system. A large story is stored in a list
25 // of IVOSDiskPage s. Each "page" stores a list of VOS_Object s. These
26 // VOS_Objects are abstract classes that represent a block of data, like a
27 // single run. If enough VOS_Objects are added to a single page, it splits
28 // into 2 pages. Currently they don't recombine, but they could/should.
29 // Each VOS_Object has a conceptual length called "VirtualLength" that
30 // represents the number of characters that the VOS_Object represents. The pages
31 // know how much VirtualLength is contained therein allowing for quicker searching.
32 // Knowing that, most of the routines are obvious. The odd ones are Get/SetStrand()
33 // which is used to connect strands to the first page of data (which may change
34 // during delete or split operations)
35 //
36 //========================================================================================
37 
38 #ifndef __IVOSDiskPage__
39 #define __IVOSDiskPage__
40 
41 #include "IPMUnknown.h"
42 #include "TextID.h"
43 #include "UIDList.h"
44 
45 class VOS_Object;
46 class VOS_SavedData;
47 
58 class IVOSDiskPage : public IPMUnknown
59 {
60  public:
61  enum { kDefaultIID = IID_IVOSDISKPAGE };
62 
65  virtual void SetStrand(UID strandID) = 0;
66 
69  virtual UID GetStrand() const = 0;
70 
73  virtual UID NextPage() const = 0;
74 
77  virtual UID PrevPage() const = 0;
78 
81  virtual void SetNextPage(UID page) = 0;
82 
85  virtual void SetPrevPage(UID page) = 0;
86 
89  virtual void AddRefObj(VOS_Object* object) = 0;
90 
93  virtual void ReleaseObj(VOS_Object* object) = 0;
94 
102  virtual VOS_Object* QueryFindObject(int32 *offset) = 0;
103 
109  virtual int32 LocateObjectStart(const VOS_Object *object) = 0;
110 
113  virtual VOS_Object* QueryFirstObj() = 0;
114 
117  virtual VOS_Object* QueryLastObj() = 0;
118 
124  virtual VOS_Object* QueryNextObj(VOS_Object *object) = 0;
125 
131  virtual VOS_Object* QueryPrevObj(VOS_Object *obj) = 0;
132 
137  virtual int32 ObjectIndexOnPage(const VOS_Object *object) = 0;
138 
144  virtual void InsertObj(VOS_Object *newOne, VOS_Object *before = nil) = 0;
145 
151  virtual void AppendObj(VOS_Object *newOne, VOS_Object *after = nil) = 0;
152 
157  virtual void RemoveObj(VOS_Object *theOne, bool16 deleteIt = kTrue) = 0;
158 
165  virtual void ReplaceObj(VOS_Object *replaceMe, VOS_Object *replaceWith, bool16 deleteIt = kTrue) = 0;
166 
169  virtual void RemovePage() = 0;
170 
175  virtual void InsertPage(UID newPage, VOS_Object *before = nil) = 0;
176 
179  virtual int32 TotalLength() = 0;
180 
183  virtual int32 TotalObjects() = 0;
184 
188  virtual ClassID GetClassOfObjectsInStrand() const = 0;
189 
192  virtual void AdjustLength(int32 delta) = 0;
193 
196  virtual void DirtyPage(Bool16 markDoc = kTrue) = 0;
197 
205  virtual UID RemoveOneOrMorePages(int32 *length,
206  K2Vector<UID> *pageIDList,
207  K2Vector<int32> *pageLenList) = 0;
208 };
209 
210 #endif
211  // __IVOSDiskPage__
212