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();
82 bool subGrouping() const { return m_subGrouping; }
84 bool visited; // number of times accessed for output - KPW
86 //friend void writeGroupTreeNode(OutputList&, GroupDef*, int, FTVHelp*);
87 // make accessible for writing tree view of group in index.cpp - KPW
89 void setGroupScope(Definition *d) { groupScope = d; }
90 Definition *getGroupScope() const { return groupScope; }
92 MemberList *getMemberList(MemberListType lt) const;
93 const QList<MemberList> &getMemberLists() const { return m_memberLists; }
95 /* user defined member groups */
96 MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
98 FileList * getFiles() const { return fileList; }
99 ClassSDict * getClasses() const { return classSDict; }
100 NamespaceSDict * getNamespaces() const { return namespaceSDict; }
101 GroupList * getSubGroups() const { return groupList; }
102 PageSDict * getPages() const { return pageDict; }
103 DirList * getDirs() const { return dirList; }
104 PageSDict * getExamples() const { return exampleDict; }
105 bool hasDetailedDescription() const;
106 //MemberList* getMembers() const { return allMemberList; }
107 void sortSubGroups();
110 void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
113 MemberList *createMemberList(MemberListType lt);
114 void addMemberToList(MemberListType lt,MemberDef *md);
115 void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
116 void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title);
117 void removeMemberFromList(MemberListType lt,MemberDef *md);
118 void writeGroupGraph(OutputList &ol);
119 void writeFiles(OutputList &ol,const QCString &title);
120 void writeNamespaces(OutputList &ol,const QCString &title);
121 void writeNestedGroups(OutputList &ol,const QCString &title);
122 void writeDirs(OutputList &ol,const QCString &title);
123 void writeClasses(OutputList &ol,const QCString &title);
124 void writeInlineClasses(OutputList &ol);
125 void writePageDocumentation(OutputList &ol);
126 void writeDetailedDescription(OutputList &ol,const QCString &title);
127 void writeBriefDescription(OutputList &ol);
128 void writeMemberGroups(OutputList &ol);
129 void startMemberDeclarations(OutputList &ol);
130 void endMemberDeclarations(OutputList &ol);
131 void startMemberDocumentation(OutputList &ol);
132 void endMemberDocumentation(OutputList &ol);
133 void writeAuthorSection(OutputList &ol);
134 void writeSummaryLinks(OutputList &ol);
135 void updateLanguage(const Definition *);
137 QCString title; // title of the group
138 bool titleSet; // true if title is not the same as the name
139 QCString fileName; // base name of the generated file
140 FileList *fileList; // list of files in the group
141 ClassSDict *classSDict; // list of classes in the group
142 NamespaceSDict *namespaceSDict; // list of namespaces in the group
143 GroupList *groupList; // list of sub groups.
144 PageSDict *pageDict; // list of pages in the group
145 PageSDict *exampleDict; // list of examples in the group
146 DirList *dirList; // list of directories in the group
148 MemberList *allMemberList;
149 MemberNameInfoSDict *allMemberNameInfoSDict;
151 Definition *groupScope;
153 QList<MemberList> m_memberLists;
154 MemberGroupSDict *memberGroupSDict;
159 /** A sorted dictionary of GroupDef objects. */
160 class GroupSDict : public SDict<GroupDef>
163 GroupSDict(uint size) : SDict<GroupDef>(size) {}
164 virtual ~GroupSDict() {}
166 int compareValues(const GroupDef *item1,const GroupDef *item2) const
168 return qstrcmp(item1->groupTitle(),item2->groupTitle());
172 /** A list of GroupDef objects. */
173 class GroupList : public QList<GroupDef>
176 int compareValues(const GroupDef *item1,const GroupDef *item2) const
178 return qstrcmp(item1->groupTitle(),item2->groupTitle());
182 /** An iterator for GroupDef objects in a GroupList. */
183 class GroupListIterator : public QListIterator<GroupDef>
186 GroupListIterator(const GroupList &l) : QListIterator<GroupDef>(l) {}
187 virtual ~GroupListIterator() {}
190 void addClassToGroups(Entry *root,ClassDef *cd);
191 void addNamespaceToGroups(Entry *root,NamespaceDef *nd);
192 void addGroupToGroups(Entry *root,GroupDef *subGroup);
193 void addMemberToGroups(Entry *root,MemberDef *md);
194 void addPageToGroups(Entry *root,PageDef *pd);
195 void addExampleToGroups(Entry *root,PageDef *eg);
196 void addDirToGroups(Entry *root,DirDef *dd);