InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IComposeScanner.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 __IComposeScanner__
25 #define __IComposeScanner__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "K2Vector.h"
30 #include "PMTextUtils.h"
31 #include "textiterator.h"
32 #include "IRunInStylesUtils.h"
33 
34 class AttributeBossList;
35 class IDrawingStyle;
36 class WideString;
37 class IAttrReport;
38 class RangeData;
39 
45 {
46  public:
47  enum { kDefaultIID = IID_ICOMPOSESCANNER };
48 
49  //-----------------------------------------------------------------------------------------
58  virtual TextIndex CopySurroundingWord(TextIndex position, WideString *copy, UID *pLanguageUID = nil, FuncIsWordChar func = nil ) = 0;
59 
66  virtual TextIndex CopyText(TextIndex position, int32 length, WideString *copy) const = 0;
68  virtual TextIndex CopyText(const RangeData& range, WideString *copy) const = 0;
69 
70  //-----------------------------------------------------------------------------------------
77  virtual TextIndex FindSurroundingWord(TextIndex position, int32 *length, UID *pLanguageUID = nil, FuncIsWordChar wordFunc = nil ) = 0;
79  virtual RangeData FindSurroundingWord(TextIndex position, UID *pLanguageUID = nil, FuncIsWordChar wordFunc = nil ) = 0;
80 
82  virtual TextIndex FindSurroundingWordUsingWordCharFuncOnly(TextIndex position, int32 *length, UID *pLanguageUID = nil, FuncIsWordChar wordFunc = nil ) = 0;
84  virtual RangeData FindSurroundingWordUsingWordCharFuncOnly(TextIndex position, UID *pLanguageUID = nil, FuncIsWordChar wordFunc = nil ) = 0;
85 
86  //-----------------------------------------------------------------------------------------
93  virtual TextIndex FindSurroundingParagraph(TextIndex position, int32 *length, bool16 excludeEOS = kTrue, bool16 validatePara = kTrue) const = 0;
95  virtual RangeData FindSurroundingParagraph(TextIndex position, bool16 excludeEOS = kTrue, bool16 validatePara = kTrue) const = 0;
96 
97 
98  //-----------------------------------------------------------------------------------------
110  virtual const IAttrReport* QueryAttributeAt(int32 startPosition, int32 endPosition,
111  ClassID typeAttribute, int32 *length = nil, bool16 moveBackwards = kFalse) const = 0;
113  virtual const IAttrReport* QueryAttributeAt( const RangeData& range,
114  ClassID typeAttribute, int32 *length = nil, bool16 moveBackwards = kFalse) const = 0;
115 
134  virtual void QueryAttributeAt(
135  int32 startPosition,
136  int32 endPosition,
137  K2Vector<ClassID>::const_iterator firstAttribute,
139  AttributeBossList* results, // output: AttributeBossList of att
140  int32* length = nil, // output: can be nil on input
141  bool16 moveBackwards = kFalse
142  ) const = 0;
143 
144  //-----------------------------------------------------------------------------------------
151  virtual IDrawingStyle* GetCompleteStyleAt(TextIndex position, int32 *lenleft = nil) = 0;
152 
160  virtual IDrawingStyle* GetParagraphStyleAt(TextIndex position, int32 *lenleft = nil, TextIndex *paragraphStart = nil) = 0;
161 
162  virtual const RunInStyleResults& GetRunInStylesResultsAt(TextIndex position, TextIndex *paragraphStart = nil) = 0;
163 
173  virtual TextIterator QueryDataAt(TextIndex position, IDrawingStyle **newstyle, int32 *numChars) = 0;
174 
175  //-----------------------------------------------------------------------------------------
177  virtual void AttributesChanged(TextIndex start, int32 length) = 0;
179  virtual void Clear() = 0;
180 
181  virtual void StartComposingNestedStyles() = 0;
182  virtual void StopComposingNestedStyles() = 0;
183 };
184 
185 
186 
187 
188 #endif // __IComposeScanner__
189 
190