24 #ifndef __VOSSavedData__ 25 #define __VOSSavedData__ 30 #include "KeyValuePair.h" 31 #include "AttributeBossList.h" 32 #include "K2SmartPtr.h" 33 #include "ErrorUtils.h" 35 #include "ITextModelMemento.h" 44 class IStyleRefConvSession;
48 _ComboKey() : uid (kInvalidUID), key(0) {}
49 _ComboKey(
UID uidIn) : uid(uidIn), key(0) {}
50 _ComboKey(
UID uidIn, int32 keyIn) : uid(uidIn), key(keyIn) {}
51 bool operator==(
const _ComboKey& y)
const 53 return (uid == y.uid && key == y.key);
56 bool operator<(
const _ComboKey& y)
const 71 typedef enum { kTerminated, kNonterminated } VSD_ExtraInfo;
81 virtual int32 GetDataLength()
const 82 {
return fDataLength; }
86 void RemovePage(
UID pageUID);
90 void AddSuffix(
VOS_Object *data, bool16 copy = kTrue);
91 void AddPrefix(
VOS_Object *data, bool16 copy = kTrue);
92 void InsertPrefix(
VOS_Object *data, bool16 copy = kTrue);
94 void SetExtraInformation(VSD_ExtraInfo info,
VOS_Object *settings = nil);
95 VSD_ExtraInfo GetExtraInformation()
const 96 {
return fExtraInfo; }
101 {
return fStrandClassID; }
103 {
return fObjectClassID; }
111 virtual void DeletePages();
112 virtual void UndeletePages();
113 virtual ErrorCode OnCopy();
114 virtual ErrorCode OnPaste();
119 int32 PrefixLength()
const 120 {
return (int32)fPrefixList.size(); }
121 int32 SuffixLength()
const 122 {
return (int32)fSuffixList.size(); }
123 int32 PagesLength()
const 124 {
return fPages.size(); }
127 {
return fPrefixList[n]; }
129 {
return fSuffixList[n]; }
130 UID PageUID(int32 n)
const 131 {
return fPages[n]; }
220 VSD_ExtraInfo fExtraInfo;
221 bool16 fPagesDeleted;
222 bool16 fPagesAreAliases;
235 void RemoveSubrange(int32 srIndex);
237 void SetSubDataRange(int32 srIndex,
238 TextIndex start, int32 len)
239 { fSubrangeList[srIndex].SetDataRange(start, len); }
241 void AddMapping(int32 srIndex,
ClassID cls,
244 int32 MapCount(int32 srIndex)
const 245 {
return fSubrangeList[srIndex].fPasteList.size(); }
247 ClassID GetMapKey(int32 srIndex, int32 i)
const 248 {
return fSubrangeList[srIndex].fPasteList[i].Key(); }
250 int32 Location(int32 srIndex,
ClassID klas)
const 251 {
return FindLocation(fSubrangeList[srIndex].fPasteList, klas); }
254 {
return fSubrangeList[srIndex].fPasteList[i].Value(); }
257 ErrorCode CopyDone();
259 ErrorCode TransferTo(
const UIDRef& toStory);
260 ErrorCode PastedAllSavedData(TextIndex start);
262 const UIDRef& GetStoryRef()
const 263 {
return fStoryRef; }
264 void SetStoryRef(
const UIDRef& story)
265 { fStoryRef = story; }
266 TextIndex GetDataStart()
const 267 {
return fDataStart; }
268 void SetDataStart(TextIndex start)
269 { fDataStart = start; }
270 int32 GetDataLength()
const 271 {
return fDataLength; }
272 void SetDataLength(int32 len)
273 { fDataLength = len; }
274 int32 GetNetDataLength()
const;
276 void XRefBind(
UID uidInSrcStory,
278 void XRefBind(
UID uidInSrcStory, int32 subKeyInSrcStory,
279 UID uidInDestStory, int32 subKeyInDestStory);
280 bool16 XRefLookup(
UID uidInSrcStory,
281 UID* uidInDestStory)
const;
282 bool16 XRefLookup(
UID uidInSrcStory, int32 subKeyInSrcStory,
283 UID* uidInDestStory, int32* subKeyInDestStory)
const;
284 int32 GetSubrangeCount()
const 285 {
return fSubrangeList.size(); }
286 TextIndex GetSubrangeDataStart(int32 srIndex)
const 287 {
return fSubrangeList[srIndex].GetDataStart(); }
288 int32 GetSubrangeDataLength(int32 srIndex)
const 289 {
return fSubrangeList[srIndex].GetDataLength(); }
290 void SetSubrangeDataRange(int32 srIndex,
293 { fSubrangeList[srIndex].SetDataRange(start, len); }
296 UID& GetDestRootStyle(
PMIID& whichIID);
299 TextIndex GetFirstRemainingTextIndex()
const;
307 SubRange() : fStart(0), fLength(0), fPasteList() {}
309 TextIndex GetDataStart()
const 311 int32 GetDataLength()
const 313 void SetDataRange(TextIndex start, int32 length)
314 { fStart = start; fLength = length; }
321 TextIndex fDataStart;
327 bool16 fFromCopyRange;
347 virtual bool16 GetIsMyContext(
const PasteData* vasd)
const = 0;
348 virtual const UIDRef& GetSrcStoryRef()
const = 0;
349 virtual const UIDRef& GetDestStoryRef()
const = 0;
350 virtual void XRefBind(
UID uidInSrcStory,
UID uidInDestStory) = 0;
351 virtual void XRefBind(
UID uidInSrcStory, int32 subKeyInSrcStory,
UID uidInDestStory, int32 subKeyInDestStory) = 0;
352 virtual bool16 XRefLookup(
UID uidInSrcStory,
UID* uidInDestStory)
const = 0;
353 virtual bool16 XRefLookup(
UID uidInSrcStory, int32 subKeyInSrcStory,
UID* uidInDestStory, int32* subKeyInDestStory)
const = 0;
358 #endif // __VOSSavedData__