groupdef.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 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 "sortdict.h"
22 #include "definition.h"
23 
24 class MemberList;
25 class FileList;
26 class ClassSDict;
27 class FileDef;
28 class ClassDef;
29 class NamespaceDef;
30 class GroupList;
31 class OutputList;
32 class NamespaceSDict;
33 class MemberGroupSDict;
35 class PageSDict;
36 class PageDef;
37 class DirDef;
38 class DirList;
39 class FTVHelp;
40 class Entry;
41 class MemberDef;
42 class FTextStream;
43 
44 /** A model of a group of symbols. */
45 class GroupDef : public Definition
46 {
47  public:
48  GroupDef(const char *fileName,int line,const char *name,const char *title,const char *refFileName=0);
49  ~GroupDef();
50  DefType definitionType() const { return TypeGroup; }
52  QCString anchor() const { return QCString(); }
53  QCString displayName(bool=TRUE) const { return hasGroupTitle() ? title : Definition::name(); }
54  const char *groupTitle() const { return title; }
55  void setGroupTitle( const char *newtitle );
56  bool hasGroupTitle( ) const { return titleSet; }
57  void addFile(const FileDef *def);
58  bool addClass(const ClassDef *def);
59  bool addNamespace(const NamespaceDef *def);
60  void addGroup(const GroupDef *def);
61  void addParentGroup(const GroupDef *def);
62  void addPage(PageDef *def);
63  void addExample(const PageDef *def);
64  void addDir(const DirDef *dd);
65  bool insertMember(MemberDef *def,bool docOnly=FALSE);
66  void removeMember(MemberDef *md);
67  bool findGroup(const GroupDef *def) const; // true if def is a subgroup of this group
69  void writeMemberPages(OutputList &ol);
70  void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const;
71  void writeTagFile(FTextStream &);
72  int countMembers() const;
73  bool isLinkableInProject() const;
74  bool isLinkable() const;
75  bool isASubGroup() const;
76  void computeAnchors();
77 
81 
82  void addListReferences();
83  void sortMemberLists();
84  bool subGrouping() const { return m_subGrouping; }
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 
92  Definition *getGroupScope() const { return groupScope; }
93 
95  const QList<MemberList> &getMemberLists() const { return m_memberLists; }
96 
97  /* user defined member groups */
99 
100  FileList * getFiles() const { return fileList; }
101  ClassSDict * getClasses() const { return classSDict; }
103  GroupList * getSubGroups() const { return groupList; }
104  PageSDict * getPages() const { return pageDict; }
105  DirList * getDirs() const { return dirList; }
106  PageSDict * getExamples() const { return exampleDict; }
107  bool hasDetailedDescription() const;
108  //MemberList* getMembers() const { return allMemberList; }
109  void sortSubGroups();
110 
111  protected:
112  void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
113 
114  private:
117  void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
120  void writeGroupGraph(OutputList &ol);
121  void writeFiles(OutputList &ol,const QCString &title);
122  void writeNamespaces(OutputList &ol,const QCString &title);
123  void writeNestedGroups(OutputList &ol,const QCString &title);
124  void writeDirs(OutputList &ol,const QCString &title);
125  void writeClasses(OutputList &ol,const QCString &title);
126  void writeInlineClasses(OutputList &ol);
128  void writeDetailedDescription(OutputList &ol,const QCString &title);
130  void writeMemberGroups(OutputList &ol);
135  void writeAuthorSection(OutputList &ol);
136  void writeSummaryLinks(OutputList &ol);
137  void updateLanguage(const Definition *);
138 
139  QCString title; // title of the group
140  bool titleSet; // true if title is not the same as the name
141  QCString fileName; // base name of the generated file
142  FileList *fileList; // list of files in the group
143  ClassSDict *classSDict; // list of classes in the group
144  NamespaceSDict *namespaceSDict; // list of namespaces in the group
145  GroupList *groupList; // list of sub groups.
146  PageSDict *pageDict; // list of pages in the group
147  PageSDict *exampleDict; // list of examples in the group
148  DirList *dirList; // list of directories in the group
149 
152 
154 
158 
159 };
160 
161 /** A sorted dictionary of GroupDef objects. */
162 class GroupSDict : public SDict<GroupDef>
163 {
164  public:
166  virtual ~GroupSDict() {}
167  private:
168  int compareValues(const GroupDef *item1,const GroupDef *item2) const
169  {
170  return qstrcmp(item1->groupTitle(),item2->groupTitle());
171  }
172 };
173 
174 /** A list of GroupDef objects. */
175 class GroupList : public QList<GroupDef>
176 {
177  public:
178  int compareValues(const GroupDef *item1,const GroupDef *item2) const
179  {
180  return qstrcmp(item1->groupTitle(),item2->groupTitle());
181  }
182 };
183 
184 /** An iterator for GroupDef objects in a GroupList. */
185 class GroupListIterator : public QListIterator<GroupDef>
186 {
187  public:
189  virtual ~GroupListIterator() {}
190 };
191 
192 void addClassToGroups(Entry *root,ClassDef *cd);
193 void addNamespaceToGroups(Entry *root,NamespaceDef *nd);
194 void addGroupToGroups(Entry *root,GroupDef *subGroup);
195 void addMemberToGroups(Entry *root,MemberDef *md);
196 void addPageToGroups(Entry *root,PageDef *pd);
197 void addExampleToGroups(Entry *root,PageDef *eg);
198 void addDirToGroups(Entry *root,DirDef *dd);
199 
200 #endif
201 
void writeMemberPages(OutputList &ol)
Definition: groupdef.cpp:1245
void writeFiles(OutputList &ol, const QCString &title)
Definition: groupdef.cpp:814
virtual ~GroupListIterator()
Definition: groupdef.h:189
void addPageToGroups(Entry *root, PageDef *pd)
bool isLinkable() const
Definition: groupdef.cpp:1645
MemberGroupSDict * getMemberGroupSDict() const
Definition: groupdef.h:98
NamespaceSDict * namespaceSDict
Definition: groupdef.h:144
ClassSDict * classSDict
Definition: groupdef.h:143
bool visited
Definition: groupdef.h:86
bool m_subGrouping
Definition: groupdef.h:157
void writePageDocumentation(OutputList &ol)
Definition: groupdef.cpp:946
void addExampleToGroups(Entry *root, PageDef *eg)
Definition: groupdef.cpp:1496
DirList * dirList
Definition: groupdef.h:148
Definition: entry.h:63
void writeGroupGraph(OutputList &ol)
Definition: groupdef.cpp:794
MemberList * createMemberList(MemberListType lt)
Definition: groupdef.cpp:1553
QCString fileName
Definition: groupdef.h:141
void findSectionsInDocumentation()
Definition: groupdef.cpp:117
bool isLinkableInProject() const
Definition: groupdef.cpp:1640
const bool FALSE
Definition: qglobal.h:370
void startMemberDeclarations(OutputList &ol)
Definition: groupdef.cpp:985
void distributeMemberGroupDocumentation()
Definition: groupdef.cpp:107
int countMembers() const
Definition: groupdef.cpp:547
void addMemberToGroups(Entry *root, MemberDef *md)
Definition: groupdef.cpp:1390
void addDir(const DirDef *dd)
Definition: groupdef.cpp:213
void writeMemberGroups(OutputList &ol)
Definition: groupdef.cpp:969
bool isASubGroup() const
Definition: groupdef.cpp:541
void writeNamespaces(OutputList &ol, const QCString &title)
Definition: groupdef.cpp:846
void writeDirs(OutputList &ol, const QCString &title)
Definition: groupdef.cpp:902
void setGroupScope(Definition *d)
Definition: groupdef.h:91
bool addClass(const ClassDef *def)
Definition: groupdef.cpp:149
GroupSDict(uint size)
Definition: groupdef.h:165
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
void writeInlineClasses(OutputList &ol)
Definition: groupdef.cpp:941
bool titleSet
Definition: groupdef.h:140
PageSDict * getExamples() const
Definition: groupdef.h:106
void addMemberToList(MemberListType lt, MemberDef *md)
Definition: groupdef.cpp:1572
void removeMember(MemberDef *md)
Definition: groupdef.cpp:424
void setGroupTitle(const char *newtitle)
Definition: groupdef.cpp:91
const char * groupTitle() const
Definition: groupdef.h:54
MemberList * allMemberList
Definition: groupdef.h:150
static QStrList * l
Definition: config.cpp:1044
void startMemberDocumentation(OutputList &ol)
Definition: groupdef.cpp:995
ClassSDict * getClasses() const
Definition: groupdef.h:101
void writeClasses(OutputList &ol, const QCString &title)
Definition: groupdef.cpp:935
void addGroup(const GroupDef *def)
Definition: groupdef.cpp:532
void sortSubGroups()
Definition: groupdef.cpp:1635
GroupList * getSubGroups() const
Definition: groupdef.h:103
void addDirToGroups(Entry *root, DirDef *dd)
Definition: groupdef.cpp:1341
int compareValues(const GroupDef *item1, const GroupDef *item2) const
Definition: groupdef.h:168
void writeDocumentation(OutputList &ol)
Definition: groupdef.cpp:1073
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
void addGroupToGroups(Entry *root, GroupDef *subGroup)
Definition: groupdef.cpp:1359
void writeDetailedDescription(OutputList &ol, const QCString &title)
Definition: groupdef.cpp:708
Definition: sortdict.h:73
void addParentGroup(const GroupDef *def)
const QCString & name() const
Definition: definition.h:114
Definition: dirdef.h:37
PageSDict * getPages() const
Definition: groupdef.h:104
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
Definition: groupdef.cpp:1623
void addMembersToMemberGroup()
Definition: groupdef.cpp:237
bool findGroup(const GroupDef *def) const
Definition: groupdef.cpp:511
bool subGrouping() const
Definition: groupdef.h:84
bool insertMember(MemberDef *def, bool docOnly=FALSE)
Definition: groupdef.cpp:259
NamespaceSDict * getNamespaces() const
Definition: groupdef.h:102
Definition * groupScope
Definition: groupdef.h:153
void addListReferences()
Definition: groupdef.cpp:1524
void writeSummaryLinks(OutputList &ol)
Definition: groupdef.cpp:1028
Definition: dirdef.h:44
GroupDef(const char *fileName, int line, const char *name, const char *title, const char *refFileName=0)
Definition: groupdef.cpp:46
QList< MemberList > m_memberLists
Definition: groupdef.h:155
void addPage(PageDef *def)
Definition: groupdef.cpp:222
int compareValues(const GroupDef *item1, const GroupDef *item2) const
Definition: groupdef.h:178
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
Definition: groupdef.cpp:1607
void addExample(const PageDef *def)
Definition: groupdef.cpp:230
PageSDict * exampleDict
Definition: groupdef.h:147
MemberGroupSDict * memberGroupSDict
Definition: groupdef.h:156
FileList * fileList
Definition: groupdef.h:142
void sortMemberLists()
Definition: groupdef.cpp:1583
bool hasDetailedDescription() const
Definition: groupdef.cpp:1660
~GroupDef()
Definition: groupdef.cpp:77
void writeTagFile(FTextStream &)
Definition: groupdef.cpp:565
void addFile(const FileDef *def)
Definition: groupdef.cpp:138
bool addNamespace(const NamespaceDef *def)
Definition: groupdef.cpp:197
void writeNestedGroups(OutputList &ol, const QCString &title)
Definition: groupdef.cpp:852
MemberList * getMemberList(MemberListType lt) const
Definition: groupdef.cpp:1593
Definition * getGroupScope() const
Definition: groupdef.h:92
A model of a page symbol.
Definition: pagedef.h:29
void line(double t, double *p, double &x, double &y, double &z)
PageSDict * pageDict
Definition: groupdef.h:146
MemberNameInfoSDict * allMemberNameInfoSDict
Definition: groupdef.h:151
FileList * getFiles() const
Definition: groupdef.h:100
void computeAnchors()
Definition: groupdef.cpp:559
MemberListType
Definition: types.h:104
GroupListIterator(const GroupList &l)
Definition: groupdef.h:188
void writeQuickMemberLinks(OutputList &ol, MemberDef *currentMd) const
Definition: groupdef.cpp:1263
void writeBriefDescription(OutputList &ol)
Definition: groupdef.cpp:763
void endMemberDeclarations(OutputList &ol)
Definition: groupdef.cpp:990
void removeMemberFromList(MemberListType lt, MemberDef *md)
Definition: groupdef.cpp:1629
void endMemberDocumentation(OutputList &ol)
Definition: groupdef.cpp:1006
QCString getOutputFileBase() const
Definition: groupdef.cpp:1512
QCString title
Definition: groupdef.h:139
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:95
QCString displayName(bool=TRUE) const
Definition: groupdef.h:53
unsigned uint
Definition: qglobal.h:351
void addMemberListToGroup(MemberList *, bool(MemberDef::*)() const)
bool hasGroupTitle() const
Definition: groupdef.h:56
void addNamespaceToGroups(Entry *root, NamespaceDef *nd)
Definition: groupdef.cpp:1324
DirList * getDirs() const
Definition: groupdef.h:105
GroupList * groupList
Definition: groupdef.h:145
QCString anchor() const
Definition: groupdef.h:52
virtual ~GroupSDict()
Definition: groupdef.h:166
const bool TRUE
Definition: qglobal.h:371
void addClassToGroups(Entry *root, ClassDef *cd)
Definition: groupdef.cpp:1306
void updateLanguage(const Definition *)
Definition: groupdef.cpp:1652
const QList< MemberList > & getMemberLists() const
Definition: groupdef.h:95
DefType definitionType() const
Definition: groupdef.h:50
void writeAuthorSection(OutputList &ol)
Definition: groupdef.cpp:1016