Chameleon

Chameleon Svn Source Tree

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

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id:$
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
16#ifndef _MEMBERHANDLER_H
17#define _MEMBERHANDLER_H
18
19#include <qstring.h>
20#include <qlist.h>
21#include <qxml.h>
22#include <doxmlintf.h>
23
24#include "basehandler.h"
25#include "baseiterator.h"
26#include "stringimpl.h"
27
28class MainHandler;
29class CompoundHandler;
30class SectionHandler;
31class ParamHandler;
32class LinkedTextImpl;
33class LinkedTextHandler;
34class DocHandler;
35
36class MemberReference : public IMemberReference
37{
38 public:
39 virtual ~MemberReference() {}
40 virtual IMember *member() const;
41 virtual const IString *name() const { return &m_name; }
42 virtual const IString *scope() const { return &m_scope; }
43 virtual const IString *protection() const { return &m_protection; }
44 virtual const IString *virtualness() const { return &m_virtualness; }
45 virtual const IString *ambiguityScope() const { return &m_ambiguityScope; }
46 void initialize(MainHandler *m);
47
48 QString m_memId;
49 StringImpl m_name;
50 StringImpl m_scope;
51 StringImpl m_virtualness;
52 StringImpl m_protection;
53 StringImpl m_ambiguityScope;
54 MainHandler *m_mainHandler;
55};
56
57class MemberReferenceIterator : public BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>
58{
59 public:
60 MemberReferenceIterator(const QList<MemberReference> &list) :
61 BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>(list) {}
62};
63
64class MemberHandler : public IDefine,
65 public IProperty,
66 public IVariable,
67 public ITypedef,
68 public IFunction,
69 public ISignal,
70 public IPrototype,
71 public IFriend,
72 public IDCOP,
73 public ISlot,
74 public IEnum,
75 public IEnumValue,
76 public BaseHandler<MemberHandler>
77{
78 public:
79 virtual void startMember(const QXmlAttributes& attrib);
80 virtual void endMember();
81 virtual void startParam(const QXmlAttributes& attrib);
82 virtual void startType(const QXmlAttributes& attrib);
83 virtual void startName(const QXmlAttributes& attrib);
84 virtual void endName();
85 virtual void startRead(const QXmlAttributes& attrib);
86 virtual void endRead();
87 virtual void startWrite(const QXmlAttributes& attrib);
88 virtual void endWrite();
89 virtual void startDefinition(const QXmlAttributes& attrib);
90 virtual void endDefinition();
91 virtual void startArgsString(const QXmlAttributes& attrib);
92 virtual void endArgsString();
93 virtual void startBriefDesc(const QXmlAttributes& attrib);
94 virtual void startDetailedDesc(const QXmlAttributes& attrib);
95 virtual void startInbodyDesc(const QXmlAttributes& attrib);
96 virtual void startLocation(const QXmlAttributes& attrib);
97 virtual void startReferences(const QXmlAttributes& attrib);
98 virtual void endReferences();
99 virtual void startReferencedBy(const QXmlAttributes& attrib);
100 virtual void endReferencedBy();
101 virtual void startReimplements(const QXmlAttributes& attrib);
102 virtual void endReimplements();
103 virtual void startReimplementedBy(const QXmlAttributes& attrib);
104 virtual void endReimplementedBy();
105 virtual void startInitializer(const QXmlAttributes& attrib);
106 virtual void startException(const QXmlAttributes& attrib);
107 virtual void startEnumValue(const QXmlAttributes& attrib);
108 virtual void startEnumValue2(const QXmlAttributes& attrib);
109 virtual void startTemplateParamList(const QXmlAttributes &attrib);
110 virtual void endTemplateParamList();
111
112 MemberHandler(IBaseHandler *parent);
113 virtual ~MemberHandler();
114
115 // IMember implementation
116 virtual ICompound *compound() const;
117 virtual ISection *section() const;
118 virtual MemberKind kind() const
119 { return m_kind; }
120 virtual const IString *kindString() const
121 { return &m_kindString; }
122 virtual const IString *id() const
123 { return &m_id; }
124 virtual const IString *protection() const
125 { return &m_protection; }
126 virtual const IString *virtualness() const
127 { return &m_virtualness; }
128 virtual const IString *name() const
129 { return &m_name; }
130 virtual const IString *readAccessor() const
131 { return &m_read; }
132 virtual const IString *writeAccessor() const
133 { return &m_write; }
134 virtual const IString *definition() const
135 { return &m_definition; }
136 virtual const IString *argsstring() const
137 { return &m_argsstring; }
138 virtual bool isConst() const
139 { return m_isConst; }
140 virtual bool isVolatile() const
141 { return m_isVolatile; }
142 virtual bool isStatic() const
143 { return m_isStatic; }
144 virtual bool isExplicit() const
145 { return m_isExplicit; }
146 virtual bool isInline() const
147 { return m_isInline; }
148 virtual bool isMutable() const
149 { return m_isMutable; }
150 virtual bool isReadable() const
151 { return m_isReadable; }
152 virtual bool isWritable() const
153 { return m_isWritable; }
154 virtual ILinkedTextIterator *type() const;
155 virtual const IString *typeString() const;
156 virtual IParamIterator *parameters() const;
157 virtual IParamIterator *templateParameters() const;
158 virtual IMemberReferenceIterator *references() const;
159 virtual IMemberReferenceIterator *referencedBy() const;
160 virtual ILinkedTextIterator *initializer() const;
161 virtual ILinkedTextIterator *exceptions() const;
162 virtual const IString *bodyFile() const
163 { return &m_bodyFile; }
164 virtual int bodyStart() const
165 { return m_bodyStart; }
166 virtual int bodyEnd() const
167 { return m_bodyEnd; }
168 virtual const IString *definitionFile() const
169 { return &m_defFile; }
170 virtual int definitionLine() const
171 { return m_defLine; }
172 virtual IMemberReference *reimplements() const
173 { return m_reimplements; }
174 virtual IMemberReferenceIterator *reimplementedBy() const;
175 virtual IDocRoot *briefDescription() const;
176 virtual IDocRoot *detailedDescription() const;
177 virtual IDocRoot *inbodyDescription() const;
178
179 // IEnum
180 virtual IMemberIterator *enumValues() const;
181
182 void initialize(MainHandler *m);
183 void setCompoundHandler(CompoundHandler *c);
184 void setSectionHandler(SectionHandler *s);
185
186 private:
187 // XML elements:
188 // -----------------
189 QList<ParamHandler> m_templateParams; // templateparamlist
190 QList<LinkedTextImpl> m_type; // type
191 StringImpl m_definition; // definition
192 StringImpl m_argsstring; // argsstring
193 StringImpl m_name; // name
194 StringImpl m_read; // read
195 StringImpl m_write; // write
196 MemberReference *m_reimplements; // reimplements
197 QList<MemberReference> m_reimplementedBy; // reimplementedby
198 QList<ParamHandler> m_params; // param
199 QList<MemberHandler> m_enumValues; // enumvalue
200 QList<LinkedTextImpl> m_initializer; // initializer
201 QList<LinkedTextImpl> m_exception; // exceptions
202 DocHandler *m_brief; // briefdescription
203 DocHandler *m_detailed; // detaileddescription
204 DocHandler *m_inbody; // inbodydescription
205 // location
206 StringImpl m_defFile; // - file
207 int m_defLine; // - line
208 StringImpl m_bodyFile; // - bodyfile
209 int m_bodyStart; // - bodystart
210 int m_bodyEnd; // - bodyend
211 QList<MemberReference> m_references; // references
212 QList<MemberReference> m_referencedBy; // referencedby
213
214 // XML attributes:
215 // ---------------
216 MemberKind m_kind; // kind
217 StringImpl m_kindString; // kind as a string
218 StringImpl m_id; // id
219 StringImpl m_protection; // prot
220 bool m_isStatic; // static
221 bool m_isConst; // const
222 bool m_isExplicit; // explicit
223 bool m_isInline; // inline
224 StringImpl m_virtualness; // virt
225 bool m_isVolatile; // volatile
226 bool m_isMutable; // mutable
227 bool m_isReadable; // readable
228 bool m_isWritable; // writable
229
230 CompoundHandler *m_compound;
231 SectionHandler *m_section;
232 StringImpl m_typeString;
233 LinkedTextHandler *m_linkedTextHandler;
234 bool m_insideTemplateParamList;
235 bool m_hasTemplateParamList;
236 IBaseHandler *m_parent;
237};
238
239class MemberIterator : public BaseIteratorVia<IMemberIterator,
240 IMember,
241 MemberHandler,
242 IFunction>
243{
244 public:
245 MemberIterator(const QList<MemberHandler> &list) :
246 BaseIteratorVia<IMemberIterator,IMember,MemberHandler,IFunction>(list) {}
247};
248
249void memberhandler_init();
250void memberhandler_exit();
251
252#endif
253

Archive Download this file

Revision: 1322