SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kmouth / phrasebook / phrasebookparser.h
blob2552fb1d0aaafccb3503eb54b2d7fa92ea3cbd1c
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 <QtXml>
22 #include <q3valuestack.h>
23 #include "phrasebook.h"
25 /**
26 * This class implements a parser for both the phrase list and for phrase
27 * books. It is intended to be used together with the Qt SAX2 framework.
28 * @author Gunnar Schmi Dt
31 class PhraseBookParser : public QXmlDefaultHandler {
32 public:
33 PhraseBookParser();
34 ~PhraseBookParser();
36 bool warning (const QXmlParseException &exception);
37 bool error (const QXmlParseException &exception);
38 bool fatalError (const QXmlParseException &exception);
39 QString errorString() const;
41 /** Processes the start of the document. */
42 bool startDocument();
44 /** Processes the start tag of an element. */
45 bool startElement (const QString &, const QString &, const QString &name,
46 const QXmlAttributes &attributes);
48 /** Processes a chunk of normal character data. */
49 bool characters (const QString &ch);
51 /** Processes whitespace. */
52 bool ignorableWhitespace (const QString &ch);
54 /** Processes the end tag of an element. */
55 bool endElement (const QString &, const QString &, const QString &name);
57 /** Processes the end of the document. */
58 bool endDocument();
60 /** returns a list of phrase book entries */
61 PhraseBookEntryList getPhraseList();
63 private:
64 bool isInPhrase;
65 bool starting;
66 int offset;
67 Phrase phrase;
69 PhraseBookEntryList list;
70 int level;
73 #endif