xml.h
author insilmaril
Tue Jan 03 09:44:41 2006 +0000 (2006-01-03)
changeset 167 f7efd8c7c407
parent 160 72cc3873306a
child 169 aa48c7b52549
permissions -rw-r--r--
1.7.6 New features for floatimages and fixes
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@166
    19
	QString 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@160
    30
	bool readLinkAttr (const QXmlAttributes&);
insilmaril@0
    31
	bool readNoteAttr (const QXmlAttributes&);
insilmaril@0
    32
	bool readFloatImageAttr (const QXmlAttributes&);
insilmaril@95
    33
	bool readXLinkAttr (const QXmlAttributes&);
insilmaril@0
    34
	bool readHtmlAttr (const QXmlAttributes&);
insilmaril@0
    35
	bool readSettingAttr (const QXmlAttributes&);
insilmaril@0
    36
insilmaril@0
    37
private:
insilmaril@0
    38
	QString     errorProt;
insilmaril@0
    39
	enum State 
insilmaril@0
    40
	{ 
insilmaril@0
    41
		StateInit, StateMap, StateMapSelect, 
insilmaril@0
    42
		StateMapSetting,
insilmaril@166
    43
		StateFloatImage,
insilmaril@0
    44
		StateMapCenter, StateMapCenterStandardFlag,
insilmaril@0
    45
		StateMapCenterHeading, StateMapCenterNote, 
insilmaril@0
    46
		StateMapCenterFloatImage,
insilmaril@0
    47
		
insilmaril@0
    48
		StateBranch, StateBranchStandardFlag,
insilmaril@0
    49
		StateBranchHeading, StateBranchNote, 
insilmaril@95
    50
		StateBranchFloatImage, StateBranchXLink,
insilmaril@0
    51
		StateHtmlNote, StateHtml 
insilmaril@0
    52
	 };
insilmaril@0
    53
				 
insilmaril@0
    54
insilmaril@0
    55
	LoadMode loadMode;
insilmaril@0
    56
	bool isVymPart;
insilmaril@0
    57
	State state;			 
insilmaril@0
    58
	State laststate;
insilmaril@0
    59
	QString htmldata;
insilmaril@0
    60
	int branchDepth; 
insilmaril@0
    61
	NoteObj no;
insilmaril@0
    62
	MapCenterObj* mc;
insilmaril@0
    63
	MapEditor* me; QString tmpDir; 
insilmaril@0
    64
}; 
insilmaril@0
    65
#endif