xml.h
author insilmaril
Tue, 05 Sep 2006 09:47:13 +0000
changeset 365 1cc73bd7ee1f
parent 247 5dfbe972d9df
child 407 5db8dfd30ea2
permissions -rw-r--r--
Moved the qt4-port branch to HEAD
     1 #ifndef XLM_H
     2 #define XLM_H
     3 
     4 
     5 #include <qstring.h>
     6 #include <qxml.h>
     7 
     8 #include "file.h"
     9 #include "mapcenterobj.h"
    10 #include "mapeditor.h"
    11 
    12 
    13 class mapBuilderHandler  : public QXmlDefaultHandler
    14 {
    15 public:
    16 	mapBuilderHandler();
    17 	~mapBuilderHandler();
    18 	QString errorProtocol();
    19 	bool startDocument();
    20 	QString parseHREF(QString);
    21 	bool startElement ( const QString&, const QString&,
    22                         const QString& eName, const QXmlAttributes& atts ); 
    23 	bool   endElement ( const QString&, const QString&, const QString& ); 
    24 	bool characters   ( const QString&);
    25 	QString errorString();
    26 	bool fatalError( const QXmlParseException&);
    27 	void setMapEditor (MapEditor*);
    28 	void setTmpDir (QString);
    29 	void setInputFile (QString);
    30 	void setLoadMode (const LoadMode &);
    31 	bool readBranchAttr (const QXmlAttributes&);
    32 	bool readOOAttr (const QXmlAttributes&);
    33 	bool readNoteAttr (const QXmlAttributes&);
    34 	bool readFloatImageAttr (const QXmlAttributes&);
    35 	bool readXLinkAttr (const QXmlAttributes&);
    36 	bool readHtmlAttr (const QXmlAttributes&);
    37 	bool readSettingAttr (const QXmlAttributes&);
    38 
    39 private:
    40 	QString     errorProt;
    41 	enum State 
    42 	{ 
    43 		StateInit, StateMap, StateMapSelect, 
    44 		StateMapSetting,
    45 		StateFloatImage,
    46 		StateMapCenter, StateMapCenterStandardFlag,
    47 		StateMapCenterHeading, StateMapCenterNote, 
    48 		StateMapCenterFloatImage,
    49 		
    50 		StateBranch, StateBranchStandardFlag,
    51 		StateBranchHeading, StateBranchNote, 
    52 		StateBranchFloatImage, StateBranchXLink,
    53 		StateHtmlNote, StateHtml 
    54 	 };
    55 				 
    56 
    57 	LoadMode loadMode;
    58 	bool isVymPart;
    59 	State state;			 
    60 	State laststate;
    61 	QString htmldata;
    62 	int branchDepth; 
    63 	NoteObj no;
    64 	MapCenterObj* mc;
    65 	MapEditor* me; 
    66 	QString tmpDir; 
    67 	QString inputFile;
    68 }; 
    69 #endif