libkdeedu/keduvocdocument
keduvockvtmlreader.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEDUVOCKVTMLREADER_H
00021 #define KEDUVOCKVTMLREADER_H
00022
00023 #include <QtXml/QDomDocument>
00024 #include <QtCore/QList>
00025
00026
00027 #include "keduvocexpression.h"
00028 #include "keduvocarticle.h"
00029 #include "keduvocmultiplechoice.h"
00030 #include "keduvockvtmlcompability.h"
00031 #include "keduvocpersonalpronoun.h"
00032
00033 class QIODevice;
00034 class KEduVocDocument;
00035
00039 class KEduVocKvtmlReader : public QObject
00040 {
00041 Q_OBJECT
00042 public:
00043 KEduVocKvtmlReader( QIODevice *file );
00044
00045 bool readDoc( KEduVocDocument *doc );
00046
00054 bool addLanguage( int languageId, const QString& language);
00055
00056 bool readLesson( QDomElement &domElementParent );
00057 bool readArticle( QDomElement &domElementParent );
00058 bool readPersonalPronouns( QDomElement &domElementParent, KEduVocPersonalPronoun& pronouns );
00059 bool readConjugation( QDomElement &domElementParent, KEduVocConjugation &conjugation );
00060 bool readTranslationConjugations( QDomElement &domElementParent, KEduVocTranslation* translation );
00061 bool readType( QDomElement &domElementParent );
00062 bool readTense( QDomElement &domElementParent );
00063 bool readUsage( QDomElement &domElementParent );
00064 bool readComparison( QDomElement &domElementParent, KEduVocTranslation* translation );
00065 bool readMultipleChoice( QDomElement &domElementParent, KEduVocTranslation* translation );
00066 bool readExpressionChildAttributes( QDomElement &domElementExpressionChild,
00067 QString &lang,
00068 grade_t &grade, grade_t &rev_grade,
00069 int &count, int &rev_count,
00070 QDateTime &date, QDateTime &rev_date,
00071 QString &remark,
00072 int &bcount, int &rev_bcount,
00073 QString &query_id,
00074 QString &pronunciation,
00075 int &width,
00076 QString &type,
00077 QString &faux_ami_f,
00078 QString &faux_ami_t,
00079 QString &synonym,
00080 QString &example,
00081 QString &antonym,
00082 QSet<QString> &usage,
00083 QString ¶phrase );
00084 bool readExpression( QDomElement &domElementParent );
00085 bool readBody( QDomElement &domElementParent );
00086
00087 QString errorMessage() const
00088 {
00089 return m_errorMessage;
00090 }
00091
00092 private:
00093 QIODevice *m_inputFile;
00094 KEduVocDocument *m_doc;
00095 QString m_errorMessage;
00096 int m_cols;
00097 int m_lines;
00098 QStringList m_oldSelfDefinedTypes;
00099
00100 KEduVocKvtmlCompability m_compability;
00101 };
00102
00103 #endif