|
1 /****************************************************************************** |
|
2 * |
|
3 * |
|
4 * |
|
5 * Copyright (C) 1997-2008 by Dimitri van Heesch. |
|
6 * |
|
7 * Permission to use, copy, modify, and distribute this software and its |
|
8 * documentation under the terms of the GNU General Public License is hereby |
|
9 * granted. No representations are made about the suitability of this software |
|
10 * for any purpose. It is provided "as is" without express or implied warranty. |
|
11 * See the GNU General Public License for more details. |
|
12 * |
|
13 * Documents produced by Doxygen are derivative works derived from the |
|
14 * input used in their production; they are not affected by this license. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MEMBERLIST_H |
|
19 #define MEMBERLIST_H |
|
20 |
|
21 #include <qlist.h> |
|
22 #include "memberdef.h" |
|
23 #include "sortdict.h" |
|
24 |
|
25 class GroupDef; |
|
26 class MemberGroup; |
|
27 class MemberGroupList; |
|
28 class StorageIntf; |
|
29 |
|
30 class MemberList : public QList<MemberDef> |
|
31 { |
|
32 public: |
|
33 enum ListType |
|
34 { |
|
35 privateLists = 0x0800, |
|
36 detailedLists = 0x1000, |
|
37 declarationLists = 0x2000, |
|
38 documentationLists = 0x4000, |
|
39 |
|
40 pubMethods = 0, |
|
41 proMethods = 1, |
|
42 pacMethods = 2, |
|
43 priMethods = 3 + privateLists, |
|
44 pubStaticMethods = 4, |
|
45 proStaticMethods = 5, |
|
46 pacStaticMethods = 6, |
|
47 priStaticMethods = 7 + privateLists, |
|
48 pubSlots = 8, |
|
49 proSlots = 9, |
|
50 priSlots = 10 + privateLists, |
|
51 pubAttribs = 11, |
|
52 proAttribs = 12, |
|
53 pacAttribs = 13, |
|
54 priAttribs = 14 + privateLists, |
|
55 pubStaticAttribs = 15, |
|
56 proStaticAttribs = 16, |
|
57 pacStaticAttribs = 17, |
|
58 priStaticAttribs = 18 + privateLists, |
|
59 pubTypes = 19, |
|
60 proTypes = 20, |
|
61 pacTypes = 21, |
|
62 priTypes = 22 + privateLists, |
|
63 related = 23, |
|
64 signals = 24, |
|
65 friends = 25, |
|
66 dcopMethods = 26, |
|
67 properties = 27, |
|
68 events = 28, |
|
69 |
|
70 typedefMembers = 29 + detailedLists, |
|
71 enumMembers = 30 + detailedLists, |
|
72 enumValMembers = 31 + detailedLists, |
|
73 functionMembers = 32 + detailedLists, |
|
74 relatedMembers = 33 + detailedLists, |
|
75 variableMembers = 34 + detailedLists, |
|
76 propertyMembers = 35 + detailedLists, |
|
77 eventMembers = 36 + detailedLists, |
|
78 constructors = 37 + detailedLists, |
|
79 |
|
80 allMembersList = 38, |
|
81 |
|
82 decDefineMembers = 39 + declarationLists, |
|
83 decProtoMembers = 40 + declarationLists, |
|
84 decTypedefMembers = 41 + declarationLists, |
|
85 decEnumMembers = 42 + declarationLists, |
|
86 decFuncMembers = 43 + declarationLists, |
|
87 decVarMembers = 44 + declarationLists, |
|
88 decEnumValMembers = 45 + declarationLists, |
|
89 decPubSlotMembers = 46 + declarationLists, |
|
90 decProSlotMembers = 47 + declarationLists, |
|
91 decPriSlotMembers = 48 + declarationLists, |
|
92 decSignalMembers = 49 + declarationLists, |
|
93 decEventMembers = 50 + declarationLists, |
|
94 decFriendMembers = 51 + declarationLists, |
|
95 decPropMembers = 52 + declarationLists, |
|
96 |
|
97 docDefineMembers = 53 + documentationLists, |
|
98 docProtoMembers = 54 + documentationLists, |
|
99 docTypedefMembers = 55 + documentationLists, |
|
100 docEnumMembers = 56 + documentationLists, |
|
101 docFuncMembers = 57 + documentationLists, |
|
102 docVarMembers = 58 + documentationLists, |
|
103 docEnumValMembers = 59 + documentationLists, |
|
104 docPubSlotMembers = 60 + documentationLists, |
|
105 docProSlotMembers = 61 + documentationLists, |
|
106 docPriSlotMembers = 62 + documentationLists, |
|
107 docSignalMembers = 63 + documentationLists, |
|
108 docEventMembers = 64 + documentationLists, |
|
109 docFriendMembers = 65 + documentationLists, |
|
110 docPropMembers = 66 + documentationLists, |
|
111 |
|
112 redefinedBy = 67, |
|
113 enumFields = 68, |
|
114 memberGroup = 69 |
|
115 }; |
|
116 |
|
117 MemberList(); |
|
118 MemberList(ListType lt); |
|
119 ~MemberList(); |
|
120 ListType listType() const { return m_listType; } |
|
121 bool insert(uint index,const MemberDef *md); |
|
122 void inSort(const MemberDef *md); |
|
123 void append(const MemberDef *md); |
|
124 int compareItems(GCI item1,GCI item2); |
|
125 int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; } |
|
126 int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; } |
|
127 int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; } |
|
128 int enumValueCount() const { ASSERT(m_numDecMembers!=-1); return m_enumValCnt; } |
|
129 int typedefCount() const { ASSERT(m_numDecMembers!=-1); return m_typeCnt; } |
|
130 int protoCount() const { ASSERT(m_numDecMembers!=-1); return m_protoCnt; } |
|
131 int defineCount() const { ASSERT(m_numDecMembers!=-1); return m_defCnt; } |
|
132 int friendCount() const { ASSERT(m_numDecMembers!=-1); return m_friendCnt; } |
|
133 int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; } |
|
134 int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; } |
|
135 void countDecMembers(bool countEnumValues=FALSE); |
|
136 void countDocMembers(bool countEnumValues=FALSE); |
|
137 void writePlainDeclarations(OutputList &ol, |
|
138 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); |
|
139 void writeDeclarations(OutputList &ol, |
|
140 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, |
|
141 const char *title,const char *subtitle,bool showEnumValues=FALSE); |
|
142 void writeDocumentation(OutputList &ol,const char *scopeName, |
|
143 Definition *container,const char *title,bool showEnumValues=FALSE); |
|
144 void writeDocumentationPage(OutputList &ol, |
|
145 const char *scopeName, Definition *container); |
|
146 void addMemberGroup(MemberGroup *mg); |
|
147 void setInGroup(bool inGroup) { m_inGroup=inGroup; } |
|
148 void setInFile(bool inFile) { m_inFile=inFile; } |
|
149 void addListReferences(Definition *def); |
|
150 void findSectionsInDocumentation(); |
|
151 MemberGroupList *getMemberGroupList() const { return memberGroupList; } |
|
152 |
|
153 void marshal(StorageIntf *s); |
|
154 void unmarshal(StorageIntf *s); |
|
155 |
|
156 private: |
|
157 int m_varCnt; |
|
158 int m_funcCnt; |
|
159 int m_enumCnt; |
|
160 int m_enumValCnt; |
|
161 int m_typeCnt; |
|
162 int m_protoCnt; |
|
163 int m_defCnt; |
|
164 int m_friendCnt; |
|
165 int m_numDecMembers; // number of members in the brief part of the memberlist |
|
166 int m_numDocMembers; // number of members in the detailed part of the memberlist |
|
167 MemberGroupList *memberGroupList; |
|
168 bool m_inGroup; // is this list part of a group definition |
|
169 bool m_inFile; // is this list part of a file definition |
|
170 ListType m_listType; |
|
171 }; |
|
172 |
|
173 class MemberListIterator : public QListIterator<MemberDef> |
|
174 { |
|
175 public: |
|
176 MemberListIterator(const QList<MemberDef> &list); |
|
177 virtual ~MemberListIterator() {} |
|
178 }; |
|
179 |
|
180 class MemberDict : public QDict<MemberDef> |
|
181 { |
|
182 public: |
|
183 MemberDict(int size) : QDict<MemberDef>(size) {} |
|
184 virtual ~MemberDict() {} |
|
185 }; |
|
186 |
|
187 class MemberSDict : public SDict<MemberDef> |
|
188 { |
|
189 public: |
|
190 MemberSDict(int size=17) : SDict<MemberDef>(size) {} |
|
191 virtual ~MemberSDict() {} |
|
192 int compareItems(GCI item1,GCI item2); |
|
193 }; |
|
194 |
|
195 |
|
196 #endif |