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