|
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 GROUPDEF_H |
|
19 #define GROUPDEF_H |
|
20 |
|
21 #include "qtbc.h" |
|
22 #include "sortdict.h" |
|
23 #include "definition.h" |
|
24 #include "memberlist.h" |
|
25 #include "memberdef.h" |
|
26 #include "htmlhelp.h" |
|
27 |
|
28 class FileList; |
|
29 class ClassSDict; |
|
30 class FileDef; |
|
31 class ClassDef; |
|
32 class NamespaceDef; |
|
33 class GroupList; |
|
34 class OutputList; |
|
35 class NamespaceSDict; |
|
36 class MemberGroupSDict; |
|
37 class MemberNameInfoSDict; |
|
38 class PageSDict; |
|
39 class PageDef; |
|
40 class DirDef; |
|
41 class DirList; |
|
42 class FTVHelp; |
|
43 |
|
44 class GroupDef : public Definition |
|
45 { |
|
46 public: |
|
47 GroupDef(const char *fileName,int line,const char *name,const char *title,const char *refFileName=0); |
|
48 ~GroupDef(); |
|
49 DefType definitionType() const { return TypeGroup; } |
|
50 QCString getOutputFileBase() const; |
|
51 const char *groupTitle() const { return title; } |
|
52 void setGroupTitle( const char *newtitle ); |
|
53 bool hasGroupTitle( ) { return titleSet; } |
|
54 void addFile(const FileDef *def); |
|
55 bool addClass(const ClassDef *def); |
|
56 bool addNamespace(const NamespaceDef *def); |
|
57 void addGroup(const GroupDef *def); |
|
58 void addParentGroup(const GroupDef *def); |
|
59 void addPage(PageDef *def); |
|
60 void addExample(const PageDef *def); |
|
61 void addDir(const DirDef *dd); |
|
62 bool insertMember(MemberDef *def,bool docOnly=FALSE); |
|
63 void removeMember(MemberDef *md); |
|
64 bool containsGroup(const GroupDef *def); // true if def is already a subgroup |
|
65 void writeDocumentation(OutputList &ol); |
|
66 void writeMemberPages(OutputList &ol); |
|
67 void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; |
|
68 int countMembers() const; |
|
69 bool isLinkableInProject() const |
|
70 { |
|
71 return !isReference(); |
|
72 } |
|
73 bool isLinkable() const |
|
74 { |
|
75 return TRUE; |
|
76 } |
|
77 bool isASubGroup() const; |
|
78 void computeAnchors(); |
|
79 |
|
80 void addMembersToMemberGroup(); |
|
81 void distributeMemberGroupDocumentation(); |
|
82 void findSectionsInDocumentation(); |
|
83 |
|
84 void addListReferences(); |
|
85 |
|
86 bool visited; // number of times accessed for output - KPW |
|
87 |
|
88 friend void writeGroupTreeNode(OutputList&, GroupDef*, int, FTVHelp*); |
|
89 // make accessible for writing tree view of group in index.cpp - KPW |
|
90 |
|
91 void setGroupScope(Definition *d) { groupScope = d; } |
|
92 Definition *getGroupScope() const { return groupScope; } |
|
93 |
|
94 MemberList *getMemberList(MemberList::ListType lt) const; |
|
95 const QList<MemberList> &getMemberLists() const { return m_memberLists; } |
|
96 |
|
97 /* user defined member groups */ |
|
98 MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; } |
|
99 |
|
100 FileList * getFiles() const { return fileList; } |
|
101 ClassSDict * getClasses() const { return classSDict; } |
|
102 NamespaceSDict * getNamespaces() const { return namespaceSDict; } |
|
103 GroupList * getSubGroups() const { return groupList; } |
|
104 PageSDict * getPages() const { return pageDict; } |
|
105 DirList * getDirs() const { return dirList; } |
|
106 //MemberList* getMembers() const { return allMemberList; } |
|
107 |
|
108 protected: |
|
109 void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); |
|
110 |
|
111 private: |
|
112 MemberList *createMemberList(MemberList::ListType lt); |
|
113 void addMemberToList(MemberList::ListType lt,MemberDef *md); |
|
114 void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title); |
|
115 void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title); |
|
116 void removeMemberFromList(MemberList::ListType lt,MemberDef *md); |
|
117 void writeGroupGraph(OutputList &ol); |
|
118 void writeFiles(OutputList &ol,const QCString &title); |
|
119 void writeNamespaces(OutputList &ol,const QCString &title); |
|
120 void writeNestedGroups(OutputList &ol,const QCString &title); |
|
121 void writeDirs(OutputList &ol,const QCString &title); |
|
122 void writeClasses(OutputList &ol,const QCString &title); |
|
123 void writePageDocumentation(OutputList &ol); |
|
124 void writeDetailedDescription(OutputList &ol,const QCString &title); |
|
125 void writeBriefDescription(OutputList &ol); |
|
126 void writeMemberGroups(OutputList &ol); |
|
127 void startMemberDeclarations(OutputList &ol); |
|
128 void endMemberDeclarations(OutputList &ol); |
|
129 void startMemberDocumentation(OutputList &ol); |
|
130 void endMemberDocumentation(OutputList &ol); |
|
131 void writeAuthorSection(OutputList &ol); |
|
132 |
|
133 QCString title; // title of the group |
|
134 bool titleSet; // true if title is not the same as the name |
|
135 QCString fileName; // base name of the generated file |
|
136 FileList *fileList; // list of files in the group |
|
137 ClassSDict *classSDict; // list of classes in the group |
|
138 NamespaceSDict *namespaceSDict; // list of namespaces in the group |
|
139 GroupList *groupList; // list of sub groups. |
|
140 PageSDict *pageDict; // list of pages in the group |
|
141 PageSDict *exampleDict; // list of examples in the group |
|
142 DirList *dirList; // list of directories in the group |
|
143 |
|
144 MemberList *allMemberList; |
|
145 MemberNameInfoSDict *allMemberNameInfoSDict; |
|
146 |
|
147 Definition *groupScope; |
|
148 |
|
149 QList<MemberList> m_memberLists; |
|
150 MemberGroupSDict *memberGroupSDict; |
|
151 |
|
152 }; |
|
153 |
|
154 class GroupSDict : public SDict<GroupDef> |
|
155 { |
|
156 public: |
|
157 GroupSDict(uint size) : SDict<GroupDef>(size) {} |
|
158 virtual ~GroupSDict() {} |
|
159 int compareItems(GCI item1,GCI item2) |
|
160 { |
|
161 return strcmp(((GroupDef*)item1)->groupTitle(),((GroupDef*)item2)->groupTitle()); |
|
162 } |
|
163 }; |
|
164 |
|
165 class GroupList : public QList<GroupDef> |
|
166 { |
|
167 public: |
|
168 int compareItems(GCI item1,GCI item2) |
|
169 { |
|
170 return strcmp(((GroupDef*)item1)->groupTitle(),((GroupDef*)item2)->groupTitle()); |
|
171 } |
|
172 }; |
|
173 |
|
174 class GroupListIterator : public QListIterator<GroupDef> |
|
175 { |
|
176 public: |
|
177 GroupListIterator(const GroupList &l) : QListIterator<GroupDef>(l) {} |
|
178 virtual ~GroupListIterator() {} |
|
179 }; |
|
180 |
|
181 void addClassToGroups(Entry *root,ClassDef *cd); |
|
182 void addNamespaceToGroups(Entry *root,NamespaceDef *nd); |
|
183 void addGroupToGroups(Entry *root,GroupDef *subGroup); |
|
184 void addMemberToGroups(Entry *root,MemberDef *md); |
|
185 void addPageToGroups(Entry *root,PageDef *pd); |
|
186 void addExampleToGroups(Entry *root,PageDef *eg); |
|
187 void addDirToGroups(Entry *root,DirDef *dd); |
|
188 |
|
189 #endif |
|
190 |