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 | 00bb99ac80741fc50ef8a289719373032f2391eb (patch) | |
tree | 3a5a9bf72f942784b38bf77dd66c534662fab5f2 /ksayit/src/saxhandler.h | |
download | tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.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/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksayit/src/saxhandler.h')
-rw-r--r-- | ksayit/src/saxhandler.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/ksayit/src/saxhandler.h b/ksayit/src/saxhandler.h new file mode 100644 index 0000000..45061f3 --- /dev/null +++ b/ksayit/src/saxhandler.h @@ -0,0 +1,87 @@ +// +// C++ Interface: saxhandler +// +// Description: Qt SAX2-Handler +// +// +// Author: Robert Vogl <voglrobe@web.de>, (C) 2005 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef SAXHANDLER_H +#define SAXHANDLER_H + +// STL includes +#include <map> +using namespace std; + +// Qt includes +#include <qxml.h> +#include <qstring.h> + +typedef map<QString, QString> TagMapT; + + +/** +@author Robert Vogl +*/ +class SaxHandler : public QXmlDefaultHandler +{ +public: + SaxHandler(); + ~SaxHandler(); + + // Reimplementations from base class + bool startElement(const QString &namespaceURI, + const QString &localName, + const QString &qName, + const QXmlAttributes &atts ); + + bool endElement(const QString &namespaceURI, + const QString &localName, + const QString &qName); + + bool characters(const QString &ch); + + bool fatalError(const QXmlParseException &exc); + + bool resolveEntity(const QString &publicId, + const QString &systemId, + QXmlInputSource* &ret); + + bool externalEntityDecl(const QString &name, + const QString &publicId, + const QString &systemId); + + bool internalEntityDecl(const QString &name, + const QString &value); + + bool skippedEntity(const QString &name); + + /** + * Returns the parser result. + */ + void getData( QString &data ) const; + + /** + * Reset + */ + void reset(); + + /** + * Set Mode: + * \param rtf 'true' = Replace DocBook tags with RTF-tags.\n + * 'false' = Ignore tags, return text content only. + */ + void setRTF(bool rtf); + + +private: + QString m_output; + bool m_rtf; + TagMapT m_tagmap; + +}; + +#endif |