xml.h
author jhilmer
Sun Jul 31 12:24:53 2005 +0000 (2005-07-31)
changeset 142 3590c3490789
parent 0 7a96bd401351
child 160 72cc3873306a
permissions -rw-r--r--
Added superscript and subscript in text editor
     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