xml.h
author insilmaril
Wed Jan 25 09:33:50 2006 +0000 (2006-01-25)
changeset 196 a9493dcaa306
parent 166 325958acb69b
child 239 bdeb503d2b7f
permissions -rw-r--r--
changed default location of exports to ~/.vym/exports
     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 setLoadMode (const LoadMode &);
    30 	bool readBranchAttr (const QXmlAttributes&);
    31 	bool readLinkAttr (const QXmlAttributes&);
    32 	bool readNoteAttr (const QXmlAttributes&);
    33 	bool readFloatImageAttr (const QXmlAttributes&);
    34 	bool readXLinkAttr (const QXmlAttributes&);
    35 	bool readHtmlAttr (const QXmlAttributes&);
    36 	bool readSettingAttr (const QXmlAttributes&);
    37 
    38 private:
    39 	QString     errorProt;
    40 	enum State 
    41 	{ 
    42 		StateInit, StateMap, StateMapSelect, 
    43 		StateMapSetting,
    44 		StateFloatImage,
    45 		StateMapCenter, StateMapCenterStandardFlag,
    46 		StateMapCenterHeading, StateMapCenterNote, 
    47 		StateMapCenterFloatImage,
    48 		
    49 		StateBranch, StateBranchStandardFlag,
    50 		StateBranchHeading, StateBranchNote, 
    51 		StateBranchFloatImage, StateBranchXLink,
    52 		StateHtmlNote, StateHtml 
    53 	 };
    54 				 
    55 
    56 	LoadMode loadMode;
    57 	bool isVymPart;
    58 	State state;			 
    59 	State laststate;
    60 	QString htmldata;
    61 	int branchDepth; 
    62 	NoteObj no;
    63 	MapCenterObj* mc;
    64 	MapEditor* me; QString tmpDir; 
    65 }; 
    66 #endif