1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/xml-base.h Thu Nov 08 15:28:03 2007 +0000
1.3 @@ -0,0 +1,50 @@
1.4 +#ifndef XML_BASE
1.5 +#define XML_BASE
1.6 +
1.7 +
1.8 +#include <QString>
1.9 +#include <QXmlAttributes>
1.10 +
1.11 +#include "file.h"
1.12 +#include "mapcenterobj.h"
1.13 +#include "mapeditor.h"
1.14 +
1.15 +
1.16 +/*! \brief Base class for parsing maps from XML documents */
1.17 +
1.18 +class parseBaseHandler : public QXmlDefaultHandler
1.19 +{
1.20 +public:
1.21 + parseBaseHandler();
1.22 + ~parseBaseHandler();
1.23 + QString errorProtocol();
1.24 + QString parseHREF(QString);
1.25 + virtual bool startElement ( const QString&, const QString&,
1.26 + const QString& eName, const QXmlAttributes& atts )=0;
1.27 + virtual bool endElement ( const QString&, const QString&, const QString& )=0;
1.28 + virtual bool characters ( const QString&)=0;
1.29 +
1.30 + virtual QString errorString()=0;
1.31 + bool fatalError( const QXmlParseException&);
1.32 + void setMapEditor (MapEditor*);
1.33 + void setTmpDir (QString);
1.34 + void setInputFile (QString);
1.35 + void setLoadMode (const LoadMode &);
1.36 +
1.37 +protected:
1.38 + QString errorProt;
1.39 +
1.40 + LoadMode loadMode;
1.41 + bool isVymPart;
1.42 +// State state;
1.43 +// State laststate;
1.44 +// QList <State> stateStack;
1.45 +// QString htmldata;
1.46 + int branchDepth;
1.47 +// NoteObj no;
1.48 + MapCenterObj* mc;
1.49 + MapEditor* me;
1.50 + QString tmpDir;
1.51 + QString inputFile;
1.52 +};
1.53 +#endif