X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=xml-base.h;fp=xml-base.h;h=f1b0151c3dd3de8baf10387e471cb4119ec30ea4;hb=2f79edb68ae955de3c3118a7f9181c7a1f3b0d72;hp=0000000000000000000000000000000000000000;hpb=eeb718b059f8b14807b976ae6410a3021b2d4576;p=vym diff --git a/xml-base.h b/xml-base.h new file mode 100644 index 0000000..f1b0151 --- /dev/null +++ b/xml-base.h @@ -0,0 +1,50 @@ +#ifndef XML_BASE +#define XML_BASE + + +#include +#include + +#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 stateStack; +// QString htmldata; + int branchDepth; +// NoteObj no; + VymModel *model; + QString tmpDir; + QString inputFile; +}; +#endif