InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
itextRangeNode.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Jianlan Song
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 __ITEXTRANGENODE__
25 #define __ITEXTRANGENODE__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "SBOSReference.h"
30 
31 class ITextRangeNode;
34 
35 extern const TextRangeReference kInvalidTextRange;
36 
42 class INTERFACE_DECL ITextRangeNode : public IPMUnknown
43 {
44 public:
45  enum { kDefaultIID = IID_ITEXTRANGENODE };
46 
47  typedef struct _TextRange
48  {
49  _TextRange(TextIndex start, int32 length) : startIndex(start), rangeLength(length) {}
50 
51  TextIndex startIndex;
52  int32 rangeLength;
53  } TextRange;
54 
60  virtual void Initialize(ITextRangeNode::TextRange range, UIDRef baseUIDRef, uint32 subItemKey = 0) = 0;
61 
65  virtual UIDRef GetBaseUIDRef() const = 0;
69  virtual uint32 GetSubKey() const = 0;
73  virtual UIDRef GetOwningStoryUIDRef() const = 0;
78  virtual void SetObjectID(UIDRef baseUIDRef, uint32 subItemKey = 0) = 0;
79 
83  virtual TextIndex GetKey() const = 0;
84  virtual TextIndex GetStartIndex() const = 0;
88  virtual void SetStartIndexOffset(TextIndex newOffset) = 0;
92  virtual void SetRangeLength(int32 length) = 0;
96  virtual int32 GetRangeLength() const = 0;
100  virtual TextRange GetTextRange() const = 0;
101 
105  virtual TextIndex GetParentOffset() const = 0;
109  virtual TextIndex GetAbsoluteParentOffset() const = 0;
110 
113  virtual TextRangeReference GetSelfRef() const =0;
114  virtual void SetSelfRef(TextRangeReference ref) =0;
115  virtual TextRangeReference GetParentRef() const =0;
116  virtual void SetParentRef(TextRangeReference ref) =0;
117  virtual TextRangeReference GetLeftRef() const =0;
118  virtual void SetLeftRef(TextRangeReference ref) =0;
119  virtual TextRangeReference GetRightRef() const =0;
120  virtual void SetRightRef(TextRangeReference ref) =0;
121 
124  virtual bool IsRed() const = 0;
127  virtual bool RightIsRed() const = 0;
130  virtual bool LeftIsRed() const = 0;
133  virtual bool IsThreeNode() const = 0;
136  virtual void MakeRed() = 0;
139  virtual void MakeBlack() = 0;
143  virtual void CopyColor(const ITextRangeNode* from) = 0;
144  virtual bool operator< ( const ITextRangeNode& t2 ) const = 0;
145 };
146 
147 //DECLARE_BASE_TYPE(TextRangeReference); // no special copy
148 
149 #endif // __ITEXTRANGENODE__
150 
151