InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IGenericTextSelectionSuite.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 // Note:
24 //
25 //========================================================================================
26 
27 #ifndef __IGenericTextSelectionSuite__
28 #define __IGenericTextSelectionSuite__
29 
30 //________________________________________________________________________________________________
31 // INCLUDES
32 //________________________________________________________________________________________________
33 #include "ShuksanID.h"
34 #include "IPMUnknown.h"
35 #include "WritingModeUIID2.h"
36 #include "WritingModeID2.h"
37 #include "ICTextNavigationSuite.h" // For TextSelectionIndex
38 
39 class ITextFocus;
40 class RangeData;
41 class SelectionExtension;
42 
49 {
50  //____________________________________________________________________________________________
51  // Data Types
52  //____________________________________________________________________________________________
53  public:
54  //enum { kDefaultIID = IID_IGALLEYTEXTSELECTION_SUITE };
55  enum { kDefaultIID = IID_IGENERICTEXTSELECTION_SUITE };
56 
57  enum ViewType { kStandard, kNote };
58 
59  //____________________________________________________________________________________________
60  // Member functions
61  //____________________________________________________________________________________________
62  public:
63  //________________________________________________________________________________________
64  // DESCR: Select the specified text range.
65  //________________________________________________________________________________________
66 
75  virtual bool16 SetSelection( RangeData r, const UIDRef& storyRef/* = kInvalidUIDRef*/, SelectionExtension *extendToUIDPair = nil) = 0;
76  enum DrawChoice { kDontDrawSelection, kDrawSelection};
77 
87  virtual bool16 SetSelectionHmm( RangeData r, const UIDRef& storyRef, SelectionExtension extendToUIDPair, DrawChoice drawIt) = 0;
88 
89  //________________________________________________________________________________________
90  // DESCR: Deselect everything in the selection.
91  //________________________________________________________________________________________
92  virtual void DeselectAll() = 0;
93 
94  //________________________________________________________________________________________
95  // DESCR: Gets the selection - returns it in nStart and nLength
96  //________________________________________________________________________________________
97  virtual RangeData GetSelection( UIDRef* story = nil) const = 0;
98 
99  //________________________________________________________________________________________
100  // DESCR: Checks to see if text is editable at current selection location. Returns true if editing is allowed.
101  //________________________________________________________________________________________
102  virtual bool16 CanEditText() = 0;
103 
104  //________________________________________________________________________________________
105  // DESCR: Used to pseudo extend selection to deleted text. Makes no difference to behavior only ui appearance
106  //________________________________________________________________________________________
107 // virtual void SetSelectionIsExtendedToDeletedUID(UID extendToUID) = 0;
108 
115 
116  //________________________________________________________________________________________
117  // DESCR: Return an instance of the current text focus
118  //________________________________________________________________________________________
119  virtual ITextFocus *QueryTextFocus() = 0;
120 
121  //________________________________________________________________________________________
122  // DESCR: Set the current parent widget for this selection
123  //________________________________________________________________________________________
124  virtual void SetWidgetParent_(IPMUnknown *parent) = 0;
125 
126  //________________________________________________________________________________________
127  // DESCR: Notify that selection changed doesn't notify suites. Used in SelectGalleyTextCmd and SelectNoteTextCmd
128  //________________________________________________________________________________________
129 // virtual void SelectionChangedNotify() const = 0;
130 
131  //________________________________________________________________________________________
132  // DESCR: Return the type of view associated with this selection
133  //________________________________________________________________________________________
134  virtual ViewType GetSelectionViewType() = 0;
135 
136  //________________________________________________________________________________________
137  // DESCR: Set the selection text model to value
138  //________________________________________________________________________________________
139  virtual void TempSetSelectionTextModel(const UIDRef &storyRef) = 0;
140 
141 };
142 
143 #endif // __IGenericTextSelectionSuite__