InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITextWalker.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Bernd Paradies
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 __ITextWalker__
25 #define __ITextWalker__
26 
27 #include "IPMUnknown.h"
28 #include "TextWalkerServiceProviderID.h"
29 class IDocument;
30 class ITextModel;
31 class ITextWalkerClient;
33 class ITextWalkerScope;
34 class ITextFocus;
35 class IFindChangeOptions;
36 
37 //----------------------------------------------------------------------------------------
38 // Interface ITextWalker
39 //----------------------------------------------------------------------------------------
40 
44 class ITextWalker : public IPMUnknown
45 {
46 public:
47  enum { kDefaultIID = IID_ITEXTWALKER};
48 
57  virtual void Initialize (ITextWalkerClient *pClient,
58  ITextWalkerScope* pScope,
59  IFindChangeOptions* pOptions,
60  void* token = nil) = 0;
66  virtual bool16 Walk() = 0;
67 
75  virtual int32 MoveBy( int32 nDelta ) = 0;
76 
82  virtual void MoveTo( TextIndex nPosition ) = 0;
83 
87  virtual void Suspend() = 0;
88 
92  virtual void Halt() = 0;
93 
99  virtual bool16 IsSuspended() const = 0;
100 
106  virtual bool16 IsWalking() const = 0;
107 
113  virtual TextIndex GetWalkerPosition() const = 0;
114 
120  virtual ITextWalkerScope* QueryScope() = 0;
121 
127  virtual ITextWalkerClient* QueryClient () = 0;
128 
134  virtual void * GetCursorToken() = 0;
135 
142  virtual void SetClientSelection( TextIndex nStart, int32 nLength ) = 0;
143 
152  virtual ITextFocus* GetClientSelection(TextIndex *pStart, int32* pLength) const = 0;
153 
161  virtual bool16 AdjustRangeToStoryStart(int32 delta) = 0;
162 
170  virtual bool16 AdjustRangeToStoryEnd(int32 delta) = 0;
171 
179  virtual void ExtendCurrentRangeToEndOfStory() = 0;
180 
187  virtual void ExtendCurrentRangeToStory() = 0;
188 
195 
204  virtual void SetStateForRangeLock(bool16 state) = 0;
205 
212  virtual bool16 IsCompleted() const = 0;
213 };
214 
219 {
220 public:
221  enum { kDefaultIID = IID_ITEXTWALKERCLIENT};
222 
229  virtual bool16 OnStart( ITextWalker *pWalker ) = 0;
230 
237  virtual bool16 OnEnd( ITextWalker *pWalker ) = 0;
238 
245  virtual bool16 OnResume( ITextWalker *pWalker ) = 0;
246 
253  virtual bool16 OnSuspend( ITextWalker *pWalker ) = 0;
254 
272  virtual bool16 OnNextPosition(ITextWalker *pWalker, ITextModel *pModel,
273  TextIndex nPosition,
274  TextIndex nStartRange, TextIndex nEndRange,
275  int32 startRangePrcnt, int32 endRangePrcnt,
276  bool16 rangeAdjustable) = 0;
277 
286  virtual bool16 OnStoryStart( ITextWalker *pWalker, UID storyUID ) = 0;
287 
293  virtual void OnStoryEnd( ITextWalker *pWalker ) = 0;
294 
303  virtual bool16 OnDocumentStart( ITextWalker *pWalker, const UIDRef &newDoc ) = 0;
304 
310  virtual void OnDocumentEnd( ITextWalker *pWalker) = 0;
311 
317  virtual void SetReplacementCount(int32 count) = 0;
318 
324  virtual int32 GetReplacementCount() = 0;
325 
336  virtual bool16 UpdateTextRange() = 0;
337 };
338 
339 #endif