xml.h
author insilmaril
Mon, 10 Apr 2006 11:21:35 +0000
changeset 288 24a51ea91118
parent 247 5dfbe972d9df
child 407 5db8dfd30ea2
permissions -rw-r--r--
switching to KDE icons
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@169
     8
#include "file.h"
insilmaril@0
     9
#include "mapcenterobj.h"
insilmaril@0
    10
#include "mapeditor.h"
insilmaril@0
    11
insilmaril@0
    12
insilmaril@0
    13
class mapBuilderHandler  : public QXmlDefaultHandler
insilmaril@0
    14
{
insilmaril@0
    15
public:
insilmaril@0
    16
	mapBuilderHandler();
insilmaril@0
    17
	~mapBuilderHandler();
insilmaril@0
    18
	QString errorProtocol();
insilmaril@0
    19
	bool startDocument();
insilmaril@166
    20
	QString parseHREF(QString);
insilmaril@0
    21
	bool startElement ( const QString&, const QString&,
insilmaril@0
    22
                        const QString& eName, const QXmlAttributes& atts ); 
insilmaril@0
    23
	bool   endElement ( const QString&, const QString&, const QString& ); 
insilmaril@0
    24
	bool characters   ( const QString&);
insilmaril@0
    25
	QString errorString();
insilmaril@0
    26
	bool fatalError( const QXmlParseException&);
insilmaril@0
    27
	void setMapEditor (MapEditor*);
insilmaril@0
    28
	void setTmpDir (QString);
insilmaril@239
    29
	void setInputFile (QString);
insilmaril@0
    30
	void setLoadMode (const LoadMode &);
insilmaril@0
    31
	bool readBranchAttr (const QXmlAttributes&);
insilmaril@247
    32
	bool readOOAttr (const QXmlAttributes&);
insilmaril@0
    33
	bool readNoteAttr (const QXmlAttributes&);
insilmaril@0
    34
	bool readFloatImageAttr (const QXmlAttributes&);
insilmaril@95
    35
	bool readXLinkAttr (const QXmlAttributes&);
insilmaril@0
    36
	bool readHtmlAttr (const QXmlAttributes&);
insilmaril@0
    37
	bool readSettingAttr (const QXmlAttributes&);
insilmaril@0
    38
insilmaril@0
    39
private:
insilmaril@0
    40
	QString     errorProt;
insilmaril@0
    41
	enum State 
insilmaril@0
    42
	{ 
insilmaril@0
    43
		StateInit, StateMap, StateMapSelect, 
insilmaril@0
    44
		StateMapSetting,
insilmaril@166
    45
		StateFloatImage,
insilmaril@0
    46
		StateMapCenter, StateMapCenterStandardFlag,
insilmaril@0
    47
		StateMapCenterHeading, StateMapCenterNote, 
insilmaril@0
    48
		StateMapCenterFloatImage,
insilmaril@0
    49
		
insilmaril@0
    50
		StateBranch, StateBranchStandardFlag,
insilmaril@0
    51
		StateBranchHeading, StateBranchNote, 
insilmaril@95
    52
		StateBranchFloatImage, StateBranchXLink,
insilmaril@0
    53
		StateHtmlNote, StateHtml 
insilmaril@0
    54
	 };
insilmaril@0
    55
				 
insilmaril@0
    56
insilmaril@0
    57
	LoadMode loadMode;
insilmaril@0
    58
	bool isVymPart;
insilmaril@0
    59
	State state;			 
insilmaril@0
    60
	State laststate;
insilmaril@0
    61
	QString htmldata;
insilmaril@0
    62
	int branchDepth; 
insilmaril@0
    63
	NoteObj no;
insilmaril@0
    64
	MapCenterObj* mc;
insilmaril@239
    65
	MapEditor* me; 
insilmaril@239
    66
	QString tmpDir; 
insilmaril@239
    67
	QString inputFile;
insilmaril@0
    68
}; 
insilmaril@0
    69
#endif