InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
INoteDataUtils.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 __INOTEDATAUTILS__
25 #define __INOTEDATAUTILS__
26 
27 #include "NoteID.h"
28 #include "INoteDataUtils.h"
29 #include "IPMUnknown.h"
30 #include "UIDList.h"
31 #include "RangeData.h"
32 #include "ITextModel.h"
33 //#include "INoteMarkerRange.h"
34 
35 //-----------------------------------
36 // Forward References
37 //
38 class INoteChangePrefs;
39 class WideString;
40 class IDocument;
41 class IControlView;
42 class ITextLines;
43 class ITextRuns;
44 
47 class INoteDataUtils : public IPMUnknown
48 {
49 public:
50  enum { kDefaultIID = IID_INOTEDATAUTILS };
52  enum Note_Type { kBookEnd, kNoteContent, kHitTestStoryText, kHitDeletedText };
53 
60  virtual int32 GetPageNumberOfTextIndex(TextIndex anchorPos, ITextModel* textModel, PMString * pageString = nil) = 0;
61 
67  virtual void GetNoteNumber(UIDRef storyRef, UID noteDataUID, int32& currentNoteNumber) const = 0;
68 
69 
75  virtual int32 GetStoryNoteCount(UIDRef storyRef, int32& totalStoryNoteCount) const = 0;
76 
84  virtual int32 CountWords(ITextModel* textModel, TextIndex begin, TextIndex end, int32 *charCount = nil) = 0;
85 
86 
92  virtual bool16 IsWordBreak(const UTF32TextChar& currChar) = 0;
93 
99  virtual bool16 IsPunctuation(const UTF32TextChar& currChar) = 0;
100 
110  virtual UIDRef NewNote(TextIndex createAt, UIDRef storyRef, UIDRef docRef) = 0;
111 
118  virtual int32 GetNoteColorIndex(UIDRef docRef, const WideString& userName) const = 0;
119 
126  virtual int32 GetNoteColorIndex(IDataBase* docDataBase, const WideString& userName) const = 0;
127 
128 
134  virtual int32 GetNoteBGColorIndex(UIDRef docRef, const WideString& userName) const = 0;
135 
142  virtual int32 GetNoteBGColorIndex(IDataBase* docDataBase, const WideString& userName) const = 0;
143 
160  virtual bool16 DetectInlineNoteData(IControlView* writingView, const SysPoint globalPoint,
161  bool16* bIsCollapsed, int16* typeFound,
162  int32* originalStoryIndex, int32* activeStoryIndex,
163  int32* pLineIndex = 0, int32* pOffsetIntoLine = 0) const = 0;
164 
169  virtual bool16 IsNoteOwnedItem(ClassID id) = 0;
170 
177  virtual void SetupOwnedItemInfo(UIDRef textModelRef, TextIndex textIndex, ClassID ownedItemClass, UID ownedItemUID) = 0;
178 };
179 
180 #endif // __INOTEDATAUTILS__