InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IIndexTopicList.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michel Hutinel
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 // Comments: This class keeps track of an Index Topic list on Session/Doc workspace.
24 //
25 //========================================================================================
26 
27 #ifndef __IINDEXTOPICLIST__
28 #define __IINDEXTOPICLIST__
29 
30 #include "IndexingID.h"
31 #include "IIndexPageEntryData.h"
32 #include "KeyValuePair.h"
33 
34 class PMString;
35 class WideString;
36 class IndexSectionHeader;
37 class IIndexHeaderSetOptions;
38 class IndexTopicEntry;
39 class UIDRef;
40 
41 //----------------------------------------------------------------
42 // IDXPageRangeData Class declaration
43 //----------------------------------------------------------------
45 {
46  public:
47  typedef object_type data_type;
49  fStartPageIndex(-1),
50  fEndPageIndex(-1),
51  fStartPageString(kNullString),
52  fEndPageString(kNullString),
53  fStartPageUseTCY(kTrue),
54  fEndPageUseTCY(kTrue),
55  fMarkerPlace(IIndexPageEntryData::kDummyValue),
56  fPageRangeType(IIndexPageEntryData::kNoPageRange),
57  fStyleUID(kInvalidUID),
58  fBookContentUID(kInvalidUID),
59  fPageEntryUIDRef(kInvalidUIDRef)
60  {}
61 
62  bool16 operator==(const IDXPageRangeData& other) const
63  {
64  return ( (fStartPageIndex == other.fStartPageIndex) &&
65  (fEndPageIndex == other.fEndPageIndex) &&
66  (fStartPageString == other.fStartPageString) &&
67  (fEndPageString == other.fEndPageString) &&
68  (fStartPageUseTCY == other.fStartPageUseTCY) &&
69  (fEndPageUseTCY == other.fEndPageUseTCY) &&
70  (fMarkerPlace == other.fMarkerPlace) &&
71  (fPageRangeType == other.fPageRangeType) &&
72  (fStyleUID == other.fStyleUID) &&
73  (fBookContentUID == other.fBookContentUID) );
74  }
75 
76  int32 fStartPageIndex;
77  int32 fEndPageIndex;
78  PMString fStartPageString;
79  PMString fEndPageString;
80  bool16 fStartPageUseTCY;
81  bool16 fEndPageUseTCY;
84  UID fStyleUID;
85  UID fBookContentUID;
86  UIDRef fPageEntryUIDRef;
87 };
88 
90 {
91  public:
92  typedef object_type data_type;
94  fSectionUID(kInvalidUID),
95  fNthNode(-1),
96  fNthEntry(-1)
97  {}
98  IDXPageRangeKey(const UID& sectionUID, const int32& nthNode, const int32& nthEntry):
99  fSectionUID(sectionUID),
100  fNthNode(nthNode),
101  fNthEntry(nthEntry)
102  {}
103  bool16 operator==(const IDXPageRangeKey& other) const
104  {
105  return ( (fSectionUID == other.fSectionUID) &&
106  (fNthNode == other.fNthNode) &&
107  (fNthEntry == other.fNthEntry) );
108  }
109 
110  UID fSectionUID;
111  int32 fNthNode;
112  int32 fNthEntry;
113 };
114 
116 
124 {
125  public:
126  enum { kDefaultIID = IID_IINDEXTOPICLIST };
127 
130  virtual bool16 IsModifiedWithoutAvailableHSHandler() const = 0;
131 
134  virtual void SetModifiedWithoutAvailableHSHandler(bool16 modified) = 0;
135 
139  virtual const int32 GetNumTopicSections() const = 0;
140 
144  virtual const int32 GetNumTopics() const = 0;
145 
149  virtual void AddTopicSection(UID indexUID) = 0;
150 
154  virtual void RemoveTopicSection(UID indexUID) = 0;
155 
158  virtual void ClearTopicSectionList() = 0;
159 
164  virtual const UID GetNthTopicSectionUID(int32 id) const = 0;
165 
170  virtual const int32 GetTopicSectionId(UID sectionUID) const = 0;
171 
177  virtual const IndexSectionHeader& GetNthTopicSectionHeader(int32 id) const = 0;
178 
185  virtual void AddIndexInstance(const UID indexUID) = 0;
186 
193  virtual void RemoveIndexInstance(const UID indexUID) = 0;
194 
201  virtual const int32 GetNumOfIndexInstances() const = 0;
202 
209  virtual const UID GetNthIndexInstance(int32 id) const = 0;
210 
217  virtual const UID FindIndexInstanceByName(const PMString& name) const = 0;
218 
227  virtual const int32 GetParentNodeId(int32 sectionId, int32 childNodeId) const = 0;
228 
236  virtual const int32 GetNumChildrenOfNode(int32 sectionId, int32 parentNodeId, bool16 excludeUnused = kFalse) const = 0;
237 
246  virtual const int32 GetNthChildNodeId(int32 sectionId, int32 parentNodeId, int32 nth, bool16 excludeUnused = kFalse) const = 0;
247 
256  virtual const int32 GetChildRank(int32 sectionId, int32 parentNodeId, int32 childNodeId, bool16 excludeUnused = kFalse) const = 0;
257 
265  virtual void GetDisplayString(int32 sectionId, int32 nodeId, WideString& string) const = 0;
266 
273  virtual const int32 GetNumPageEntriesOfNode(int32 sectionId, int32 nodeId) const = 0;
274 
282  virtual const int32 GetPageEntryRankInNode(int32 sectionId, int32 nodeId, UIDRef entryUIDRef) const = 0;
283 
291  virtual void GetNthPageEntryUIDRef(int32 sectionId, int32 nodeId, int32 nth, UIDRef& entryUIDRef) const = 0;
292 
299  virtual const int32 GetNumXRefEntriesOfNode(int32 sectionId, int32 nodeId) const = 0;
300 
308  virtual const UID GetNthXRefEntryUID(int32 sectionId, int32 nodeId, int32 nth) const = 0;
309 
317  virtual const UID GetXRefLinksUID(int32 sectionId, int32 nodeId) const = 0;
318 
327  virtual void GetRefedTopicNodeId(const UID xRefLinksUID, UID& sectionUID, int32& nodeId) const = 0;
328 
343  virtual void GetTopicEntry(int32 sectionId, int32 nodeId, IndexTopicEntry& topicEntry) const = 0;
344 
353  virtual bool16 TopicEntryIsUsed(int32 sectionId, int32 nodeId, bool16 includeChildren = kTrue) const = 0;
354 
367  virtual bool16 FindTopicEntryByDisplay(IndexTopicEntry& topicEntry,
368  int32 startSectionId = 0,
369  int32 startNodeId = 0,
370  int32* foundSectionId = NULL,
371  int32* foundNodeId = NULL,
372  bool16 caseSensitive = kTrue,
373  bool16 wholeWord = kTrue,
374  bool16 searchDir = kTrue) const = 0;
375 
388  virtual bool16 FindStringByDisplay(const WideString& str,
389  int32 startSectionId = 0,
390  int32 startNodeId = 0,
391  int32 startXRefId = 0,
392  int32* foundSectionId = NULL,
393  int32* foundNodeId = NULL,
394  int32* foundXRefId = NULL,
395  bool16 caseSensitive = kTrue,
396  bool16 wholeWord = kTrue,
397  bool16 searchDir = kTrue,
398  int32* currentSearchNum = NULL) const = 0;
399 
406  virtual bool16 FindPageEntrySectionUIDandNodeId(const UIDRef& pageEntryUIDRef, UID& sectionUID, int32& nodeId) const = 0;
407 
415  virtual bool16 FindTopicEntry(const IndexTopicEntry& topicEntry, UID* sectionUID, int32* nodeId) const = 0;
416 
417 
418  //-------------- For Internal Use Only -------------------------
419 
423  virtual void GetIndexPageRangeDataMap(IDXPageRangeDataMap& dataMap) const = 0;
424 
429  virtual void UpdateIndexPageRangeDataMap(const IDXPageRangeKey& pageRangeKey, const IDXPageRangeData& pageRangeData) = 0;
430 
435  virtual void SetIndexPageRangeData(const IDXPageRangeKey& pageRangeKey, const IDXPageRangeData& pageRangeData) = 0;
436 
439  virtual void ClearIndexPageRangeData() = 0;
440 
453  virtual int32 FindNumberOfStringMatchesByDisplay(const WideString& str,
454  int32 startSectionId = 0,
455  int32 startNodeId = 0,
456  int32 startXRefId = 0,
457  int32* foundSectionId = NULL,
458  int32* foundNodeId = NULL,
459  int32* foundXRefId = NULL,
460  bool16 caseSensitive = kTrue,
461  bool16 wholeWord = kTrue,
462  bool16 searchDir = kTrue) const = 0;
463 };
464 
465 #endif // __IINDEXTOPICLIST__