xml.h
author insilmaril
Fri, 08 Jul 2005 07:24:43 +0000
changeset 123 09edde7ae30e
parent 95 f688a9913724
child 160 72cc3873306a
permissions -rw-r--r--
changes for 1.6.9
     1 #ifndef XLM_H
     2 #define XLM_H
     3 
     4 
     5 #include <qstring.h>
     6 #include <qxml.h>
     7 
     8 #include "mapcenterobj.h"
     9 #include "mapeditor.h"
    10 
    11 
    12 class mapBuilderHandler  : public QXmlDefaultHandler
    13 {
    14 public:
    15 	mapBuilderHandler();
    16 	~mapBuilderHandler();
    17 	QString errorProtocol();
    18 	bool startDocument();
    19 	QString mapBuilderHandler::parseHREF(QString);
    20 	bool startElement ( const QString&, const QString&,
    21                         const QString& eName, const QXmlAttributes& atts ); 
    22 	bool   endElement ( const QString&, const QString&, const QString& ); 
    23 	bool characters   ( const QString&);
    24 	QString errorString();
    25 	bool fatalError( const QXmlParseException&);
    26 	void setMapEditor (MapEditor*);
    27 	void setTmpDir (QString);
    28 	void setLoadMode (const LoadMode &);
    29 	bool readBranchAttr (const QXmlAttributes&);
    30 	bool readNoteAttr (const QXmlAttributes&);
    31 	bool readFloatImageAttr (const QXmlAttributes&);
    32 	bool readXLinkAttr (const QXmlAttributes&);
    33 	bool readHtmlAttr (const QXmlAttributes&);
    34 	bool readSettingAttr (const QXmlAttributes&);
    35 
    36 private:
    37 	QString     errorProt;
    38 	enum State 
    39 	{ 
    40 		StateInit, StateMap, StateMapSelect, 
    41 		StateMapSetting,
    42 		StateMapCenter, StateMapCenterStandardFlag,
    43 		StateMapCenterHeading, StateMapCenterNote, 
    44 		StateMapCenterFloatImage,
    45 		
    46 		StateBranch, StateBranchStandardFlag,
    47 		StateBranchHeading, StateBranchNote, 
    48 		StateBranchFloatImage, StateBranchXLink,
    49 		StateHtmlNote, StateHtml 
    50 	 };
    51 				 
    52 
    53 	LoadMode loadMode;
    54 	bool isVymPart;
    55 	State state;			 
    56 	State laststate;
    57 	QString htmldata;
    58 	int branchDepth; 
    59 	NoteObj no;
    60 	MapCenterObj* mc;
    61 	MapEditor* me; QString tmpDir; 
    62 }; 
    63 #endif