Remove this line
[kdeaccessibility.git] / kmouth / phrasebook / phrasebookparser.h
blob3be0ffaaa34fc30b53de122bfc04289f43d0268b
1 /***************************************************************************
2 phrasebookparser.h - description
3 -------------------
4 begin : Don Sep 12 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef PHRASEBOOKPARSER_H
19 #define PHRASEBOOKPARSER_H
21 #include <Qt3Support/Q3ValueStack>
22 #include <QtXml/QXmlParseException>
23 #include <QtXml/QXmlAttributes>
25 #include "phrasebook.h"
27 /**
28 * This class implements a parser for both the phrase list and for phrase
29 * books. It is intended to be used together with the Qt SAX2 framework.
30 * @author Gunnar Schmi Dt
33 class PhraseBookParser : public QXmlDefaultHandler {
34 public:
35 PhraseBookParser();
36 ~PhraseBookParser();
38 bool warning (const QXmlParseException &exception);
39 bool error (const QXmlParseException &exception);
40 bool fatalError (const QXmlParseException &exception);
41 QString errorString() const;
43 /** Processes the start of the document. */
44 bool startDocument();
46 /** Processes the start tag of an element. */
47 bool startElement (const QString &, const QString &, const QString &name,
48 const QXmlAttributes &attributes);
50 /** Processes a chunk of normal character data. */
51 bool characters (const QString &ch);
53 /** Processes whitespace. */
54 bool ignorableWhitespace (const QString &ch);
56 /** Processes the end tag of an element. */
57 bool endElement (const QString &, const QString &, const QString &name);
59 /** Processes the end of the document. */
60 bool endDocument();
62 /** returns a list of phrase book entries */
63 PhraseBookEntryList getPhraseList();
65 private:
66 bool isInPhrase;
67 bool starting;
68 int offset;
69 Phrase phrase;
71 PhraseBookEntryList list;
72 int level;
75 #endif