xml.h
author insilmaril
Thu May 17 20:19:03 2007 +0000 (2007-05-17)
changeset 491 c58b3973337c
parent 407 5db8dfd30ea2
child 558 3665eee7a842
permissions -rw-r--r--
minor bugfixes
insilmaril@407
     1
#ifndef XML_H
insilmaril@407
     2
#define XML_H
insilmaril@0
     3
insilmaril@0
     4
insilmaril@407
     5
#include <QString>
insilmaril@407
     6
#include <QXmlAttributes>
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@421
    32
	bool readFrameAttr (const QXmlAttributes&);
insilmaril@247
    33
	bool readOOAttr (const QXmlAttributes&);
insilmaril@0
    34
	bool readNoteAttr (const QXmlAttributes&);
insilmaril@0
    35
	bool readFloatImageAttr (const QXmlAttributes&);
insilmaril@95
    36
	bool readXLinkAttr (const QXmlAttributes&);
insilmaril@0
    37
	bool readHtmlAttr (const QXmlAttributes&);
insilmaril@0
    38
	bool readSettingAttr (const QXmlAttributes&);
insilmaril@0
    39
insilmaril@0
    40
private:
insilmaril@0
    41
	QString     errorProt;
insilmaril@0
    42
	enum State 
insilmaril@0
    43
	{ 
insilmaril@421
    44
		StateInit, 
insilmaril@421
    45
		StateMap, 
insilmaril@421
    46
		StateMapSelect, 
insilmaril@0
    47
		StateMapSetting,
insilmaril@421
    48
		StateMapCenter, 
insilmaril@421
    49
		StateBranch, 
insilmaril@421
    50
		StateBranchXLink,			//
insilmaril@421
    51
		StateHtmlNote, 
insilmaril@421
    52
		StateHtml, 
insilmaril@421
    53
		StateFrame,
insilmaril@421
    54
		StateStandardFlag,
insilmaril@421
    55
		StateNote,
insilmaril@166
    56
		StateFloatImage,
insilmaril@421
    57
		StateHeading
insilmaril@0
    58
	 };
insilmaril@0
    59
				 
insilmaril@0
    60
insilmaril@0
    61
	LoadMode loadMode;
insilmaril@0
    62
	bool isVymPart;
insilmaril@0
    63
	State state;			 
insilmaril@0
    64
	State laststate;
insilmaril@421
    65
	QList <State> stateStack;
insilmaril@0
    66
	QString htmldata;
insilmaril@0
    67
	int branchDepth; 
insilmaril@0
    68
	NoteObj no;
insilmaril@0
    69
	MapCenterObj* mc;
insilmaril@239
    70
	MapEditor* me; 
insilmaril@239
    71
	QString tmpDir; 
insilmaril@239
    72
	QString inputFile;
insilmaril@0
    73
}; 
insilmaril@0
    74
#endif