author | insilmaril |
Wed Jan 16 15:45:19 2008 +0000 (2008-01-16) | |
changeset 655 | d4b49c6c6069 |
parent 574 | 56fa27b2be3e |
child 775 | 6e4b586aa88a |
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@646 | 11 |
#include "vymmodel.h" |
insilmaril@574 | 12 |
|
insilmaril@574 | 13 |
|
insilmaril@574 | 14 |
/*! \brief Base class for parsing maps from XML documents */ |
insilmaril@574 | 15 |
|
insilmaril@574 | 16 |
class parseBaseHandler : public QXmlDefaultHandler |
insilmaril@574 | 17 |
{ |
insilmaril@574 | 18 |
public: |
insilmaril@574 | 19 |
parseBaseHandler(); |
insilmaril@574 | 20 |
~parseBaseHandler(); |
insilmaril@574 | 21 |
QString errorProtocol(); |
insilmaril@574 | 22 |
QString parseHREF(QString); |
insilmaril@574 | 23 |
virtual bool startElement ( const QString&, const QString&, |
insilmaril@574 | 24 |
const QString& eName, const QXmlAttributes& atts )=0; |
insilmaril@574 | 25 |
virtual bool endElement ( const QString&, const QString&, const QString& )=0; |
insilmaril@574 | 26 |
virtual bool characters ( const QString&)=0; |
insilmaril@574 | 27 |
|
insilmaril@574 | 28 |
virtual QString errorString()=0; |
insilmaril@574 | 29 |
bool fatalError( const QXmlParseException&); |
insilmaril@646 | 30 |
void setModel (VymModel *); |
insilmaril@574 | 31 |
void setTmpDir (QString); |
insilmaril@574 | 32 |
void setInputFile (QString); |
insilmaril@574 | 33 |
void setLoadMode (const LoadMode &); |
insilmaril@574 | 34 |
|
insilmaril@574 | 35 |
protected: |
insilmaril@574 | 36 |
QString errorProt; |
insilmaril@574 | 37 |
|
insilmaril@574 | 38 |
LoadMode loadMode; |
insilmaril@574 | 39 |
bool isVymPart; |
insilmaril@574 | 40 |
// State state; |
insilmaril@574 | 41 |
// State laststate; |
insilmaril@574 | 42 |
// QList <State> stateStack; |
insilmaril@574 | 43 |
// QString htmldata; |
insilmaril@574 | 44 |
int branchDepth; |
insilmaril@574 | 45 |
// NoteObj no; |
insilmaril@646 | 46 |
VymModel *model; |
insilmaril@574 | 47 |
QString tmpDir; |
insilmaril@574 | 48 |
QString inputFile; |
insilmaril@574 | 49 |
}; |
insilmaril@574 | 50 |
#endif |