My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
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; }
51  QCString getOutputFileBase() const;
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);
118  void writeMemberDocumentation(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 
155  QList<MemberList> m_memberLists;
158 
159 };
160 
162 class GroupSDict : public SDict<GroupDef>
163 {
164  public:
165  GroupSDict(uint size) : SDict<GroupDef>(size) {}
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 
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 
185 class GroupListIterator : public QListIterator<GroupDef>
186 {
187  public:
188  GroupListIterator(const GroupList &l) : QListIterator<GroupDef>(l) {}
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