VocabParser.h
Go to the documentation of this file.00001 #ifndef VOCAB_PARSER_H
00002 #define VOCAB_PARSER_H
00003
00004 #include <iostream.h>
00005 #include <qfile.h>
00006 #include <qmessagebox.h>
00007 #include <qstring.h>
00008 #include <qstringlist.h>
00009 #include <qxml.h>
00010 #include <stdlib.h>
00011 #include <string.h>
00012 #include "BilingualKey.h"
00013 #include "Term.h"
00014 #include "Translation.h"
00015 #include "Vocabulary.h"
00016
00017 class VocabParser : public QXmlDefaultHandler {
00018
00019 public:
00020
00021 VocabParser( Vocabulary& vocabulary, const QStringList& languages );
00022 bool startDocument();
00023 bool startElement( const QString&, const QString&, const QString&, const QXmlAttributes& attribs );
00024 bool characters( const QString& characters );
00025 bool endElement( const QString&, const QString&, const QString& qname );
00026 bool endDocument();
00027
00028 bool fatalError( const QXmlParseException& exception );
00029
00030 bool isVocabularyFile();
00031
00032 private:
00033
00034 QString lang;
00035 QString word;
00036 QString comment;
00037 BilingualKey commentKey;
00038 QString alt;
00039
00040 QString desc;
00041
00042 QString tempCh;
00043 bool mustKeepText;
00044
00045 Term term;
00046 Vocabulary& vocabulary;
00047 const QStringList& languages;
00048 bool isVocabFile;
00049
00050
00051 };
00052
00053 #endif