Public Member Functions | Private Attributes | Friends | List of all members
NodeHandler Class Reference

#include <graphhandler.h>

Inheritance diagram for NodeHandler:
INode BaseHandler< NodeHandler > QXmlDefaultHandler ElementMapper< NodeHandler > LocatorContainer IBaseHandler QXmlContentHandler QXmlErrorHandler QXmlDTDHandler QXmlEntityResolver QXmlLexicalHandler QXmlDeclHandler

Public Member Functions

 NodeHandler (GraphHandler *gh)
 
virtual ~NodeHandler ()
 
void startNode (const QXmlAttributes &attrib)
 
void endNode ()
 
void startLabel (const QXmlAttributes &attrib)
 
void endLabel ()
 
void startLink (const QXmlAttributes &attrib)
 
void endLink ()
 
void startChildNode (const QXmlAttributes &attrib)
 
virtual const IStringid () const
 
virtual const IStringlabel () const
 
virtual const IStringlinkId () const
 
virtual IChildNodeIteratorchildren () const
 
- Public Member Functions inherited from BaseHandler< NodeHandler >
 BaseHandler ()
 
virtual ~BaseHandler ()
 
virtual bool startDocument ()
 
virtual bool startElement (const QString &namespaceURI, const QString &localName, const QString &name, const QXmlAttributes &attrib)
 
virtual bool endElement (const QString &namespaceURI, const QString &localName, const QString &name)
 
bool skippedEntity (const QString &s)
 
virtual bool characters (const QString &ch)
 
void setDelegate (QXmlDefaultHandler *delegate)
 
QXmlDefaultHandlerdelegate () const
 
void setFallBackHandler (IFallBackHandler *h)
 
IFallBackHandlerfallBackHandler () const
 
void setDocumentLocator (QXmlLocator *locator)
 
- Public Member Functions inherited from QXmlDefaultHandler
 QXmlDefaultHandler ()
 
virtual ~QXmlDefaultHandler ()
 
bool endDocument ()
 
bool startPrefixMapping (const QString &prefix, const QString &uri)
 
bool endPrefixMapping (const QString &prefix)
 
bool ignorableWhitespace (const QString &ch)
 
bool processingInstruction (const QString &target, const QString &data)
 
bool warning (const QXmlParseException &exception)
 
bool error (const QXmlParseException &exception)
 
bool fatalError (const QXmlParseException &exception)
 
bool notationDecl (const QString &name, const QString &publicId, const QString &systemId)
 
