author | insilmaril |
Tue Aug 21 10:00:21 2007 +0000 (2007-08-21) | |
changeset 585 | a8e9eae855f4 |
child 646 | 371945eb6d31 |
permissions | -rw-r--r-- |
insilmaril@574 | 1 |
#ifndef XML_BASE |
insilmaril@574 | 2 |
#define XML_BASE |
insilmaril@574 | 3 |
|
insilmaril@574 | 4 |
|
insilmaril@574 | 5 |
#include <QString> |
insilmaril@574 | 6 |
#include <QXmlAttributes> |
insilmaril@574 | 7 |
|
insilmaril@574 | 8 |
#include "file.h" |
insilmaril@574 | 9 |
#include "mapcenterobj.h" |
insilmaril@574 | 10 |
#include "mapeditor.h" |
insilmaril@574 | 11 |
|
insilmaril@574 | 12 |
|
insilmaril@574 | 13 |
/*! \brief Base class for parsing maps from XML documents */ |
insilmaril@574 | 14 |
|
insilmaril@574 | 15 |
class parseBaseHandler : public QXmlDefaultHandler |
insilmaril@574 | 16 |
{ |
insilmaril@574 | 17 |
public: |
insilmaril@574 | 18 |
parseBaseHandler(); |
insilmaril@574 | 19 |
~parseBaseHandler(); |
insilmaril@574 | 20 |
QString errorProtocol(); |
insilmaril@574 | 21 |
QString parseHREF(QString); |
insilmaril@574 | 22 |
virtual bool startElement ( const QString&, const QString&, |
insilmaril@574 | 23 |
const QString& eName, const QXmlAttributes& atts )=0; |
insilmaril@574 | 24 |
virtual bool endElement ( const QString&, const QString&, const QString& )=0; |
insilmaril@574 | 25 |
virtual bool characters ( const QString&)=0; |
insilmaril@574 | 26 |
|
insilmaril@574 | 27 |
virtual QString errorString()=0; |
insilmaril@574 | 28 |
bool fatalError( const QXmlParseException&); |
insilmaril@574 | 29 |
void setMapEditor (MapEditor*); |
insilmaril@574 | 30 |
void setTmpDir (QString); |
insilmaril@574 | 31 |
void setInputFile (QString); |
insilmaril@574 | 32 |
void setLoadMode (const LoadMode &); |
insilmaril@574 | 33 |
|
insilmaril@574 | 34 |
protected: |
insilmaril@574 | 35 |
QString errorProt; |
insilmaril@574 | 36 |
|
insilmaril@574 | 37 |
LoadMode loadMode; |
insilmaril@574 | 38 |
bool isVymPart; |
insilmaril@574 | 39 |
// State state; |
insilmaril@574 | 40 |
// State laststate; |
insilmaril@574 | 41 |
// QList <State> stateStack; |
insilmaril@574 | 42 |
// QString htmldata; |
insilmaril@574 | 43 |
int branchDepth; |
insilmaril@574 | 44 |
// NoteObj no; |
insilmaril@574 | 45 |
MapCenterObj* mc; |
insilmaril@574 | 46 |
MapEditor* me; |
insilmaril@574 | 47 |
QString tmpDir; |
insilmaril@574 | 48 |
QString inputFile; |
insilmaril@574 | 49 |
}; |
insilmaril@574 | 50 |
#endif |