sectionhandler.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  *
6  * Copyright (C) 1997-2015 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 
27  public BaseIterator<ISectionIterator,ISection,SectionHandler>
28 {
29  public:
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 
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:
86 
87  // XML elements:
88  // -------------
89  StringImpl m_header; // header
90  DocHandler* m_description; // description
92 
93  // XML attributes:
94  // ---------------
96  StringImpl m_kindString; // kind as a string
97 };
98 
99 void sectionhandler_init();
100 void sectionhandler_exit();
101 
102 #endif
Read only interface to a string.
Definition: doxmlintf.h:42
SectionIterator(const QList< SectionHandler > &list)
void sectionhandler_exit()
void sectionhandler_init()
QGList * list
Definition: qglist.h:234
StringImpl m_kindString
virtual const IString * kindString() const
virtual SectionKind kind() const
virtual bool isProtected() const
QList< MemberHandler > m_members
SectionKind m_kind
Node representing a documentation block.
Definition: dochandler.h:1315
virtual bool isPublic() const
virtual bool isPrivate() const
virtual bool isStatic() const
The interface to a section in the object model.
Definition: doxmlintf.h:747
StringImpl m_header
virtual const IString * header() const
IBaseHandler * m_parent
The QXmlAttributes class provides XML attributes.
Definition: qxml.h:128
DocHandler * m_description
def parent(G, child, parent_type)
Definition: graph.py:67
The interface to the object model provided by the XML parser library.