|
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 NAMESPACEDEF_H |
|
19 #define NAMESPACEDEF_H |
|
20 |
|
21 #include "qtbc.h" |
|
22 #include <qstrlist.h> |
|
23 #include <qdict.h> |
|
24 #include "sortdict.h" |
|
25 #include "definition.h" |
|
26 #include "memberlist.h" |
|
27 |
|
28 class ClassDef; |
|
29 class ClassList; |
|
30 class OutputList; |
|
31 class ClassSDict; |
|
32 class MemberDef; |
|
33 class NamespaceList; |
|
34 class MemberGroupSDict; |
|
35 class NamespaceSDict; |
|
36 |
|
37 class NamespaceDef : public Definition |
|
38 { |
|
39 public: |
|
40 NamespaceDef(const char *defFileName,int defLine, |
|
41 const char *name,const char *ref=0, |
|
42 const char *refFile=0); |
|
43 ~NamespaceDef(); |
|
44 DefType definitionType() const { return TypeNamespace; } |
|
45 QCString getOutputFileBase() const; |
|
46 void insertUsedFile(const char *fname); |
|
47 |
|
48 void writeDocumentation(OutputList &ol); |
|
49 void writeMemberPages(OutputList &ol); |
|
50 void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; |
|
51 |
|
52 void insertClass(ClassDef *cd); |
|
53 void insertNamespace(NamespaceDef *nd); |
|
54 void insertMember(MemberDef *md); |
|
55 |
|
56 void computeAnchors(); |
|
57 int countMembers(); |
|
58 void addUsingDirective(NamespaceDef *nd); |
|
59 NamespaceSDict *getUsedNamespaces() const; |
|
60 void addUsingDeclaration(Definition *def); |
|
61 SDict<Definition> *getUsedClasses() const { return usingDeclList; } |
|
62 void combineUsingRelations(); |
|
63 QCString displayName() const; |
|
64 |
|
65 bool isLinkableInProject() const; |
|
66 bool isLinkable() const; |
|
67 void addMembersToMemberGroup(); |
|
68 void distributeMemberGroupDocumentation(); |
|
69 void findSectionsInDocumentation(); |
|
70 |
|
71 virtual Definition *findInnerCompound(const char *name); |
|
72 void addInnerCompound(Definition *d); |
|
73 void addListReferences(); |
|
74 |
|
75 MemberList *getMemberList(MemberList::ListType lt) const; |
|
76 const QList<MemberList> &getMemberLists() const { return m_memberLists; } |
|
77 MemberDef *getMemberByName(const QCString &) const; |
|
78 |
|
79 /*! Returns the user defined member groups */ |
|
80 MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; } |
|
81 |
|
82 /*! Returns the classes contained in this namespace */ |
|
83 ClassSDict *getClassSDict() const { return classSDict; } |
|
84 |
|
85 /*! Returns the namespaces contained in this namespace */ |
|
86 NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; } |
|
87 |
|
88 bool visited; |
|
89 |
|
90 private: |
|
91 MemberList *createMemberList(MemberList::ListType lt); |
|
92 void addMemberToList(MemberList::ListType lt,MemberDef *md); |
|
93 void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title); |
|
94 void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title); |
|
95 void writeDetailedDescription(OutputList &ol,const QCString &title); |
|
96 void writeBriefDescription(OutputList &ol); |
|
97 void startMemberDeclarations(OutputList &ol); |
|
98 void endMemberDeclarations(OutputList &ol); |
|
99 void writeClassDeclarations(OutputList &ol,const QCString &title); |
|
100 void writeNamespaceDeclarations(OutputList &ol,const QCString &title); |
|
101 void writeMemberGroups(OutputList &ol); |
|
102 void writeAuthorSection(OutputList &ol); |
|
103 void startMemberDocumentation(OutputList &ol); |
|
104 void endMemberDocumentation(OutputList &ol); |
|
105 |
|
106 QCString fileName; |
|
107 QStrList files; |
|
108 |
|
109 NamespaceSDict *usingDirList; |
|
110 SDict<Definition> *usingDeclList; |
|
111 SDict<Definition> *m_innerCompounds; |
|
112 |
|
113 MemberSDict *m_allMembersDict; |
|
114 QList<MemberList> m_memberLists; |
|
115 MemberGroupSDict *memberGroupSDict; |
|
116 ClassSDict *classSDict; |
|
117 NamespaceSDict *namespaceSDict; |
|
118 bool m_subGrouping; |
|
119 }; |
|
120 |
|
121 class NamespaceList : public QList<NamespaceDef> |
|
122 { |
|
123 public: |
|
124 ~NamespaceList() {} |
|
125 int compareItems(GCI item1,GCI item2) |
|
126 { |
|
127 return stricmp(((NamespaceDef *)item1)->name(), |
|
128 ((NamespaceDef *)item2)->name() |
|
129 ); |
|
130 } |
|
131 }; |
|
132 |
|
133 class NamespaceListIterator : public QListIterator<NamespaceDef> |
|
134 { |
|
135 public: |
|
136 NamespaceListIterator(const NamespaceList &l) : |
|
137 QListIterator<NamespaceDef>(l) {} |
|
138 }; |
|
139 |
|
140 class NamespaceDict : public QDict<NamespaceDef> |
|
141 { |
|
142 public: |
|
143 NamespaceDict(int size) : QDict<NamespaceDef>(size) {} |
|
144 ~NamespaceDict() {} |
|
145 }; |
|
146 |
|
147 class NamespaceSDict : public SDict<NamespaceDef> |
|
148 { |
|
149 public: |
|
150 NamespaceSDict(int size=17) : SDict<NamespaceDef>(size) {} |
|
151 ~NamespaceSDict() {} |
|
152 int compareItems(GCI item1,GCI item2) |
|
153 { |
|
154 return stricmp(((NamespaceDef *)item1)->name(), |
|
155 ((NamespaceDef *)item2)->name() |
|
156 ); |
|
157 } |
|
158 void writeDeclaration(OutputList &ol,const char *title,bool localName=FALSE); |
|
159 }; |
|
160 |
|
161 |
|
162 |
|
163 #endif |