libkdeedu/keduvocdocument
keduvoctext.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef KEDUVOCTEXT_H
00015 #define KEDUVOCTEXT_H
00016
00017 #include "libkeduvocdocument_export.h"
00018 #include <QtCore/QDateTime>
00019
00020
00021 #define KV_MAX_GRADE 7
00022 #define KV_MIN_GRADE 0
00023
00024 #define KV_NORM_GRADE 0 // not practiced yet
00025 #define KV_NORM_TEXT I18N_NOOP("Not Practiced Yet")
00026
00027 #define KV_LEV1_GRADE 1
00028 #define KV_LEV1_TEXT I18N_NOOP("Level 1")
00029
00030 #define KV_LEV2_GRADE 2
00031 #define KV_LEV2_TEXT I18N_NOOP("Level 2")
00032
00033 #define KV_LEV3_GRADE 3
00034 #define KV_LEV3_TEXT I18N_NOOP("Level 3")
00035
00036 #define KV_LEV4_GRADE 4
00037 #define KV_LEV4_TEXT I18N_NOOP("Level 4")
00038
00039 #define KV_LEV5_GRADE 5
00040 #define KV_LEV5_TEXT I18N_NOOP("Level 5")
00041
00042 #define KV_LEV6_GRADE 6
00043 #define KV_LEV6_TEXT I18N_NOOP("Level 6")
00044
00045 #define KV_LEV7_GRADE 7
00046 #define KV_LEV7_TEXT I18N_NOOP("Level 7")
00047
00048
00049 typedef unsigned short grade_t;
00050 typedef unsigned short count_t;
00051
00052 class QDomElement;
00053
00059 class KEDUVOCDOCUMENT_EXPORT KEduVocText
00060 {
00061 public:
00063 KEduVocText(const QString& text = QString());
00064
00069 KEduVocText( const KEduVocText &other );
00070
00072 ~KEduVocText();
00073
00078 QString text() const;
00079
00084 void setText( const QString & expr );
00085
00091 KEduVocText& operator= ( const KEduVocText &other );
00097 bool operator== ( const KEduVocText &other ) const;
00098
00099
00103 count_t practiceCount() const;
00104
00108 void setPracticeCount( count_t count );
00109
00113 count_t badCount() const;
00114
00118 void setBadCount( count_t count );
00119
00121 void incBadCount();
00122
00124 void incPracticeCount();
00125
00129 void resetGrades();
00130
00134 void setGrade( grade_t grade );
00135
00139 grade_t grade() const;
00140
00142 void incGrade();
00143
00145 void decGrade();
00146
00149 QDateTime practiceDate() const;
00150
00154 void setPracticeDate( const QDateTime & date );
00155
00160 bool isEmpty();
00161
00162 void fromKVTML2(QDomElement& parent);
00163 void toKVTML2(QDomElement& parent);
00164
00165 private:
00166 class KEduVocTextPrivate;
00167 KEduVocTextPrivate * const d;
00168 };
00169
00170 #endif