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 "keduvocgrade.h"
00029 #include "keduvocgrammar.h"
00030 #include "keduvocmultiplechoice.h"
00031 #include "keduvockvtmlcompability.h"
00032 #include "keduvocpersonalpronoun.h"
00033
00034 class QIODevice;
00035 class KEduVocDocument;
00036
00040 class KEduVocKvtmlReader : public QObject
00041 {
00042 Q_OBJECT
00043 public:
00044 KEduVocKvtmlReader( QIODevice *file );
00045
00046 bool readDoc( KEduVocDocument *doc );
00047
00055 bool addLanguage( int languageId, const QString& language);
00056
00057 bool readLesson( QDomElement &domElementParent );
00058 bool readArticle( QDomElement &domElementParent );
00059 bool readPersonalPronouns( QDomElement &domElementParent, KEduVocPersonalPronoun& pronouns );
00060 bool readConjugation( QDomElement &domElementParent, KEduVocConjugation &conjugation );
00061 bool readTranslationConjugations( QDomElement &domElementParent, KEduVocTranslation &translation );
00062 bool readType( QDomElement &domElementParent );
00063 bool readTense( QDomElement &domElementParent );
00064 bool readUsage( QDomElement &domElementParent );
00065 bool readComparison( QDomElement &domElementParent, KEduVocComparison &comp );
00066 bool readMultipleChoice( QDomElement &domElementParent, KEduVocMultipleChoice &mc );
00067 bool readExpressionChildAttributes( QDomElement &domElementExpressionChild,
00068 QString &lang,
00069 grade_t &grade, grade_t &rev_grade,
00070 int &count, int &rev_count,
00071 QDateTime &date, QDateTime &rev_date,
00072 QString &remark,
00073 int &bcount, int &rev_bcount,
00074 QString &query_id,
00075 QString &pronunciation,
00076 int &width,
00077 QString &type,
00078 QString &subType,
00079 QString &faux_ami_f,
00080 QString &faux_ami_t,
00081 QString &synonym,
00082 QString &example,
00083 QString &antonym,
00084 QSet<QString> &usage,
00085 QString ¶phrase );
00086 bool readExpression( QDomElement &domElementParent );
00087 bool readBody( QDomElement &domElementParent );
00088
00089 QString errorMessage() const
00090 {
00091 return m_errorMessage;
00092 }
00093
00094 private:
00095 QIODevice *m_inputFile;
00096 KEduVocDocument *m_doc;
00097 QString m_errorMessage;
00098 int m_cols;
00099 int m_lines;
00100 QStringList m_oldSelfDefinedTypes;
00101
00102 KEduVocKvtmlCompability m_compability;
00103 };
00104
00105 #endif