Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/addon/doxmlparser/src/compoundhandler.h

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: compoundhandler.h,v 1.33 2002/10/13 21:01:58 dimitri Exp $
4 *
5 *
6 * Copyright (C) 1997-2006 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 */
15#ifndef _COMPOUNDHANDLER_H
16#define _COMPOUNDHANDLER_H
17
18#include <qstring.h>
19#include <qlist.h>
20#include <qxml.h>
21#include <doxmlintf.h>
22
23#include "stringimpl.h"
24#include "basehandler.h"
25#include "baseiterator.h"
26
27class MainHandler;
28class DocHandler;
29class ProgramListingHandler;
30class GraphHandler;
31class MemberHandler;
32class CompoundHandler;
33class SectionHandler;
34class ParamHandler;
35class TemplateParamListHandler;
36class TitleHandler;
37class ListOfAllMembersHandler;
38
39class IncludeHandler : public IInclude, public BaseHandler<IncludeHandler>
40{
41 public:
42 IncludeHandler(IBaseHandler *parent,const char *endtag);
43 virtual ~IncludeHandler();
44
45 void startInclude(const QXmlAttributes &attrib);
46 void endInclude();
47
48 // IInclude
49 virtual const IString * name() const
50 { return &m_name; }
51 virtual const IString * refId() const
52 { return &m_refId; }
53 virtual bool isLocal() const
54 { return &m_isLocal; }
55
56 private:
57 IBaseHandler *m_parent;
58 StringImpl m_name; // element's content
59 StringImpl m_refId; // refid
60 bool m_isLocal; // local
61};
62
63class IncludeIterator : public BaseIterator<IIncludeIterator,IInclude,IncludeHandler>
64{
65 public:
66 IncludeIterator(const QList<IncludeHandler> &list) :
67 BaseIterator<IIncludeIterator,IInclude,IncludeHandler>(list) {}
68};
69
70
71class RelatedCompound : public IRelatedCompound
72{
73 public:
74 RelatedCompound(CompoundHandler *parent,
75 const QString &id,
76 Protection prot,
77 Kind kind
78 ) :
79 m_parent(parent), m_id(id), m_protection(prot), m_kind(kind) {}
80 virtual ~RelatedCompound() {}
81 void setName(const QString &str) { m_name = str; }
82
83 virtual ICompound *compound() const;
84 virtual Protection protection() const { return m_protection; }
85 virtual Kind kind() const { return m_kind; }
86 virtual const IString *name() const { return &m_name; }
87
88 private:
89 CompoundHandler *m_parent;
90 QString m_id; // refid
91 Protection m_protection; // prot
92 Kind m_kind; // virt
93 StringImpl m_name; // element's content
94};
95
96class RelatedCompoundIterator : public BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>
97{
98 public:
99 RelatedCompoundIterator(const QList<RelatedCompound> &list) :
100 BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>(list) {}
101};
102
103
104class CompoundHandler : public IClass,
105 public IStruct,
106 public IUnion,
107 public IException,
108 public IInterface,
109 public INamespace,
110 public IFile,
111 public IGroup,
112 public IPage,
113 public BaseHandler<CompoundHandler>
114{
115 friend class RelatedCompound;
116
117 public:
118 virtual void startSection(const QXmlAttributes& attrib);
119 virtual void startCompound(const QXmlAttributes& attrib);
120 virtual void startSuperClass(const QXmlAttributes& attrib);
121 virtual void endSuperClass();
122 virtual void startSubClass(const QXmlAttributes& attrib);
123 virtual void endSubClass();
124 virtual void endCompound();
125 virtual void endCompoundName();
126 virtual void startBriefDesc(const QXmlAttributes& attrib);
127 virtual void startDetailedDesc(const QXmlAttributes& attrib);
128 virtual void startLocation(const QXmlAttributes& attrib);
129 virtual void startProgramListing(const QXmlAttributes& attrib);
130 virtual void startInheritanceGraph(const QXmlAttributes& attrib);
131 virtual void startCollaborationGraph(const QXmlAttributes& attrib);
132 virtual void startIncludeDependencyGraph(const QXmlAttributes& attrib);
133 virtual void startIncludedByDependencyGraph(const QXmlAttributes& attrib);
134 virtual void startIncludes(const QXmlAttributes& attrib);
135 virtual void startIncludedBy(const QXmlAttributes& attrib);
136 virtual void startInnerDir(const QXmlAttributes& attrib);
137 virtual void startInnerClass(const QXmlAttributes& attrib);
138 virtual void startInnerNamespace(const QXmlAttributes& attrib);
139 virtual void startInnerFile(const QXmlAttributes& attrib);
140 virtual void startInnerGroup(const QXmlAttributes& attrib);
141 virtual void startInnerPage(const QXmlAttributes& attrib);
142 virtual void startTitle(const QXmlAttributes& attrib);
143 virtual void startTemplateParamList(const QXmlAttributes& attrib);
144 virtual void startListOfAllMembers(const QXmlAttributes& attrib);
145 virtual void addref() { m_refCount++; }
146
147 CompoundHandler(const QString &dirName);
148 virtual ~CompoundHandler();
149 bool parseXML(const char *compId);
150 void initialize(MainHandler *mh);
151 void insertMember(MemberHandler *mh);
152 ICompound *toICompound() const;
153
154 // ICompound implementation
155 const IString *name() const { return &m_name; }
156 const IString *id() const { return &m_id; }
157 CompoundKind kind() const { return m_kind; }
158 const IString *kindString() const { return &m_kindString; }
159 ISectionIterator *sections() const;
160 IDocRoot *briefDescription() const;
161 IDocRoot *detailedDescription() const;
162 IMember *memberById(const char *id) const;
163 IMemberIterator *memberByName(const char *name) const;
164 IParamIterator *templateParameters() const;
165 void release();
166
167 // IClass implementation
168 IGraph *inheritanceGraph() const;
169 IGraph *collaborationGraph() const;
170 IRelatedCompoundIterator *baseCompounds() const;
171 IRelatedCompoundIterator *derivedCompounds() const;
172 ICompoundIterator *nestedCompounds() const;
173 ICompoundIterator *nestedGroup() const;
174 const IString *locationFile() const { return &m_defFile; }
175 int locationLine() const { return m_defLine; }
176 const IString *locationBodyFile() const { return &m_defBodyFile; }
177 int locationBodyStartLine() const { return m_defBodyStart; }
178 int locationBodyEndLine() const { return m_defBodyEnd; }
179 IMemberReferenceIterator *members() const;
180
181 // IFile implementation
182 IGraph *includeDependencyGraph() const;
183 IGraph *includedByDependencyGraph() const;
184 IDocProgramListing *source() const;
185 IIncludeIterator *includes() const;
186 IIncludeIterator *includedBy() const;
187
188 // IPage implementation
189 const IDocTitle *title() const;
190
191 private:
192 // XML elements:
193 // -------------
194 StringImpl m_name; // compoundname
195 TitleHandler* m_titleHandler; // title
196 QList<RelatedCompound> m_subClasses; // basecompoundref
197 QList<RelatedCompound> m_superClasses; // derivedcompoundref
198 QList<IncludeHandler> m_includes; // includes
199 QList<IncludeHandler> m_includedBy; // includedBy
200 GraphHandler* m_includeDependencyGraph; // incdepgraph
201 GraphHandler* m_includedByDependencyGraph; // invincdepgraph
202 QList<QString> m_innerCompounds; // innerdir/innerfile/innerclass/innernamespace/innergroup
203 TemplateParamListHandler* m_templateParamList; // templateparamlist
204 QList<SectionHandler> m_sections; // sectiondef
205 DocHandler* m_brief; // briefdescription
206 DocHandler* m_detailed; // detaileddescription
207 GraphHandler* m_inheritanceGraph; // inheritancegraph
208 GraphHandler* m_collaborationGraph; // collaborationgraph
209 ProgramListingHandler* m_programListing; // programlisting
210 // location
211 StringImpl m_defFile; // - file
212 int m_defLine; // - line
213 StringImpl m_defBodyFile; // - bodyfile
214 int m_defBodyStart; // - bodystart
215 int m_defBodyEnd; // - bodyend
216 ListOfAllMembersHandler* m_members; // listofallmember
217
218 // XML attributes:
219 // ---------------
220 StringImpl m_id; // id
221 CompoundKind m_kind; // kind
222 StringImpl m_kindString; // kind as a string
223 StringImpl m_protection; // prot
224
225 // local variables
226 QString m_xmlDir; // directory where the info is found
227 int m_refCount; // object reference counter
228 QDict<MemberHandler> m_memberDict; // id->member lookup
229 QDict<QList<MemberHandler> > m_memberNameDict; // name->memberlist lookup
230 MainHandler* m_mainHandler; // parent object
231};
232
233void compoundhandler_init();
234void compoundhandler_exit();
235
236#endif
237

Archive Download this file

Revision: 1322