xml.h
author insilmaril
Wed, 20 Jun 2007 10:51:44 +0000
changeset 515 f396157bbb06
parent 421 5522d1da7e37
child 558 3665eee7a842
permissions -rw-r--r--
scripted exports (continued)
     1 #ifndef XML_H
     2 #define XML_H
     3 
     4 
     5 #include <QString>
     6 #include <QXmlAttributes>
     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 readFrameAttr (const QXmlAttributes&);
    33 	bool readOOAttr (const QXmlAttributes&);
    34 	bool readNoteAttr (const QXmlAttributes&);
    35 	bool readFloatImageAttr (const QXmlAttributes&);
    36 	bool readXLinkAttr (const QXmlAttributes&);
    37 	bool readHtmlAttr (const QXmlAttributes&);
    38 	bool readSettingAttr (const QXmlAttributes&);
    39 
    40 private:
    41 	QString     errorProt;
    42 	enum State 
    43 	{ 
    44 		StateInit, 
    45 		StateMap, 
    46 		StateMapSelect, 
    47 		StateMapSetting,
    48 		StateMapCenter, 
    49 		StateBranch, 
    50 		StateBranchXLink,			//
    51 		StateHtmlNote, 
    52 		StateHtml, 
    53 		StateFrame,
    54 		StateStandardFlag,
    55 		StateNote,
    56 		StateFloatImage,
    57 		StateHeading
    58 	 };
    59 				 
    60 
    61 	LoadMode loadMode;
    62 	bool isVymPart;
    63 	State state;			 
    64 	State laststate;
    65 	QList <State> stateStack;
    66 	QString htmldata;
    67 	int branchDepth; 
    68 	NoteObj no;
    69 	MapCenterObj* mc;
    70 	MapEditor* me; 
    71 	QString tmpDir; 
    72 	QString inputFile;
    73 }; 
    74 #endif