00001 /****************************************************************************** 00002 * 00003 * $Id: memberlist.h,v 1.19 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 MEMBERLIST_H 00019 #define MEMBERLIST_H 00020 00021 #include <qlist.h> 00022 #include "memberdef.h" 00023 #include "sortdict.h" 00024 00025 class GroupDef; 00026 class MemberGroup; 00027 class MemberGroupList; 00028 class StorageIntf; 00029 00030 class MemberList : public QList<MemberDef> 00031 { 00032 public: 00033 enum ListType 00034 { 00035 privateLists = 0x0800, 00036 detailedLists = 0x1000, 00037 declarationLists = 0x2000, 00038 documentationLists = 0x4000, 00039 00040 pubMethods = 0, 00041 proMethods = 1, 00042 pacMethods = 2, 00043 priMethods = 3 + privateLists, 00044 pubStaticMethods = 4, 00045 proStaticMethods = 5, 00046 pacStaticMethods = 6, 00047 priStaticMethods = 7 + privateLists, 00048 pubSlots = 8, 00049 proSlots = 9, 00050 priSlots = 10 + privateLists, 00051 pubAttribs = 11, 00052 proAttribs = 12, 00053 pacAttribs = 13, 00054 priAttribs = 14 + privateLists, 00055 pubStaticAttribs = 15, 00056 proStaticAttribs = 16, 00057 pacStaticAttribs = 17, 00058 priStaticAttribs = 18 + privateLists, 00059 pubTypes = 19, 00060 proTypes = 20, 00061 pacTypes = 21, 00062 priTypes = 22 + privateLists, 00063 related = 23, 00064 signals = 24, 00065 friends = 25, 00066 dcopMethods = 26, 00067 properties = 27, 00068 events = 28, 00069 00070 typedefMembers = 29 + detailedLists, 00071 enumMembers = 30 + detailedLists, 00072 enumValMembers = 31 + detailedLists, 00073 functionMembers = 32 + detailedLists, 00074 relatedMembers = 33 + detailedLists, 00075 variableMembers = 34 + detailedLists, 00076 propertyMembers = 35 + detailedLists, 00077 eventMembers = 36 + detailedLists, 00078 constructors = 37 + detailedLists, 00079 00080 allMembersList = 38, 00081 00082 decDefineMembers = 39 + declarationLists, 00083 decProtoMembers = 40 + declarationLists, 00084 decTypedefMembers = 41 + declarationLists, 00085 decEnumMembers = 42 + declarationLists, 00086 decFuncMembers = 43 + declarationLists, 00087 decVarMembers = 44 + declarationLists, 00088 decEnumValMembers = 45 + declarationLists, 00089 decPubSlotMembers = 46 + declarationLists, 00090 decProSlotMembers = 47 + declarationLists, 00091 decPriSlotMembers = 48 + declarationLists, 00092 decSignalMembers = 49 + declarationLists, 00093 decEventMembers = 50 + declarationLists, 00094 decFriendMembers = 51 + declarationLists, 00095 decPropMembers = 52 + declarationLists, 00096 00097 docDefineMembers = 53 + documentationLists, 00098 docProtoMembers = 54 + documentationLists, 00099 docTypedefMembers = 55 + documentationLists, 00100 docEnumMembers = 56 + documentationLists, 00101 docFuncMembers = 57 + documentationLists, 00102 docVarMembers = 58 + documentationLists, 00103 docEnumValMembers = 59 + documentationLists, 00104 docPubSlotMembers = 60 + documentationLists, 00105 docProSlotMembers = 61 + documentationLists, 00106 docPriSlotMembers = 62 + documentationLists, 00107 docSignalMembers = 63 + documentationLists, 00108 docEventMembers = 64 + documentationLists, 00109 docFriendMembers = 65 + documentationLists, 00110 docPropMembers = 66 + documentationLists, 00111 00112 redefinedBy = 67, 00113 enumFields = 68, 00114 memberGroup = 69 00115 }; 00116 00117 MemberList(); 00118 MemberList(ListType lt); 00119 ~MemberList(); 00120 ListType listType() const { return m_listType; } 00121 bool insert(uint index,const MemberDef *md); 00122 void inSort(const MemberDef *md); 00123 void append(const MemberDef *md); 00124 int compareItems(GCI item1,GCI item2); 00125 int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; } 00126 int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; } 00127 int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; } 00128 int enumValueCount() const { ASSERT(m_numDecMembers!=-1); return m_enumValCnt; } 00129 int typedefCount() const { ASSERT(m_numDecMembers!=-1); return m_typeCnt; } 00130 int protoCount() const { ASSERT(m_numDecMembers!=-1); return m_protoCnt; } 00131 int defineCount() const { ASSERT(m_numDecMembers!=-1); return m_defCnt; } 00132 int friendCount() const { ASSERT(m_numDecMembers!=-1); return m_friendCnt; } 00133 int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; } 00134 int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; } 00135 void countDecMembers(bool countEnumValues=FALSE); 00136 void countDocMembers(bool countEnumValues=FALSE); 00137 void writePlainDeclarations(OutputList &ol, 00138 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); 00139 void writeDeclarations(OutputList &ol, 00140 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, 00141 const char *title,const char *subtitle,bool showEnumValues=FALSE); 00142 void writeDocumentation(OutputList &ol,const char *scopeName, 00143 Definition *container,const char *title,bool showEnumValues=FALSE); 00144 void writeDocumentationPage(OutputList &ol, 00145 const char *scopeName, Definition *container); 00146 void addMemberGroup(MemberGroup *mg); 00147 void setInGroup(bool inGroup) { m_inGroup=inGroup; } 00148 void setInFile(bool inFile) { m_inFile=inFile; } 00149 void addListReferences(Definition *def); 00150 void findSectionsInDocumentation(); 00151 MemberGroupList *getMemberGroupList() const { return memberGroupList; } 00152 00153 void marshal(StorageIntf *s); 00154 void unmarshal(StorageIntf *s); 00155 00156 private: 00157 int m_varCnt; 00158 int m_funcCnt; 00159 int m_enumCnt; 00160 int m_enumValCnt; 00161 int m_typeCnt; 00162 int m_protoCnt; 00163 int m_defCnt; 00164 int m_friendCnt; 00165 int m_numDecMembers; // number of members in the brief part of the memberlist 00166 int m_numDocMembers; // number of members in the detailed part of the memberlist 00167 MemberGroupList *memberGroupList; 00168 bool m_inGroup; // is this list part of a group definition 00169 bool m_inFile; // is this list part of a file definition 00170 ListType m_listType; 00171 }; 00172 00173 class MemberListIterator : public QListIterator<MemberDef> 00174 { 00175 public: 00176 MemberListIterator(const QList<MemberDef> &list); 00177 virtual ~MemberListIterator() {} 00178 }; 00179 00180 class MemberDict : public QDict<MemberDef> 00181 { 00182 public: 00183 MemberDict(int size) : QDict<MemberDef>(size) {} 00184 virtual ~MemberDict() {} 00185 }; 00186 00187 class MemberSDict : public SDict<MemberDef> 00188 { 00189 public: 00190 MemberSDict(int size=17) : SDict<MemberDef>(size) {} 00191 virtual ~MemberSDict() {} 00192 int compareItems(GCI item1,GCI item2); 00193 }; 00194 00195 00196 #endif