bool unparsedEntityDecl (const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
 
bool resolveEntity (const QString &publicId, const QString &systemId, QXmlInputSource *&ret)
 
bool startDTD (const QString &name, const QString &publicId, const QString &systemId)
 
bool endDTD ()
 
bool startCDATA ()
 
bool endCDATA ()
 
bool comment (const QString &ch)
 
bool attributeDecl (const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)
 
bool internalEntityDecl (const QString &name, const QString &value)
 
bool externalEntityDecl (const QString &name, const QString &publicId, const QString &systemId)
 
QString errorString ()
 
- Public Member Functions inherited from QXmlContentHandler
virtual ~QXmlContentHandler ()
 
- Public Member Functions inherited from QXmlErrorHandler
virtual ~QXmlErrorHandler ()
 
- Public Member Functions inherited from QXmlDTDHandler
virtual ~QXmlDTDHandler ()
 
- Public Member Functions inherited from QXmlEntityResolver
virtual ~QXmlEntityResolver ()
 
- Public Member Functions inherited from QXmlLexicalHandler
virtual ~QXmlLexicalHandler ()
 
- Public Member Functions inherited from QXmlDeclHandler
virtual ~QXmlDeclHandler ()
 
- Public Member Functions inherited from ElementMapper< NodeHandler >
 ElementMapper ()
 
virtual ~ElementMapper ()
 
void addStartHandler (const char *key)
 
void addStartHandler (const char *key, NodeHandler *obj, void(NodeHandler::*handler)(const QXmlAttributes &))
 
void addEndHandler (const char *key)
 
void addEndHandler (const char *key, NodeHandler *obj, void(NodeHandler::*handler)())
 
- Public Member Functions inherited from IBaseHandler
virtual ~IBaseHandler ()
 

Private Attributes

IBaseHandlerm_parent
 
StringImpl m_id
 
StringImpl m_label
 
StringImpl m_link
 
QList< ChildNodeHandlerm_children
 
GraphHandlerm_graph
 

Friends

class ChildNodeIterator
 

Additional Inherited Members

- Public Types inherited from BaseHandler< NodeHandler >
typedef ElementMapper< NodeHandler >::StartElementHandlerT StartElementHandlerT
 
typedef ElementMapper< NodeHandler >::EndElementHandlerT EndElementHandlerT
 
- Public Types inherited from ElementMapper< NodeHandler >
typedef StartElementHandler StartElementHandlerT
 
typedef EndElementHandler EndElementHandlerT
 
- Static Public Attributes inherited from LocatorContainer
static QXmlLocators_theLocator =0
 
- Protected Attributes inherited from BaseHandler< NodeHandler >
QString m_curString
 
QString m_skipUntil
 
int m_skipCount
 
QXmlDefaultHandlerm_delegateHandler
 
IFallBackHandlerm_fallBackHandler
 
- Protected Attributes inherited from ElementMapper< NodeHandler >
QDict< StartElementHandlerTm_startHandlers
 
QDict< EndElementHandlerTm_endHandlers
 

Detailed Description

Definition at line 51 of file graphhandler.h.

Constructor & Destructor Documentation

NodeHandler::NodeHandler ( GraphHandler gh)

Definition at line 82 of file graphhandler.cpp.

83  : m_parent(gh), m_graph(gh)
84 {
85  addEndHandler("node",this,&NodeHandler::endNode);
87  addEndHandler("link",this,&NodeHandler::endLink);
89  addEndHandler("label",this,&NodeHandler::endLabel);
92 }
void startLabel(const QXmlAttributes &attrib)
void startChildNode(const QXmlAttributes &attrib)
GraphHandler * m_graph
Definition: graphhandler.h:78
QList< ChildNodeHandler > m_children
Definition: graphhandler.h:77
void startLink(const QXmlAttributes &attrib)
IBaseHandler * m_parent
Definition: graphhandler.h:73
void addStartHandler(const char *key)
Definition: basehandler.h:91
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
void addEndHandler(const char *key)
Definition: basehandler.h:101
NodeHandler::~NodeHandler ( )
virtual

Definition at line 94 of file graphhandler.cpp.

95 {
96 }

Member Function Documentation

IChildNodeIterator * NodeHandler::children ( ) const
virtual

Implements INode.

Definition at line 137 of file graphhandler.cpp.

138 {
139  return new ChildNodeIterator(*this);
140 }
friend class ChildNodeIterator
Definition: graphhandler.h:53
void NodeHandler::endLabel ( )

Definition at line 125 of file graphhandler.cpp.

126 {
128 }
StringImpl m_label
Definition: graphhandler.h:75
void NodeHandler::endLink ( )

Definition at line 116 of file graphhandler.cpp.

117 {
118 }
void NodeHandler::endNode ( )

Definition at line 105 of file graphhandler.cpp.

106 {
107  debug(2,"endNode\n");
108  m_parent->setDelegate(0);
109 }
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
IBaseHandler * m_parent
Definition: graphhandler.h:73
virtual const IString* NodeHandler::id ( ) const
inlinevirtual

Implements INode.

Definition at line 67 of file graphhandler.h.

67 { return &m_id; }
StringImpl m_id
Definition: graphhandler.h:74
virtual const IString* NodeHandler::label ( ) const
inlinevirtual

Implements INode.

Definition at line 68 of file graphhandler.h.

68 { return &m_label; }
StringImpl m_label
Definition: graphhandler.h:75
virtual const IString* NodeHandler::linkId ( ) const
inlinevirtual

Implements INode.

Definition at line 69 of file graphhandler.h.

69 { return &m_link; }
StringImpl m_link
Definition: graphhandler.h:76
void NodeHandler::startChildNode ( const QXmlAttributes attrib)

Definition at line 130 of file graphhandler.cpp.

131 {
132  ChildNodeHandler *cnh = new ChildNodeHandler(this,m_graph);
133  cnh->startChildNode(attrib);
134  m_children.append(cnh);
135 }
void append(const type *d)
Definition: qlist.h:73
GraphHandler * m_graph
Definition: graphhandler.h:78
QList< ChildNodeHandler > m_children
Definition: graphhandler.h:77
void startChildNode(const QXmlAttributes &attrib)
void NodeHandler::startLabel ( const QXmlAttributes attrib)

Definition at line 120 of file graphhandler.cpp.

121 {
122  m_curString="";
123 }
void NodeHandler::startLink ( const QXmlAttributes attrib)

Definition at line 111 of file graphhandler.cpp.

112 {
113  m_link = attrib.value("refid");
114 }
QString value(int index) const
Definition: qxml.cpp:664
StringImpl m_link
Definition: graphhandler.h:76
void NodeHandler::startNode ( const QXmlAttributes attrib)

Definition at line 98 of file graphhandler.cpp.

99 {
100  debug(2,"startNode\n");
101  m_parent->setDelegate(this);
102  m_id = attrib.value("id");
103 }
QString value(int index) const
Definition: qxml.cpp:664
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
IBaseHandler * m_parent
Definition: graphhandler.h:73
StringImpl m_id
Definition: graphhandler.h:74

Friends And Related Function Documentation

friend class ChildNodeIterator
friend

Definition at line 53 of file graphhandler.h.

Member Data Documentation

QList<ChildNodeHandler> NodeHandler::m_children
private

Definition at line 77 of file graphhandler.h.

GraphHandler* NodeHandler::m_graph
private

Definition at line 78 of file graphhandler.h.

StringImpl NodeHandler::m_id
private

Definition at line 74 of file graphhandler.h.

StringImpl NodeHandler::m_label
private

Definition at line 75 of file graphhandler.h.

StringImpl NodeHandler::m_link
private

Definition at line 76 of file graphhandler.h.

IBaseHandler* NodeHandler::m_parent
private

Definition at line 73 of file graphhandler.h.


The documentation for this class was generated from the following files: