diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /kgeography/src/mapparser.h | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kgeography/src/mapparser.h')
-rw-r--r-- | kgeography/src/mapparser.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/kgeography/src/mapparser.h b/kgeography/src/mapparser.h new file mode 100644 index 00000000..af3d6d1f --- /dev/null +++ b/kgeography/src/mapparser.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2004 by Albert Astals Cid * + * tsdgeos@terra.es * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef MAPPARSER_H +#define MAPPARSER_H + +#include <qxml.h> + +class division; +class KGmap; + +class mapReader : public QXmlSimpleReader +{ + public: + mapReader(); + + bool parseMap(const QString &path); + QString getError(); + KGmap *getMap(); + + private: + QString p_error; + KGmap *p_map; +}; + +class mapParser : public QXmlDefaultHandler +{ + public: + mapParser(KGmap *m, const QString &path); + bool startDocument(); + bool startElement(const QString&, const QString&, const QString&, const QXmlAttributes&); + bool endElement(const QString &, const QString &name, const QString &); + bool characters(const QString &ch); + bool endDocument(); + QString errorString(); + + private: + QString getPreviousTag() const; + void removeLastTag(); + + division *p_division; + int p_red, p_green, p_blue; + KGmap *p_map; + bool p_allowChars, p_mapNameSet, p_mapFileSet; + bool p_divisionNameSet, p_colorSet, p_divisionIgnoreSet, p_flagFileSet, p_capitalSet; + const QString &p_path; + QString p_error, p_contents, p_previousTags; +}; + +#endif |