Minor fix
[kdeaccessibility.git] / ksayit / src / parasaxparser.h
blobe76d6528c53461d3be1e1956af5359da711e5d7b
1 //
2 // C++ Interface: parasaxparser
3 //
4 // Description: SAX2-Parser for 'para' elements of a DocBook file.
5 //
6 //
7 // Author: Robert Vogl <voglrobe@web.de>, (C) 2005
8 //
9 // Copyright: See COPYING file that comes with this distribution
12 #ifndef PARASAXPARSER_H
13 #define PARASAXPARSER_H
15 // Qt includes
16 #include <qxml.h>
17 #include <qstring.h>
19 // App specific includes
20 #include "saxhandler.h"
22 /**
23 This class is a singleton.
24 @author Robert Vogl
26 class ParaSaxParser{
27 public:
28 ~ParaSaxParser();
30 /**
31 * Creates the single instance of this parser (if not
32 * allready exists) and returns a pointer to it.
34 static ParaSaxParser* Instance();
36 /**
37 * Because this parser sees nothing but the 'para'
38 * parts of the document, it requires the documents header
39 * info, e.g. to resolve entities defined in the internal DTD.
40 * \param data The header (preamble) of the DocBook document.
42 void setProcessingInstruction(const QString &data);
44 /**
45 * This is the 'para' element to parse. It has to be encapsulated
46 * in <para> and </para>. Nested 'para' elements are not supported.
47 * \param data See description.
49 void setData(const QString &data);
51 /**
52 * Returns the pure text content of the paragraph without tags.
53 * \param data See description.
55 void getText(QString &data);
57 /**
58 * Returns the text in RTF format, i.e. replaces DocBook tags
59 * with RTF tags.
60 * \param data See description.
62 void getRTFText(QString &data);
64 protected:
65 ParaSaxParser();
67 private:
68 static ParaSaxParser* _instance;
69 SaxHandler* m_handler;
70 QXmlSimpleReader* m_reader;
71 QString m_XmlInputHeader;
72 QString m_XmlInputBody;
77 #endif