InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICTextNavigationSuite.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Ben Park
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 __ICTextNavigationSuite__
25 #define __ICTextNavigationSuite__
26 
27 #include "IPMUnknown.h"
28 
29 #include "UIDRef.h"
30 #include "WritingModeUIID2.h"
31 #include "WritingModeID2.h"
32 class RangeData;
33 /*
34  This sucker is used for navigating the Galley Text. The big table below was copied from
35  ITextSelectionNavigator, and it's a list of keyboard shortcuts that can be used.
36  I'll modify it as new stuff is added. Of course, this can be used w/o keyboard shortcuts
37  (ex. triple click will select a paragraph).
38 
39  No. Shortcut Unit Direction Type Mac OS Windows
40  ======================================================================================================
41  699 Move to the right one character kChar kNext replace Right arrow Right arrow
42  700 Move to the left one character kChar kPrev replace Left arrow Left arrow
43  701 Move up one line kLine kPrev replace Up arrow Up arrow
44  702 Move down one line kLine kNext replace Down arrow Down arrow
45  703 Move to the right one word kWord kNext replace Cmd + Right Arrow Ctrl + Right Arrow
46  704 Move to the left one word kWord kPrev replace Cmd + Left Arrow Ctrl + Left Arrow
47  705 Move to the start of the line kLine kStart replace Home Home
48  706 Move to the end of the line kLine kEnd replace End End
49  707 Move to the previous para kPara kPrev replace Cmd + Up Arrow Ctrl + Up Arrow
50  708 Move to the next para kPara kNext replace Cmd + Down Arrow Ctrl + Down Arrow
51  709 Move to end of story kStory kEnd replace Cmd + End Ctrl + End
52  710 Move to begining of story kStory kStart replace Cmd + Home Ctrl + Home
53  712 Select word kWord kAll replace Double Click Double Click
54  713 Select one character to the right kChar kNext expand Shift + Right Arrow Shift + Right Arrow
55  714 Select one character to the left kChar kPrev expand Shift + Left Arrow Shift + Left Arrow
56  715 Select one word to the right kWord kNext expand Cmd + Shift + Right Arrow Ctrl + Shift + Right Arrow
57  716 Select one word to the left kWord kPrev expand Cmd + Shift + Left Arrow Ctrl + Shift + Left Arrow
58  717 Select to the start of the line kLine kStart expand Shift + Home Shift + Home
59  718 Select to the end of the line kLine kEnd expand Shift + End Shift + End
60  719 Select one line above kLine kPrev expand Shift + Up Arrow Shift + Up Arrow
61  720 Select one line below kLine kNext expand Shift + Down Arrow Shift + Down Arrow
62  721 Select one paragraph before kPara kPrev expand Cmd + Shift + Up Arrow Ctrl + Shift + Up Arrow
63  722 Select one paragraph forward kPara kPrev expand Cmd + Shift + Down Arrow Ctrl + Shift + Down Arrow
64  723 Select all chars. in story kStory kAll expand Cmd + A Ctrl + A
65  724 Select chars. from insertion point kChar kAll expand Shift + Click Shift + Click
66  725 Select to end of story kStory kEnd expand Cmd + Shift + End Ctrl + Shift + End
67  726 Select to beginning of story kStory kStart expand Cmd + Shift + Home Ctrl + Shift + Home
68 */
69 
72  {
73 
74  public:
75  inline TextSelectionIndex() :
76  fIndex( kInvalidTextIndex ),
77  fEndOfLine( kFalse )
78  {};
79 
80 
85  inline TextSelectionIndex( TextIndex nIndex, bool16 endOfLine /*= kFalse*/) :
86  fIndex( nIndex ),
87  fEndOfLine( endOfLine )
88  { }
89 
95  {
96  fIndex = rhs.fIndex;
97  fEndOfLine = rhs.fEndOfLine;
98 
99  return *this;
100  }
101 
103  TextIndex fIndex;
104 
106  bool16 fEndOfLine;
107  };
108 
109  const TextSelectionIndex kInvalidTextSelectionIndex (kInvalidTextIndex, kFalse);
110 
111 
112 
113 class SelectionExtension;
114 
117 {
118 public:
119  enum { kDefaultIID = IID_ICTEXTNAVIGATIONSUITE };
120 
122  enum Units {
137  };
138 
140  enum Direction {
151  };
152 
153 #if 0
154 
165 #endif
166 
173  };
174 
176  enum LooseEnd {
181  };
182 
183  //virtual bool16 SetTextSelection( const RangeData& range,
184  // bool16 endUsedLast = kTrue, bool16 drawIt = kFalse, bool16 autoScroll = kTrue ) = 0;
185 
195  virtual bool16 SetTextSelection( const RangeData& range,
196  LooseEnd endUsedLast /*= kLooseEnd*/, ScrollChoice autoScroll /*= kScrollIntoView*/, SelectionExtension *extendToUIDPair = nil) = 0; //draw == true
197 
201  virtual bool16 SelectAll() = 0;
202 
208  virtual bool16 SelectTextAt( TextSelectionIndex nTo, Units nUnits) = 0;
209 
215  virtual bool16 MoveTextSelection( Units nUnits, Direction nDirection) = 0; //drawit == kTrue
216 
221  virtual bool16 ExpandTo( TextSelectionIndex nTo) = 0;
222 
228  virtual bool16 ExpandTextSelection ( Units nUnits, Direction nDirection) = 0;
229 
231  virtual void ResetNavigationState () = 0;
232 
233  // These functins allow outside users to get the relevant Text Nav Data. The factors tracked here are:
234  // Last up/down position
235  // Anchor point
236  // Start/end indexes end of line data
237 
242  virtual RangeData GetAnchorData ( bool16 *usedEndLast ) = 0;
243 
250  virtual TextIndex InterpretHitTest( int32 clickCount, TextIndex newPosition, TextSelectionIndex *pEnd) = 0;
251 
252 
254  virtual void MoveSelectionToVisiblePage() = 0;
255 
256 };
257 
258 
259 #endif // __ICTextNavigationSuite__