xml-base.h
author insilmaril
Thu, 26 Mar 2009 07:50:32 +0000
changeset 747 008e72977ab8
parent 646 371945eb6d31
child 775 6e4b586aa88a
permissions -rw-r--r--
Notes work again (to some degree)
     1 #ifndef XML_BASE
     2 #define XML_BASE
     3 
     4 
     5 #include <QString>
     6 #include <QXmlAttributes>
     7 
     8 #include "file.h"
     9 #include "mapcenterobj.h"
    10 #include "mapeditor.h"
    11 #include "vymmodel.h"
    12 
    13 
    14 /*! \brief Base class for parsing maps from XML documents */
    15 
    16 class parseBaseHandler  : public QXmlDefaultHandler
    17 {
    18 public:
    19 	parseBaseHandler();
    20 	~parseBaseHandler();
    21 	QString errorProtocol();
    22 	QString parseHREF(QString);
    23 	virtual bool startElement ( const QString&, const QString&,
    24                         const QString& eName, const QXmlAttributes& atts )=0; 
    25 	virtual bool   endElement ( const QString&, const QString&, const QString& )=0; 
    26 	virtual bool characters   ( const QString&)=0;
    27 
    28 	virtual QString errorString()=0;
    29 	bool fatalError( const QXmlParseException&);
    30 	void setModel (VymModel *);
    31 	void setTmpDir (QString);
    32 	void setInputFile (QString);
    33 	void setLoadMode (const LoadMode &);
    34 
    35 protected:
    36 	QString     errorProt;
    37 
    38 	LoadMode loadMode;
    39 	bool isVymPart;
    40 //	State state;			 
    41 //	State laststate;
    42 //	QList <State> stateStack;
    43 //	QString htmldata;
    44 	int branchDepth; 
    45 //	NoteObj no;
    46 	VymModel *model;
    47 	QString tmpDir; 
    48 	QString inputFile;
    49 }; 
    50 #endif