SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kttsd / filters / xhtml2ssml / xhtml2ssml.h
blob73169ce46b64edbb52effe6ac720421f6297ad7c
2 /****************************************************************************
3 XHTMLToSSMLParser class
5 Parses a piece of XHTML markup and converts into SSML.
6 -------------------
7 Copyright:
8 (C) 2004 by Paul Giannaros <ceruleanblaze@gmail.com>
9 -------------------
10 Original author: Paul Giannaros <ceruleanblaze@gmail.com>
11 ******************************************************************************/
13 /***************************************************************************
14 * *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; version 2 of the License. *
18 * *
19 ***************************************************************************/
21 #ifndef _XHTML2SSML_H_
22 #define _XHTML2SSML_H_
24 #include <QtXml>
25 #include <QtCore/QMap>
27 typedef QMap<QString, QString> QStringMap;
28 class QString;
30 class XHTMLToSSMLParser : public QXmlDefaultHandler {
32 public:
33 /// No need to reimplement constructor..
34 /// The document parsing starts
35 bool startDocument();
36 /// start of an element encountered (<element foo="bar">)
37 bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts);
38 /// end of an element encountered (</element>)
39 bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
40 /// text encountered (blah bah blah)
41 bool characters(const QString &);
43 /// Get the output text that was generated during the parsing.
44 /// @returns The converted text.
45 QString convertedText();
47 /// Parse a line from the configuration file which maps xhtml : ssml equivalent.
48 /// It makes entries in the m_xhtml2ssml map accordingly.
49 /// @param line A line from a file to parse
50 /// @returns true if the syntax of the line was okay and the parsing succeeded - false otherwise.
51 bool readFileConfigEntry(const QString &line);
53 private:
54 /// Dict of xhtml tags -> ssml tags
55 QStringMap m_xhtml2ssml;
56 /// The output of the conversion
57 QString m_output;
60 #endif