xml.h
author insilmaril
Mon Sep 05 16:48:10 2005 +0000 (2005-09-05)
changeset 161 88efbd21cff1
parent 95 f688a9913724
child 166 325958acb69b
permissions -rw-r--r--
copied vym-48x48.png to vym.png
     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 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 		StateMapCenter, StateMapCenterStandardFlag,
    44 		StateMapCenterHeading, StateMapCenterNote, 
    45 		StateMapCenterFloatImage,
    46 		
    47 		StateBranch, StateBranchStandardFlag,
    48 		StateBranchHeading, StateBranchNote, 
    49 		StateBranchFloatImage, StateBranchXLink,
    50 		StateHtmlNote, StateHtml 
    51 	 };
    52 				 
    53 
    54 	LoadMode loadMode;
    55 	bool isVymPart;
    56 	State state;			 
    57 	State laststate;
    58 	QString htmldata;
    59 	int branchDepth; 
    60 	NoteObj no;
    61 	MapCenterObj* mc;
    62 	MapEditor* me; QString tmpDir; 
    63 }; 
    64 #endif