InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IStrand.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: eric menninga
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 __ISTRAND__
25 #define __ISTRAND__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "K2Vector.h"
30 #include "WideString.h"
31 #include "K2SmartPtr.h"
32 #include "ITextModel.h"
33 
34 class IStrandPastePiece;
35 class ICommand;
36 class ITextModelMemento;
37 
38 
43 class IStrand : public IPMUnknown
44 {
45  public:
46  enum { kDefaultIID = IID_ISTRAND };
47 
49 
50  virtual void Insert(const WideString* data, TextIndex pos) = 0;
51  virtual void Delete(TextIndex startpos, int32 numchars) = 0;
52  virtual IStrandPastePiece* Cut(TextIndex startpos, int32 numchars) = 0;
53 
54  // Used to perform a set of replacements on the strand.
55  // The replacementList argument contains a list of ranges\
56  // associated with replacement strings.
57  // This is an optmized form for doing multiple replacements.
58  // The list of ranges is passed by the text model
59  // in descending order.
60  virtual void Replace(const boost::shared_ptr<ITextModel::ReplacementList >& replList,
61  bool16 clearNonContinuingAttrs) = 0;
62 
64  virtual void ForceCompositionDamage(TextIndex position, int32 numChars) = 0;
66  virtual void ForceContentDamage(TextIndex position, int32 numChars) = 0;
67 
69  virtual int32 GetRunLength(TextIndex position, TextIndex *runBegin = nil) = 0;
70 
71  virtual IStrandPastePiece* CopyRange(TextIndex startpos, int32 numchars) = 0;
72  virtual int32 Paste(TextIndex startpos, IStrandPastePiece *str) = 0;
73 
76  virtual void IncreaseSpan(TextIndex at, int32 len) = 0;
77 
78  virtual void CollectMementosForDelete(TextIndex at, int32 len,
79  MementoList& list) = 0;
80 
81  virtual void CollectMementosForCut(TextIndex at, int32 len,
82  MementoList& list) = 0;
83 
84  virtual void CollectMementosForCopyRange(TextIndex at, int32 len,
85  MementoList& list) const = 0;
86 
87  virtual void CollectMementosForReplace(TextIndex at, int32 len,
88  MementoList& list) = 0;
89 
92  virtual UID GetFirstPage() = 0;
95  virtual UID SetFirstPage(UID firstPage) = 0;
97  virtual UID CreatePage() = 0;
98 
100  virtual ClassID GetObjectClass() const = 0;
101 
105  virtual ICommand* QueryRemoveFromDocumentCmd(UID textModelUID) = 0;
106 
108  virtual UID GetOwningStoryUID() const = 0;
109  virtual void StrandAttachedToStory(UID textModelUID, int32 length) = 0;
110  virtual void StrandDetachedFromStory(UID textModelUID) = 0;
111 
112 
122  virtual void InsertStoryThread(UID dictUID, uint32 dictKey,
123  const WideString* data, TextIndex pos) = 0;
124 
140  virtual bool16 CreateStoryThreads(UID dictUID,
141  const K2Vector<uint32>& dictKeyList,
142  const K2Vector<int32>& lenList,
143  TextIndex pos) = 0;
144 
148  virtual bool16 JoinStoryThreads(TextIndex start, int32 len) = 0;
149 
150 };
151 
152 #endif // __ISTRAND__