00001 /****************************************************************************** 00002 * 00003 * $Id: namespacedef.h,v 1.18 2001/03/19 19:27:41 root Exp $ 00004 * 00005 * Copyright (C) 1997-2008 by Dimitri van Heesch. 00006 * 00007 * Permission to use, copy, modify, and distribute this software and its 00008 * documentation under the terms of the GNU General Public License is hereby 00009 * granted. No representations are made about the suitability of this software 00010 * for any purpose. It is provided "as is" without express or implied warranty. 00011 * See the GNU General Public License for more details. 00012 * 00013 * Documents produced by Doxygen are derivative works derived from the 00014 * input used in their production; they are not affected by this license. 00015 * 00016 */ 00017 00018 #ifndef NAMESPACEDEF_H 00019 #define NAMESPACEDEF_H 00020 00021 #include "qtbc.h" 00022 #include <qstrlist.h> 00023 #include <qdict.h> 00024 #include "sortdict.h" 00025 #include "definition.h" 00026 #include "memberlist.h" 00027 00028 class ClassDef; 00029 class ClassList; 00030 class OutputList; 00031 class ClassSDict; 00032 class MemberDef; 00033 class NamespaceList; 00034 class MemberGroupSDict; 00035 class NamespaceSDict; 00036 00037 class NamespaceDef : public Definition 00038 { 00039 public: 00040 NamespaceDef(const char *defFileName,int defLine, 00041 const char *name,const char *ref=0, 00042 const char *refFile=0); 00043 ~NamespaceDef(); 00044 DefType definitionType() const { return TypeNamespace; } 00045 QCString getOutputFileBase() const; 00046 void insertUsedFile(const char *fname); 00047 00048 void writeDetailedDocumentation(OutputList &ol); 00049 void writeDocumentation(OutputList &ol); 00050 void writeMemberDocumentation(OutputList &ol); 00051 void writeMemberPages(OutputList &ol); 00052 void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; 00053 00054 void insertClass(ClassDef *cd); 00055 void insertNamespace(NamespaceDef *nd); 00056 void insertMember(MemberDef *md); 00057 00058 void computeAnchors(); 00059 int countMembers(); 00060 void addUsingDirective(NamespaceDef *nd); 00061 NamespaceSDict *getUsedNamespaces() const; 00062 void addUsingDeclaration(Definition *def); 00063 SDict<Definition> *getUsedClasses() const { return usingDeclList; } 00064 void combineUsingRelations(); 00065 QCString displayName() const; 00066 00067 bool isLinkableInProject() const; 00068 bool isLinkable() const; 00069 void addMembersToMemberGroup(); 00070 void distributeMemberGroupDocumentation(); 00071 void findSectionsInDocumentation(); 00072 00073 virtual Definition *findInnerCompound(const char *name); 00074 void addInnerCompound(Definition *d); 00075 void addListReferences(); 00076 00077 MemberList *getMemberList(MemberList::ListType lt) const; 00078 const QList<MemberList> &getMemberLists() const { return m_memberLists; } 00079 00081 MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; } 00082 00084 ClassSDict *getClassSDict() const { return classSDict; } 00085 00087 NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; } 00088 00089 bool visited; 00090 00091 private: 00092 MemberList *createMemberList(MemberList::ListType lt); 00093 void addMemberToList(MemberList::ListType lt,MemberDef *md); 00094 void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title); 00095 void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title); 00096 00097 QCString fileName; 00098 QStrList files; 00099 00100 NamespaceSDict *usingDirList; 00101 SDict<Definition> *usingDeclList; 00102 SDict<Definition> *m_innerCompounds; 00103 00104 //MemberList *allMemberList; 00105 QList<MemberList> m_memberLists; 00106 MemberGroupSDict *memberGroupSDict; 00107 ClassSDict *classSDict; 00108 NamespaceSDict *namespaceSDict; 00109 bool m_subGrouping; 00110 }; 00111 00112 class NamespaceList : public QList<NamespaceDef> 00113 { 00114 public: 00115 ~NamespaceList() {} 00116 int compareItems(GCI item1,GCI item2) 00117 { 00118 return stricmp(((NamespaceDef *)item1)->name(), 00119 ((NamespaceDef *)item2)->name() 00120 ); 00121 } 00122 }; 00123 00124 class NamespaceListIterator : public QListIterator<NamespaceDef> 00125 { 00126 public: 00127 NamespaceListIterator(const NamespaceList &l) : 00128 QListIterator<NamespaceDef>(l) {} 00129 }; 00130 00131 class NamespaceDict : public QDict<NamespaceDef> 00132 { 00133 public: 00134 NamespaceDict(int size) : QDict<NamespaceDef>(size) {} 00135 ~NamespaceDict() {} 00136 }; 00137 00138 class NamespaceSDict : public SDict<NamespaceDef> 00139 { 00140 public: 00141 NamespaceSDict(int size=17) : SDict<NamespaceDef>(size) {} 00142 ~NamespaceSDict() {} 00143 int compareItems(GCI item1,GCI item2) 00144 { 00145 return stricmp(((NamespaceDef *)item1)->name(), 00146 ((NamespaceDef *)item2)->name() 00147 ); 00148 } 00149 void writeDeclaration(OutputList &ol,bool localName=FALSE); 00150 }; 00151 00152 00153 00154 #endif