Root/
Source at commit 1322 created 12 years 8 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 _SECTIONHANDLER_H␊ |
17 | #define _SECTIONHANDLER_H␊ |
18 | ␊ |
19 | #include <qstring.h>␊ |
20 | #include <qlist.h>␊ |
21 | #include <qxml.h>␊ |
22 | #include <doxmlintf.h>␊ |
23 | ␊ |
24 | #include "basehandler.h"␊ |
25 | ␊ |
26 | class SectionIterator : ␊ |
27 | public BaseIterator<ISectionIterator,ISection,SectionHandler>␊ |
28 | {␊ |
29 | public:␊ |
30 | SectionIterator(const QList<SectionHandler> &list) : ␊ |
31 | BaseIterator<ISectionIterator,ISection,SectionHandler>(list) {}␊ |
32 | };␊ |
33 | ␊ |
34 | ␊ |
35 | class SectionHandler : public IUserDefined, public BaseHandler<SectionHandler>␊ |
36 | {␊ |
37 | public:␊ |
38 | virtual void startMember(const QXmlAttributes& attrib);␊ |
39 | virtual void startHeader(const QXmlAttributes& attrib);␊ |
40 | virtual void startSection(const QXmlAttributes& attrib);␊ |
41 | virtual void startDescription(const QXmlAttributes& attrib);␊ |
42 | virtual void endSection();␊ |
43 | virtual void endHeader();␊ |
44 | ␊ |
45 | SectionHandler(IBaseHandler *parent);␊ |
46 | virtual ~SectionHandler();␊ |
47 | ␊ |
48 | // ISection␊ |
49 | virtual const IString *kindString() const ␊ |
50 | { return &m_kindString; }␊ |
51 | virtual SectionKind kind() const ␊ |
52 | { return m_kind; }␊ |
53 | IDocRoot *description() const;␊ |
54 | virtual IMemberIterator *members() const;␊ |
55 | virtual bool isStatic() const␊ |
56 | { ␊ |
57 | return m_kind==PubStatFuncs || m_kind==PubStatAttribs || ␊ |
58 | m_kind==ProStatFuncs || m_kind==ProStatAttribs || ␊ |
59 | m_kind==PriStatFuncs || m_kind==PriStatAttribs;␊ |
60 | }␊ |
61 | virtual bool isPublic() const␊ |
62 | {␊ |
63 | return !isProtected() && !isPrivate();␊ |
64 | }␊ |
65 | virtual bool isProtected() const␊ |
66 | {␊ |
67 | return m_kind==ProTypes || m_kind==ProFuncs || m_kind==ProAttribs ||␊ |
68 | m_kind==ProSlots || m_kind==ProStatFuncs || m_kind==ProStatAttribs;␊ |
69 | }␊ |
70 | virtual bool isPrivate() const␊ |
71 | {␊ |
72 | return m_kind==PriTypes || m_kind==PriFuncs || m_kind==PriAttribs ||␊ |
73 | m_kind==PriSlots || m_kind==PriStatFuncs || m_kind==PriStatAttribs;␊ |
74 | }␊ |
75 | ␊ |
76 | void initialize(CompoundHandler *c);␊ |
77 | ␊ |
78 | // IUserDefined implementation␊ |
79 | virtual const IString *header() const ␊ |
80 | {␊ |
81 | return &m_header;␊ |
82 | }␊ |
83 | ␊ |
84 | private:␊ |
85 | IBaseHandler *m_parent;␊ |
86 | ␊ |
87 | // XML elements:␊ |
88 | // -------------␊ |
89 | StringImpl m_header; // header␊ |
90 | DocHandler* m_description; // description␊ |
91 | QList<MemberHandler> m_members; // memberdef␊ |
92 | ␊ |
93 | // XML attributes:␊ |
94 | // ---------------␊ |
95 | SectionKind m_kind; // kind␊ |
96 | StringImpl m_kindString; // kind as a string␊ |
97 | };␊ |
98 | ␊ |
99 | void sectionhandler_init();␊ |
100 | void sectionhandler_exit();␊ |
101 | ␊ |
102 | #endif␊ |
103 |