1 /***************************************************************************
2 phrasebookparser.h - description
4 begin : Don Sep 12 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.de
7 ***************************************************************************/
9 /***************************************************************************
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. *
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"
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
{
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. */
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. */
62 /** returns a list of phrase book entries */
63 PhraseBookEntryList
getPhraseList();
71 PhraseBookEntryList list
;