InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IndexTopicEntryNode.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: Data class to carry one Index Topic entry node.
24 //
25 //========================================================================================
26 
27 #ifndef __INDEXTOPICENTRYNODE__
28 #define __INDEXTOPICENTRYNODE__
29 
30 #include "WideString.h"
31 #include "LanguageID.h"
32 #ifdef qME
33 #include "IIndexHeaderSet.h"
34 #include "PreferenceUtils.h"
35 #endif
36 
44 {
45  public:
46  typedef object_type data_type;
47 
50 #ifdef qME
52  fLevel()
53  {
54  InterfacePtr<const IIndexHeaderSet> pPrefsTopicListHeaderSet((IIndexHeaderSet*)::QuerySessionPreferences(IID_IINDEXHEADERSET));
55  fLanguage = pPrefsTopicListHeaderSet->GetLanguageID();
56  }
57 #else
59  fLevel(),
60  fLanguage(kLanguageUserDefault)
61  {}
62 #endif
63 
66  bool16 operator==(const IndexTopicEntryNode& other) const
67  {
68  // We don't compare fIndexEntryList
69  return ( (fLevel == other.fLevel) &&
70  (fDisplayString == other.fDisplayString) &&
71  (fSortString == other.fSortString) &&
72  (fLanguage == other.fLanguage));
73  }
74 
78  {
79  if (this != &other)
80  {
81  fLevel = other.fLevel;
82  fDisplayString = other.fDisplayString;
83  fSortString = other.fSortString;
84  fLanguage = other.fLanguage;
85  }
86  return *this;
87  }
88 
92  const WideString& GetSortString() const
93  {
94  return (fSortString.Length() != 0 ? fSortString : fDisplayString);
95  }
96 
100  const LanguageID& GetSortLanguage() const
101  {
102  return fLanguage;
103  }
104 
108  const int16 & GetLevel() const { return fLevel;} ;
109 
113  int16 & GetLevel() { return fLevel;} ;
114 
118  WideString & GetDisplayString() {return fDisplayString;} ;
119 
123  const WideString & GetDisplayString() const {return fDisplayString;} ;
124 
128  LanguageID & GetLanguage() {return fLanguage;} ;
129 
133  const LanguageID & GetLanguage() const { return fLanguage;};
134 
138  WideString & GetSortStringReference() {return fSortString;};
139 
143  const WideString & GetSortStringReference() const {return fSortString;};
144 
145 protected:
146  int16 fLevel; // Level of the Node
147  WideString fDisplayString; // String used to display the topic
148  WideString fSortString; // String used to sort the topic
149  LanguageID fLanguage; // Language of topic
150 };
151 
152 #endif // __INDEXTOPICENTRYNODE__