1 /******************************************************************************
5 * Copyright (C) 1997-2014 by Dimitri van Heesch.
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.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
22 #include "definition.h"
33 class MemberGroupSDict;
34 class MemberNameInfoSDict;
43 /** A model of a group of symbols. */
44 class GroupDef : public Definition
47 GroupDef(const char *fileName,int line,const char *name,const char *title,const char *refFileName=0);
49 DefType definitionType() const { return TypeGroup; }
50 QCString getOutputFileBase() const;
51 QCString anchor() const { return QCString(); }
52 QCString displayName(bool=TRUE) const { return hasGroupTitle() ? title : Definition::name(); }
53 const char *groupTitle() const { return title; }
54 void setGroupTitle( const char *newtitle );
55 bool hasGroupTitle( ) const { return titleSet; }
56 void addFile(const FileDef *def);
57 bool addClass(const ClassDef *def);
58 bool addNamespace(const NamespaceDef *def);
59 void addGroup(const GroupDef *def);
60 void addParentGroup(const GroupDef *def);
61 void addPage(PageDef *def);
62 void addExample(const PageDef *def);
63 void addDir(const DirDef *dd);
64 bool insertMember(MemberDef *def,bool docOnly=FALSE);
65 void removeMember(MemberDef *md);
66 bool containsGroup(const GroupDef *def); // true if def is already a subgroup
67 void writeDocumentation(OutputList &ol);
68 void writeMemberPages(OutputList &ol);
69 void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const;
70 int countMembers() const;
71 bool isLinkableInProject() const;
72 bool isLinkable() const;
73 bool isASubGroup() const;
74 void computeAnchors();
76 void addMembersToMemberGroup();
77 void distributeMemberGroupDocumentation();
78 void findSectionsInDocumentation();
80 void addListReferences();
81 void sortMemberLists();
83 bool visited; // number of times accessed for output - KPW
85 //friend void writeGroupTreeNode(OutputList&, GroupDef*, int, FTVHelp*);
86 // make accessible for writing tree view of group in index.cpp - KPW
88 void setGroupScope(Definition *d) { groupScope = d; }
89 Definition *getGroupScope() const { return groupScope; }
91 MemberList *getMemberList(MemberListType lt) const;
92 const QList<MemberList> &getMemberLists() const { return m_memberLists; }
94 /* user defined member groups */
95 MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
97 FileList * getFiles() const { return fileList; }
98 ClassSDict * getClasses() const { return classSDict; }
99 NamespaceSDict * getNamespaces() const { return namespaceSDict; }
100 GroupList * getSubGroups() const { return groupList; }
101 PageSDict * getPages() const { return pageDict; }
102 DirList * getDirs() const { return dirList; }
103 PageSDict * getExamples() const { return exampleDict; }
104 //MemberList* getMembers() const { return allMemberList; }
105 void sortSubGroups();
108 void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
111 MemberList *createMemberList(MemberListType lt);
112 void addMemberToList(MemberListType lt,MemberDef *md);
113 void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
114 void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title);
115 void removeMemberFromList(MemberListType lt,MemberDef *md);
116 void writeGroupGraph(OutputList &ol);
117 void writeFiles(OutputList &ol,const QCString &title);
118 void writeNamespaces(OutputList &ol,const QCString &title);
119 void writeNestedGroups(OutputList &ol,const QCString &title);
120 void writeDirs(OutputList &ol,const QCString &title);
121 void writeClasses(OutputList &ol,const QCString &title);
122 void writeInlineClasses(OutputList &ol);
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 void writeSummaryLinks(OutputList &ol);
133 void updateLanguage(const Definition *);
135 QCString title; // title of the group
136 bool titleSet; // true if title is not the same as the name
137 QCString fileName; // base name of the generated file
138 FileList *fileList; // list of files in the group
139 ClassSDict *classSDict; // list of classes in the group
140 NamespaceSDict *namespaceSDict; // list of namespaces in the group
141 GroupList *groupList; // list of sub groups.
142 PageSDict *pageDict; // list of pages in the group
143 PageSDict *exampleDict; // list of examples in the group
144 DirList *dirList; // list of directories in the group
146 MemberList *allMemberList;
147 MemberNameInfoSDict *allMemberNameInfoSDict;
149 Definition *groupScope;
151 QList<MemberList> m_memberLists;
152 MemberGroupSDict *memberGroupSDict;
156 /** A sorted dictionary of GroupDef objects. */
157 class GroupSDict : public SDict<GroupDef>
160 GroupSDict(uint size) : SDict<GroupDef>(size) {}
161 virtual ~GroupSDict() {}
163 int compareValues(const GroupDef *item1,const GroupDef *item2) const
165 return qstrcmp(item1->groupTitle(),item2->groupTitle());
169 /** A list of GroupDef objects. */
170 class GroupList : public QList<GroupDef>
173 int compareValues(const GroupDef *item1,const GroupDef *item2) const
175 return qstrcmp(item1->groupTitle(),item2->groupTitle());
179 /** An iterator for GroupDef objects in a GroupList. */
180 class GroupListIterator : public QListIterator<GroupDef>
183 GroupListIterator(const GroupList &l) : QListIterator<GroupDef>(l) {}
184 virtual ~GroupListIterator() {}
187 void addClassToGroups(Entry *root,ClassDef *cd);
188 void addNamespaceToGroups(Entry *root,NamespaceDef *nd);
189 void addGroupToGroups(Entry *root,GroupDef *subGroup);
190 void addMemberToGroups(Entry *root,MemberDef *md);
191 void addPageToGroups(Entry *root,PageDef *pd);
192 void addExampleToGroups(Entry *root,PageDef *eg);
193 void addDirToGroups(Entry *root,DirDef *dd);