xml.h
branchrelease-1-12-maintained
changeset 71 0da9dd0b3911
child 95 f688a9913724
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xml.h	Wed Jul 22 19:56:29 2009 +0000
     1.3 @@ -0,0 +1,62 @@
     1.4 +#ifndef XLM_H
     1.5 +#define XLM_H
     1.6 +
     1.7 +
     1.8 +#include <qstring.h>
     1.9 +#include <qxml.h>
    1.10 +
    1.11 +#include "mapcenterobj.h"
    1.12 +#include "mapeditor.h"
    1.13 +
    1.14 +
    1.15 +class mapBuilderHandler  : public QXmlDefaultHandler
    1.16 +{
    1.17 +public:
    1.18 +	mapBuilderHandler();
    1.19 +	~mapBuilderHandler();
    1.20 +	QString errorProtocol();
    1.21 +	bool startDocument();
    1.22 +	QString mapBuilderHandler::parseHREF(QString);
    1.23 +	bool startElement ( const QString&, const QString&,
    1.24 +                        const QString& eName, const QXmlAttributes& atts ); 
    1.25 +	bool   endElement ( const QString&, const QString&, const QString& ); 
    1.26 +	bool characters   ( const QString&);
    1.27 +	QString errorString();
    1.28 +	bool fatalError( const QXmlParseException&);
    1.29 +	void setMapEditor (MapEditor*);
    1.30 +	void setTmpDir (QString);
    1.31 +	void setLoadMode (const LoadMode &);
    1.32 +	bool readBranchAttr (const QXmlAttributes&);
    1.33 +	bool readNoteAttr (const QXmlAttributes&);
    1.34 +	bool readFloatImageAttr (const QXmlAttributes&);
    1.35 +	bool readHtmlAttr (const QXmlAttributes&);
    1.36 +	bool readSettingAttr (const QXmlAttributes&);
    1.37 +
    1.38 +private:
    1.39 +	QString     errorProt;
    1.40 +	enum State 
    1.41 +	{ 
    1.42 +		StateInit, StateMap, StateMapSelect, 
    1.43 +		StateMapSetting,
    1.44 +		StateMapCenter, StateMapCenterStandardFlag,
    1.45 +		StateMapCenterHeading, StateMapCenterNote, 
    1.46 +		StateMapCenterFloatImage,
    1.47 +		
    1.48 +		StateBranch, StateBranchStandardFlag,
    1.49 +		StateBranchHeading, StateBranchNote, 
    1.50 +		StateBranchFloatImage, 
    1.51 +		StateHtmlNote, StateHtml 
    1.52 +	 };
    1.53 +				 
    1.54 +
    1.55 +	LoadMode loadMode;
    1.56 +	bool isVymPart;
    1.57 +	State state;			 
    1.58 +	State laststate;
    1.59 +	QString htmldata;
    1.60 +	int branchDepth; 
    1.61 +	NoteObj no;
    1.62 +	MapCenterObj* mc;
    1.63 +	MapEditor* me; QString tmpDir; 
    1.64 +}; 
    1.65 +#endif