summaryrefslogtreecommitdiffstats
path: root/ksayit/src/parasaxparser.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit00bb99ac80741fc50ef8a289719373032f2391eb (patch)
tree3a5a9bf72f942784b38bf77dd66c534662fab5f2 /ksayit/src/parasaxparser.h
downloadtdeaccessibility-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/parasaxparser.h')
-rw-r--r--ksayit/src/parasaxparser.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/ksayit/src/parasaxparser.h b/ksayit/src/parasaxparser.h
new file mode 100644
index 0000000..e76d652
--- /dev/null
+++ b/ksayit/src/parasaxparser.h
@@ -0,0 +1,77 @@
+//
+// C++ Interface: parasaxparser
+//
+// Description: SAX2-Parser for 'para' elements of a DocBook file.
+//
+//
+// Author: Robert Vogl <voglrobe@web.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef PARASAXPARSER_H
+#define PARASAXPARSER_H
+
+// Qt includes
+#include <qxml.h>
+#include <qstring.h>
+
+// App specific includes
+#include "saxhandler.h"
+
+/**
+This class is a singleton.
+@author Robert Vogl
+*/
+class ParaSaxParser{
+public:
+ ~ParaSaxParser();
+
+ /**
+ * Creates the single instance of this parser (if not
+ * allready exists) and returns a pointer to it.
+ */
+ static ParaSaxParser* Instance();
+
+ /**
+ * Because this parser sees nothing but the 'para'
+ * parts of the document, it requires the documents header
+ * info, e.g. to resolve entities defined in the internal DTD.
+ * \param data The header (preamble) of the DocBook document.
+ */
+ void setProcessingInstruction(const QString &data);
+
+ /**
+ * This is the 'para' element to parse. It has to be encapsulated
+ * in <para> and </para>. Nested 'para' elements are not supported.
+ * \param data See description.
+ */
+ void setData(const QString &data);
+
+ /**
+ * Returns the pure text content of the paragraph without tags.
+ * \param data See description.
+ */
+ void getText(QString &data);
+
+ /**
+ * Returns the text in RTF format, i.e. replaces DocBook tags
+ * with RTF tags.
+ * \param data See description.
+ */
+ void getRTFText(QString &data);
+
+protected:
+ ParaSaxParser();
+
+private:
+ static ParaSaxParser* _instance;
+ SaxHandler* m_handler;
+ QXmlSimpleReader* m_reader;
+ QString m_XmlInputHeader;
+ QString m_XmlInputBody;
+
+
+};
+
+#endif