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 /kttsd/filters/xhtml2ssml/xhtml2ssml.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 'kttsd/filters/xhtml2ssml/xhtml2ssml.h')
-rw-r--r-- | kttsd/filters/xhtml2ssml/xhtml2ssml.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/kttsd/filters/xhtml2ssml/xhtml2ssml.h b/kttsd/filters/xhtml2ssml/xhtml2ssml.h new file mode 100644 index 0000000..7271dc0 --- /dev/null +++ b/kttsd/filters/xhtml2ssml/xhtml2ssml.h @@ -0,0 +1,61 @@ + +/**************************************************************************** + XHTMLToSSMLParser class + + Parses a piece of XHTML markup and converts into SSML. + ------------------- + Copyright: + (C) 2004 by Paul Giannaros <ceruleanblaze@gmail.com> + ------------------- + Original author: Paul Giannaros <ceruleanblaze@gmail.com> +******************************************************************************/ + +/*************************************************************************** + * * + * 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; version 2 of the License. * + * * + ***************************************************************************/ + + +#ifndef _XHTML2SSML_H_ +#define _XHTML2SSML_H_ + +#include <qxml.h> +#include <qmap.h> + +typedef QMap<QString, QString> QStringMap; +class QString; + +class XHTMLToSSMLParser : public QXmlDefaultHandler { + +public: + /// No need to reimplement constructor.. + /// The document parsing starts + bool startDocument(); + /// start of an element encountered (<element foo="bar">) + bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts); + /// end of an element encountered (</element>) + bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName); + /// text encountered (blah bah blah) + bool characters(const QString &); + + /// Get the output text that was generated during the parsing. + /// @returns The converted text. + QString convertedText(); + + /// Parse a line from the configuration file which maps xhtml : ssml equivalent. + /// It makes entries in the m_xhtml2ssml map accordingly. + /// @param line A line from a file to parse + /// @returns true if the syntax of the line was okay and the parsing succeeded - false otherwise. + bool readFileConfigEntry(const QString &line); + +private: + /// Dict of xhtml tags -> ssml tags + QStringMap m_xhtml2ssml; + /// The output of the conversion + QString m_output; +}; + +#endif |