InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
INoteUtils.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 __INOTEUTILS__
25 #define __INOTEUTILS__
26 
27 #include "NoteID.h"
28 
29 //-----------------------------------
30 // Forward References
31 //
32 class IControlView;
34 class ITextModel;
35 class IWaxStrand;
36 class PMPoint;
37 class PMString;
38 class IDocument;
39 class IGalleySwitch;
40 class INoteStringAttribute;
41 class IFrameList;
42 class IMasterSpreadList;
43 class IHierarchy;
44 class PMRect;
46 class INoteData;
47 class WideString;
48 class RangeData;
49 
50 
51 #include "IPMUnknown.h"
52 #include "UIDList.h"
53 
56 class INoteUtils : public IPMUnknown
57 {
58  public:
59  enum { kDefaultIID = IID_INOTEUTILS };
60 
61 
67  virtual void ConvertNoteTipText(const uchar16* inString, int32& inBufLength, PMString& outBuffer) = 0;
68 
74  virtual INoteData* QueryNoteData(const ITextModel* textModel, const TextIndex noteDataIndex) = 0;
75 
80  virtual INoteData* QueryNoteData(const UIDRef& noteDataRef) = 0;
81 
87  virtual INoteData* GetNoteData(ITextModel* textModel, TextIndex offset) = 0;
88 
89 
96  virtual SysPoint GlobalToLocal(IControlView* controlView, SysPoint globalPoint) = 0;
97  // Convert a SysPoint from global coordinate to a local coordinate in the
98  // controlView context.
99 
100 
114  virtual IMultiColumnTextFrame* QueryTextFrame(IControlView* controlView,
115  PMPoint where,
116  RangeData *caret,
117  bool16 composeFirst = kTrue) = 0;
118 
122  virtual void GetTime(PMString* time) = 0;
123 
129  virtual IDocument* QueryDocument(ITextModel* model, IControlView* view) = 0;
130  // Return the document with a given text model
131 
132 
139  virtual bool16 InGalley(IGalleySwitch* galleySwitch) = 0;
140 
150  virtual PMPoint IndexToPMPoint(ITextModel* textModel, const RangeData &caret, int32* thisFrameIndex) = 0;
151 
157  virtual bool16 GetStoryLockState(ITextModel* textModel) = 0;
158 
164  virtual bool16 GetStoryLockState(IDocument* document) = 0;
165 
170  virtual const int32 GetDocAnchorCount(IDocument* document) = 0;
171 
176  virtual const int32 GetAnchorCount(ITextModel* textModel) = 0;
177 
182  virtual int32 ResetStoryAnchorCount(ITextModel* textModel) = 0;
183  // accumulate the anchor count from the text model and return the total
184  // count for this story. This is 100% accurate but performance can be an issue
185  // for large story with large number of notes in it.
186 
191  virtual int32 ResetDocAnchorCount(IDocument* document) = 0;
192  // for each story in the document, accumulate the anchor count from the text model and return the total
193  // count for the document. This is 100% accurate but performance can be an issue for larger document
194  // with large number of notes in it.
195 
200  virtual PMReal GetGalleyLeftIndent() = 0;
201  // return the left indent of the info panel in Galley. If in layout this value will be zero.
202 
203 
210  virtual bool16 NoteInCurrentSpread(UID noteSpreadUID, UID curSpreadUID, IMasterSpreadList* masterSpreadList) = 0;
211  // check if this note window (i.e. with noteSpreadUID) should be open in the curSpreadUID.
212  // return kTrue to open, otherwise return kFalse
213 
214 
220  virtual bool16 PageItemInvisible(ITextModel* textModel, IHierarchy* hierItem) = 0;
221  // This method determines if the page item in the hierarchy is in the invisible
222  // layer, which is used to hold the overset text for InCopy text frame.
223 
224 
230  virtual UID GetLastVisibleFrame(ITextModel* textModel, TextIndex startIndex) = 0;
231  // !!! InCopy call only !!!
232  // With a given text index, this function returns the UID of the
233  // of the last visible frame.
234 
235 
240  virtual IDocumentPresentation* GetDocWindow(IDataBase* dataBase) = 0;
241  // With a given database, return the front document window (the first in the
242  // IPresentationList order). $$$ This will NOT work in the multiple views of the
243  // same document case because it gives us the first in the list. Since Note
244  // is not required of InDesign, this will work fine in InCopy.
245 
246 
254  virtual UID GetSpreadUID(ITextModel* textModel, TextIndex offset) = 0;
255 
256 
286  virtual UID GetSpreadUID(INoteData* noteData, ITextModel* textModel, TextIndex position) = 0;
287 
299  virtual bool16 InvisibleText(ITextModel* textModel, TextIndex index) = 0;
300 
308  virtual bool16 FindNoteStoryThread(ITextModel* textModel, UID noteDataUID, TextIndex* threadStart, int32* threadSpan) = 0;
309 
315  virtual WideString GetNoteContent(ITextModel* textModel, const UIDRef& noteRef) = 0;
316 
324  virtual ErrorCode ToggleAllNoteCollapse(ITextModel* textModel, UID currentNoteUID, bool16 newCollapseState, bool16 collapseAllButOne) = 0;
325 
326 
330  virtual void ClearAllNotes(IDocument* document) = 0;
331 
335  virtual void ClearAllNotes(ITextModel* textModel) = 0;
336 
339  virtual void DoDragDropNoteModel(UIDRef srcStoryRef, UIDRef targetStoryRef, TextIndex srcTextIndex, TextIndex targetTextIndex, bool16 duplicateNote, bool16 startOfDeletedText) = 0;
340 };
341 
342 #endif // __INOTEUTILS__