summaryrefslogtreecommitdiffstats
path: root/addon/doxmlparser/src/graphhandler.h
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-03-10 16:02:35 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-03-10 16:02:35 (GMT)
commit57a81b6ed2c1f626c57c20f143468730322856da (patch)
tree6db5f7392588f3b8c9d05ab7d2651803bc00c4c1 /addon/doxmlparser/src/graphhandler.h
parentc7bc295f92f56d1dea369663e058933f550a0187 (diff)
downloadDoxygen-57a81b6ed2c1f626c57c20f143468730322856da.zip
Doxygen-57a81b6ed2c1f626c57c20f143468730322856da.tar.gz
Doxygen-57a81b6ed2c1f626c57c20f143468730322856da.tar.bz2
Release-1.2.14-20020310
Diffstat (limited to 'addon/doxmlparser/src/graphhandler.h')
-rw-r--r--addon/doxmlparser/src/graphhandler.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/addon/doxmlparser/src/graphhandler.h b/addon/doxmlparser/src/graphhandler.h
new file mode 100644
index 0000000..47222d1
--- /dev/null
+++ b/addon/doxmlparser/src/graphhandler.h
@@ -0,0 +1,110 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2002 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _GRAPHHANDLER_H
+#define _GRAPHHANDLER_H
+
+#include "doxmlintf.h"
+#include "basehandler.h"
+#include "baseiterator.h"
+
+class NodeHandler;
+class ChildNodeHandler;
+
+class GraphHandler : public IGraph, public BaseHandler<GraphHandler>
+{
+ friend class NodeIterator;
+ public:
+ GraphHandler(IBaseHandler *parent,const char *endTag);
+ virtual ~GraphHandler();
+
+ void startGraph(const QXmlAttributes &attrib);
+ void endGraph();
+ void startNode(const QXmlAttributes &attrib);
+
+ // IGraph
+ virtual INodeIterator *nodes() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<NodeHandler> m_nodes;
+};
+
+//----------------------------------------------------------------------
+
+class NodeHandler : public INode, public BaseHandler<NodeHandler>
+{
+ friend class ChildNodeIterator;
+ public:
+ NodeHandler(IBaseHandler *parent);
+ virtual ~NodeHandler();
+
+ void startNode(const QXmlAttributes &attrib);
+ void endNode();
+ void startLabel(const QXmlAttributes &attrib);
+ void endLabel();
+ void startLink(const QXmlAttributes &attrib);
+ void endLink();
+
+ // INode
+ virtual QString id() const { return m_id; }
+ virtual QString label() const { return m_label; }
+ virtual QString linkId() const { return m_link; }
+ virtual IChildNodeIterator *children() const { return 0; } // TODO: implement
+
+ private:
+ IBaseHandler *m_parent;
+ QString m_id;
+ QString m_label;
+ QString m_link;
+ QList<ChildNodeHandler> m_children;
+};
+
+class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler>
+{
+ public:
+ NodeIterator(const GraphHandler &handler) :
+ BaseIterator<INodeIterator,INode,NodeHandler>(handler.m_nodes) {}
+};
+
+//----------------------------------------------------------------------
+
+class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
+{
+ public:
+ ChildNodeHandler(IBaseHandler *parent);
+ virtual ~ChildNodeHandler();
+
+ void startChildNode(const QXmlAttributes &attrib);
+ void endChildNode();
+
+ // IChildNode
+ virtual QString id() const { return m_id; }
+
+ private:
+ IBaseHandler *m_parent;
+ QString m_id;
+};
+
+class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>
+{
+ public:
+ ChildNodeIterator(const NodeHandler &handler) :
+ BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>(handler.m_children) {}
+};
+
+
+#endif
+