initial import
[vym] / xml-base.h
diff --git a/xml-base.h b/xml-base.h
new file mode 100644 (file)
index 0000000..f1b0151
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef XML_BASE
+#define XML_BASE
+
+
+#include <QString>
+#include <QXmlAttributes>
+
+#include "file.h"
+#include "mapcenterobj.h"
+#include "mapeditor.h"
+#include "vymmodel.h"
+
+
+/*! \brief Base class for parsing maps from XML documents */
+
+class parseBaseHandler  : public QXmlDefaultHandler
+{
+public:
+       parseBaseHandler();
+       ~parseBaseHandler();
+       QString errorProtocol();
+       QString parseHREF(QString);
+       virtual bool startElement ( const QString&, const QString&,
+                        const QString& eName, const QXmlAttributes& atts )=0; 
+       virtual bool   endElement ( const QString&, const QString&, const QString& )=0; 
+       virtual bool characters   ( const QString&)=0;
+
+       virtual QString errorString()=0;
+       bool fatalError( const QXmlParseException&);
+       void setModel (VymModel *);
+       void setTmpDir (QString);
+       void setInputFile (QString);
+       void setLoadMode (const LoadMode &);
+
+protected:
+       QString     errorProt;
+
+       LoadMode loadMode;
+       bool isVymPart;
+//     State state;                     
+//     State laststate;
+//     QList <State> stateStack;
+//     QString htmldata;
+       int branchDepth; 
+//     NoteObj no;
+       VymModel *model;
+       QString tmpDir; 
+       QString inputFile;
+}; 
+#endif