InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IIndexingHeaderSetMaster.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: mvogel
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 __IIndexingHeaderSetMaster__
25 #define __IIndexingHeaderSetMaster__
26 
27 #include "IPMUnknown.h"
28 #include "IndexingID.h"
29 #include <vector>
30 #include "IndexHeaderGroup.h"
31 
32 class IIndexHeaderSet;
33 class PMString;
34 
36 {
37 public:
38  typedef object_type data_type;
39 
42  HeaderRangeTypes() : fInclude(kFalse), fSelection(0) {}
43 
45  const PMString& headerRangeName,
46  const bool16& include,
47  const int32& selection,
48  const std::vector<IndexHeaderGroup> groupList):
49  fHeaderRangeName(headerRangeName),
50  fInclude(include),
51  fSelection(selection),
52  fGroupList(groupList) {}
53 
54  bool16 operator==(const HeaderRangeTypes& other) const
55  {
56  return ( (fHeaderRangeName == other.fHeaderRangeName) &&
57  (fInclude == other.fInclude) &&
58  (fSelection == other.fSelection) &&
59  (fGroupList == other.fGroupList) );
60  }
61 
62  void ReadWrite(IPMStream *s)
63  {
64  fHeaderRangeName.ReadWrite(s);
65  s->XferBool(fInclude);
66  s->XferInt32(fSelection);
67 
68  int32 numGroup = static_cast<int32>(fGroupList.size());
69 
70  s->XferInt32(numGroup);
71  if (s->IsReading())
72  {
73  fGroupList.clear();
74  fGroupList.reserve(numGroup);
75 
76  int32 i;
77  for (i = 0; i < numGroup; i++)
78  {
79  IndexHeaderGroup topicHeaderGroup;
80 
81  topicHeaderGroup.ReadWrite(s);
82 
83  fGroupList.push_back(topicHeaderGroup);
84  }
85  }
86  else
87  {
88  int32 i;
89  for (i = 0; i < numGroup; i++)
90  fGroupList[i].ReadWrite(s);
91  }
92 
93  }
94 
95  PMString fHeaderRangeName;
96  bool16 fInclude;
97  int32 fSelection;
98  std::vector<IndexHeaderGroup> fGroupList;
99 };
100 
107 {
108 public:
109  enum { kDefaultIID = IID_IINDEXINGHEADERSETMASTER };
110 
117  virtual int32 GetNumGroups() const = 0;
118 
126  virtual const PMString& GetNthGroupName(int32 nth) const = 0;
127 
136  virtual std::vector<PMString> GetNthGroupTypes(int32 nth) const = 0;
137 
145  virtual int32 GetNthGroupSelection(int32 nth) const = 0;
146 
154  virtual void SetNthGroupSelection(int32 nth, int32 selection) = 0;
155 
163  virtual bool16 GetNthInclude(int32 nth) const = 0;
164 
172  virtual void SetNthInclude(int32 nth, bool16 include) = 0;
173 
180  virtual void Move(int32 oldPos, int32 newPos) = 0;
181 
189  virtual void AddGroup(const IndexHeaderGroup &headerGroup, bool16 include = kTrue) = 0;
190 
196  virtual void BuildHeaderSet(IIndexHeaderSet* headerSet) const = 0;
197 
198  virtual void SetAllGroupInfo(const std::vector<HeaderRangeTypes>& headerRangeList) = 0;
199 
205  virtual void CopyData(IIndexingHeaderSetMaster *iTarget ) const = 0;
206 
207 
208  enum GroupOrder
209  {
210  kDefault = -1,
211  kSymbolLatin,
212  kSymbolNumbersLatinKana,
213  kKanaLatinNumbersSymbol,
214  kLatinNumbersSymbol,
215  kSymbolNumbersLatinKorean,
216  kSymbolNumbersPinYin,
217  kSymbolNumbersLatinHanziStrokes
218  ,kSymbolNumbersLatinME
219  ,kSymbolNumbersLatin /*WR_SymbolNumericAlphabet*/
220  ,kSymbolArabic /*WR_SymbolArabic*/
221  ,kSymbolNumbersArabic /*WR_SymbolNumericArabic*/
222  ,kSymbolNumbersArabicLatin /*WR_SymbolNumericArabicAlphabet*/
223  ,kSymbolNumbersLatinArabic /*WR_SymbolNumericAlphabetArabic*/
224  ,kSymbolHebrew /*WR_SymbolHebrew*/
225  ,kSymbolNumbersHebrew /*WR_SymbolNumericHebrew*/
226  ,kSymbolNumbersHebrewLatin /*WR_SymbolNumericHebrewAlphabet*/
227  ,kSymbolNumbersLatinHebrew /*WR_SymbolNumericAlphabetHebrew*/
228  };
235  virtual void SetDefault(GroupOrder order = kDefault) = 0;
236 };
237 
238 #endif // __IIndexingHeaderSetMaster__