InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
INoteUIUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Wai Cheuk
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 __INOTEUIUTILS__
25 #define __INOTEUIUTILS__
26 
27 #include "NoteID.h"
28 //-----------------------------------
29 // Forward References
30 //
31 class IPanelControlData;
32 class ITextLines;
33 class IControlView;
34 class IWaxStrand;
35 class ITextModel;
36 class ISelectionManager;
37 
38 #include "IPMUnknown.h"
39 #include "UIDList.h"
40 #include "PMPoint.h"
41 #include "IRangeData.h"
42 
46 class INoteUIUtils : public IPMUnknown
47 {
48 public:
49  enum { kDefaultIID = IID_INOTEUIUTILS };
50  enum SelectionOwnerType { kNone, kSelectionInLayout, kSelectionInGalley, kSelectionInNoteInGalley, kSelectionInNoteInLayout };
51 
52 
59  virtual void GoToNextNote(ISelectionManager* selMgr, TextIndex fromThisTextIndex, UIDRef docRef, UIDRef storyRef) = 0;
60  // Search the next note from the given text index in the main story.
61  // Display the content in the appropriate UI and ends with selecting
62  // the note anchor of the note we're searching.
63 
64 
71  virtual void GoToPreviousNote(ISelectionManager* selMgr, TextIndex fromThisTextIndex, UIDRef docRef, UIDRef storyRef) = 0;
72  // Search the previous note from the given text index in the main story.
73  // Display the content in the appropriate UI and ends with selecting
74  // the note anchor of the note we're searching.
75 
76 
82  virtual void ShowNoteAnchorAt(ISelectionManager* selMgr, TextIndex noteAnchorPosition, UIDRef storyRef) = 0;
83  // Select the note anchor at the given text index in the given story and
84  // scroll the page to the location if the anchor is not already in the
85  // current page
86 
87 
99  virtual void DrawGalleyCaret(IControlView* writingView, ITextLines* textLines, int32 lineIndex, int32 caretOffsetIntoLine, int32 runIndex = -1, int32 caretOffsetIntoRun = -1) = 0;
100 
106  virtual void RenderThickCaret(IControlView* writingView, const IPMPoint& startPt, const IPMPoint& endPt) = 0;
107  //
108 
115  virtual bool16 TextFocusInNote(UIDRef storyRef, TextIndex textIndex, TextIndex* anchorPosition) = 0;
116 
123  virtual bool16 TextFocusInOwnedItem(UIDRef storyRef, TextIndex textFocus, TextIndex* owneItemPosition) = 0;
124  // If textFocus is inside any owned item (regardless of UI) return kTrue and its anchor position,
125  // otherwise, return kFalse and kInvalidTextIndex in anchorPosition
126 
127 
131  virtual void SetGalleyWritingSelection( const RangeData& range) = 0;
132  // activate the galley writing widget;
133  // hilite selection from start to end.
134 
135 
139  virtual void SelectNextNote(ISelectionManager*) = 0;
140  // Actions driven calls - main note menu, palette fly-out menu, kbsc
141 
142 
146  virtual void SelectPrevNote(ISelectionManager*) = 0;
147  // Actions driven calls - main note menu, palette fly-out menu, kbsc
148 
149 
153  virtual void ToggleNoteDisplay() = 0;
154  // Actions driven calls - main note menu, palette fly-out menu, kbsc
155 
156 
160  virtual void ExpandAllNotes() = 0;
161  // Expand all inline notes in the view story
162 
163 
167  virtual void CollapseAllNotes() = 0;
168  // Collapse all inline notes in the view story
169 
170 
174  virtual void DoClearAllNotes() = 0;
175  // Remove all note data from the view document (layout),
176  // or remove all note data from the view story (galley)
177 
178 
182  virtual void DoOpenCloseNote() = 0;
183  // Galley: expand or collapse inline note (a toggle) based on current selection
184  // Layout: open the selected note in the note palette
185 
186 
191  virtual bool16 GetFindChangeTextWalker() const = 0;
192 
197  virtual bool16 GetSpellTextWalker() const = 0;
198  // find text walker is active, find/change or spell
199 
200 
206  virtual bool16 GiveUpNoteSelection(IControlView *noteView = nil) = 0;
207 
212  virtual ErrorCode SetFrontDocViewSelection() = 0;
213 
220  virtual void DrawHitTestBox(IControlView* view, const RangeData &caret, UIDRef storyRef) = 0;
221 
229  virtual bool16 GetNoteRegion(ITextModel* textModel, TextIndex cursorIndexHit, int32 hitTestExpandOffset, TextIndex& anchorIndex) const = 0;
230  // With the given cursor position in a story and an expansion zone (in terms of
231  // number of characters), this method returns if there is any note near
232  // the cursor position with hitTestExpandOffset as offset to its right
233  // and to its left position. It returns kTrue and the note anchor position
234  // if note is found in the region. It returns kFalse if no note is found.
235 
240  virtual void ActivateInlineNote(UIDRef storyRef, UIDRef noteDataRef) = 0;
241 
245  virtual void InvalidateLayoutView() = 0;
246 
253  virtual SelectionOwnerType GetCurrentTextSelection_(TextIndex& nStart, TextIndex& nEnd, UIDRef* storyRef) = 0;
254 
259  virtual bool16 InGalleyView() = 0;
260 
263  virtual void GetCurrentActionState(TextIndex& focusStart, TextIndex& focusEnd, TextIndex& noteAnchorPos,
264  UIDRef& storyRef, bool16& storyHasFocus, bool16& focusInsideNote,
265  bool16& focusInMainStoryThread, bool16& noteHidden, bool16& editable,
266  bool16& focusInsideDeletedText, TextIndex * threadStart = nil, TextIndex * threadEnd = nil) = 0;
267 
270  virtual bool16 GetNewNoteActionState() = 0;
273  virtual bool16 GetConvertToNoteActionState() = 0;
276  virtual bool16 GetOpenNoteActionState() = 0;
279  virtual bool16 GetDeleteNoteActionState() = 0;
282  virtual bool16 GetScrollToAnchorActionState() = 0;
285  virtual bool16 GetConvertToTextActionState() = 0;
288  virtual bool16 GetSplitNoteActionState() = 0;
291  virtual bool16 GetNaviationActionState() = 0;
294  virtual bool16 GetExpandAllNoteActionState() = 0;
297  virtual bool16 GetCollapseAllNoteActionState() = 0;
300  virtual bool16 GetRemoveAllNoteActionState() = 0;
303  virtual bool16 GetDisplayNoteActionState() = 0;
304  // Various methods to alllow access to the action states
305 
308  virtual bool16 GetStoryNoteState(bool16 checkCollapsedState) = 0;
309  // helper method
310 
317  virtual bool16 FrontWindowGalley() = 0;
318  // InCopy 2.0 - return the front most galley window
319 
320 };
321 
322 #endif // __INOTEUIUTILS__