InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITextSelectionSuite.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Richard Rodseth
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 // Note:
24 //
25 //========================================================================================
26 
27 #ifndef _ITextSelectionSuite_
28 #define _ITextSelectionSuite_
29 
30 #include "IPMUnknown.h"
31 #include "TextEditorID.h"
32 #include "ISelectionMessages.h"
33 
34 class ITextFocus;
35 class RangeData;
36 class IControlView;
37 class ITextStoryThread;
38 class ITableModel;
39 class ITextModel;
40 class IShape;
41 class GraphicsData;
42 #include "PMPoint.h"
43 
46 {
47 public:
48  virtual ~TextSelectionState() {} //public only until table tracker is refactored
49 
50  virtual ITextStoryThread* GetStoryThread() = 0;
51  virtual ParcelKey GetLastParcelKey() = 0;
52  virtual IControlView* GetView() = 0;
53 };
54 
55 
66 {
67 public:
68  enum { kDefaultIID = IID_ITEXTSELECTION_SUITE};
69 
71  virtual void SetActiveConcreteSelection( ClassID ) = 0;
73  virtual ClassID GetActiveConcreteSelection() = 0;
74 
82  virtual bool16 SetTextSelection( const UIDRef& story, const RangeData& range, Selection::ScrollChoice doScroll, const RangeData* scrollTo) = 0;
83 
84 
91  virtual bool16 SetTextSelection( IPMUnknown* targetingBoss, Selection::ScrollChoice doScroll, const RangeData* scrollTo) = 0;
92 
93  enum ToggleType { kFootnotesOnly, kAnchoredFramesOnly, kAnyType };
94 
99  virtual bool16 CanToggleAnchorSelection(ToggleType type = kAnyType) = 0;
100 
105  virtual bool16 ToggleAnchorSelection(ToggleType type = kAnyType) = 0;
106 
107  enum Change { kMoveSelection = 0, kMove = kMoveSelection, kReplaceSelection = kMove, kExtendSelection = 1, kExtend = kExtendSelection};
108  enum Units { kNone = 0, kCharacter, kChar = kCharacter, kWord, kLine, kSentence, kParagraph = 5, /*kFrame, kPage, kSpread,*/ kStory = 9 };
109  enum Direction { kNext, kPrev, kStart, kEnd, kAll };
110 
119  virtual bool16 ChangeTextSelection( Change moveOrExtend, Units textUnits, Direction direction, Selection::ScrollChoice autoScroll ) = 0;
120 
126  virtual bool16 ScrollViewTo( IControlView* view, const RangeData& location ) = 0;
127 
129  virtual bool16 ScrollViewToSelection( IControlView* view) = 0;
130 
132  virtual bool16 CenterViewOn( IControlView* view, const RangeData& location ) = 0;
133 
135  virtual bool16 CenterSelectionInView( IControlView* view) = 0;
136 
137 
140  IControlView* view, const PBPMPoint& viewLoc,
141  ITextStoryThread* theStoryThread, ParcelKey theParcel,
142  Change change, Units units) = 0;
143 
145  virtual void SelectTextInViewContinue( TextSelectionState* state, const PBPMPoint& viewLoc, ParcelKey parcelHitKey) = 0;
146 
148  virtual void SelectTextInViewFlush( TextSelectionState* state) = 0;
149 
151  virtual void SelectTextInViewSuspend( TextSelectionState* state) = 0;
152 
154  virtual void SelectTextInViewResume( TextSelectionState* state, const PBPMPoint& viewLoc, ParcelKey parcelHitKey) = 0;
155 
157  virtual void SelectTextInViewEnd( TextSelectionState* state) = 0;
158 
159 
161  virtual bool16 IsTextSelectionInTable() const = 0;
162  virtual bool16 IsTextSelectionInFootnote() const = 0;
163  virtual bool16 IsInsertionPoint() const = 0;
164 
166  virtual bool16 CanTrackerExtendTableSelection(ITableModel *trackerFramesTableModel) const = 0;
167 
168 protected:
170  enum DrawChoice { kDontDrawSelection, kDrawSelection};
171 
172 private:
174  virtual bool16 DrawShapeDynamicTextHighlight( GraphicsData* gd, IShape *textFrameShape) = 0;
176  virtual bool16 DrawOneFrameHighlight( GraphicsData *gd, IShape *frameShape) = 0;
178  virtual void DrawDynamicHighlight( IControlView* view, const UIDRef& story, const RangeData& range) = 0; //must contain anchor end
180  virtual RangeData GetDynamicHighlight() = 0;
182  virtual void ResetDynamicHighlight() = 0;
184  virtual bool16 SetTextSelectionHmm( const UIDRef& story, const RangeData& range, Selection::ScrollChoice doScroll, const RangeData* scrollTo, DrawChoice drawIt) = 0;
185 
186  friend class TextSelectionIntegratorSuite;
187  friend class TextSelectionIntegratorSuiteTemp;
188  friend class TextCellTextSelectTracker;
189  friend class TextCellSelectTracker;
190  friend class HorizontalIBeamCrsrProvider;
191  friend class FootnoteTextSelectTracker;
192  friend class FrameShape;
193  friend class TextSelectionHighlighter;
194  friend class CWaxRunText;
195  friend class TableShape;
196  friend class CLineSegmentAdornment;
197  friend class MoveRowColumnTracker;
198  friend class CharacterAlternatesData;
199 
200 };
201 
202 #endif // _ITextSelectionSuite_
203 
204 
205 /*
206  699 Move to the right one character kChar kNext kMove Right arrow
207  700 Move to the left one character kChar kPrev kMove Left arrow
208  701 Move up one line kLine kPrev kMove Up arrow
209  702 Move down one line kLine kNext kMove Down arrow
210  703 Move to the right one word kWord kNext kMove Cmd + Right Arrow
211  704 Move to the left one word kWord kPrev kMove Cmd + Left Arrow
212  705 Move to the start of the line kLine kStart kMove Home
213  706 Move to the end of the line kLine kEnd kMove End
214  707 Move to the previous para kPara kPrev kMove Cmd + Up Arrow
215  708 Move to the next para kPara kNext kMove Cmd + Down Arrow
216  709 Move to end of story kStory kEnd kMove Cmd + End
217  710 Move to begining of story kStory kStart kMove Cmd + Home
218  712 Select word kWord kAll kMove Double Click
219 
220  713 Select one character to the right kChar kNext kExtend Shift + Right Arrow
221  714 Select one character to the left kChar kPrev kExtend Shift + Left Arrow
222  715 Select one word to the right kWord kNext kExtend Cmd + Shift + Right Arrow
223  716 Select one word to the left kWord kPrev kExtend Cmd + Shift + Left Arrow
224  717 Select to the start of the line kLine kStart kExtend Shift + Home
225  718 Select to the end of the line kLine kEnd kExtend Shift + End
226  719 Select one line above kLine kPrev kExtend Shift + Up Arrow
227  720 Select one line below kLine kNext kExtend Shift + Down Arrow
228  721 Select one paragraph before kPara kPrev kExtend Cmd + Shift + Up Arrow
229  722 Select one paragraph forward kPara kPrev kExtend Cmd + Shift + Down Arrow
230  723 Select all chars. in story kStory kAll kExtend Cmd + A
231  724 Select chars. from insertion point kChar kAll kExtend Shift + Click
232  725 Select to end of story kStory kEnd kExtend Cmd + Shift + End
233  726 Select to beginning of story kStory kStart kExtend Cmd + Shift + Home
234 */