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
22 #include <q3valuestack.h>
23 #include "phrasebook.h"
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
{
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. */
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. */
60 /** returns a list of phrase book entries */
61 PhraseBookEntryList
getPhraseList();
69 PhraseBookEntryList list
;