InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IndexTopicEntry.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 store one Index Topic entry (up to 4 Topic entry nodes).
24 //
25 //========================================================================================
26 
27 #ifndef __INDEXTOPICENTRY__
28 #define __INDEXTOPICENTRY__
29 
30 #include "IndexingID.h" // Needed for kIDXMaxTopicLevel
31 #include "IndexTopicEntryNode.h"
32 
33 class UIDRef;
34 
39 {
40  public:
41  typedef object_type data_type;
42 
46  fNumNodes(0)
47  {}
48 
54  {
55  fNumNodes = other.fNumNodes;
56  for (int32 i = 0; i < kIDXMaxTopicLevel; i++)
57  fNodes[i] = other.fNodes[i];
58  };
59 
62  bool16 operator==(const IndexTopicEntry& other) const
63  {
64  if (fNumNodes != other.fNumNodes)
65  return kFalse;
66 
67  for (int32 i = 0; i < fNumNodes; i++)
68  if (!(fNodes[i] == other.fNodes[i]))
69  return kFalse;
70 
71  return kTrue;
72  }
73 
77  {
78  if (this != &other)
79  {
80  fNumNodes = other.fNumNodes;
81  for (int32 i = 0; i < fNumNodes; i++)
82  fNodes[i] = other.fNodes[i];
83  }
84  return *this;
85  }
86 
90  const int16& GetNumNodes() const { return fNumNodes;} ;
91 
95  int16& GetNumNodes() { return fNumNodes;} ;
96 
101  IndexTopicEntryNode& GetTopicEntryNode(int16 number) {return fNodes[number];};
102 
107  const IndexTopicEntryNode& GetTopicEntryNode(int16 number) const {return fNodes[number];}
108 
109 protected:
110  int16 fNumNodes;
111  IndexTopicEntryNode fNodes[kIDXMaxTopicLevel]; // the IndexTopicEntryNodes
112 };
113 
114 #endif // __INDEXTOPICENTRY__