xml.h
author insilmaril
Tue, 03 Jan 2006 09:44:41 +0000
changeset 167 f7efd8c7c407
parent 166 325958acb69b
child 169 aa48c7b52549
permissions -rw-r--r--
1.7.6 New features for floatimages and fixes
     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 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 readLinkAttr (const QXmlAttributes&);
    31 	bool readNoteAttr (const QXmlAttributes&);
    32 	bool readFloatImageAttr (const QXmlAttributes&);
    33 	bool readXLinkAttr (const QXmlAttributes&);
    34 	bool readHtmlAttr (const QXmlAttributes&);
    35 	bool readSettingAttr (const QXmlAttributes&);
    36 
    37 private:
    38 	QString     errorProt;
    39 	enum State 
    40 	{ 
    41 		StateInit, StateMap, StateMapSelect, 
    42 		StateMapSetting,
    43 		StateFloatImage,
    44 		StateMapCenter, StateMapCenterStandardFlag,
    45 		StateMapCenterHeading, StateMapCenterNote, 
    46 		StateMapCenterFloatImage,
    47 		
    48 		StateBranch, StateBranchStandardFlag,
    49 		StateBranchHeading, StateBranchNote, 
    50 		StateBranchFloatImage, StateBranchXLink,
    51 		StateHtmlNote, StateHtml 
    52 	 };
    53 				 
    54 
    55 	LoadMode loadMode;
    56 	bool isVymPart;
    57 	State state;			 
    58 	State laststate;
    59 	QString htmldata;
    60 	int branchDepth; 
    61 	NoteObj no;
    62 	MapCenterObj* mc;
    63 	MapEditor* me; QString tmpDir; 
    64 }; 
    65 #endif