]> Git trees. - libqmvoc.git/commitdiff
Start of a KEduVocTranslation class - pretty empty still and I cannot seem to get...
authorFrederik Gladhorn <gladhorn@kde.org>
Sun, 10 Jun 2007 22:09:15 +0000 (22:09 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Sun, 10 Jun 2007 22:09:15 +0000 (22:09 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=673721

kdeeducore/CMakeLists.txt
kdeeducore/keduvocexpression.cpp
kdeeducore/keduvockvtmlreader.cpp
kdeeducore/keduvoctranslation.cpp [new file with mode: 0644]
kdeeducore/keduvoctranslation.h [new file with mode: 0644]

index ff93e1fb5162d52b4afaf4e0bded6eeb3b40511d..a6bd78468ae7b614c9930d8d19c5c84c15b5cc85 100644 (file)
@@ -6,6 +6,7 @@ set(kdeeducore_LIB_SRCS
    keduvoccsvwriter.cpp
    keduvocdocument.cpp
    keduvocexpression.cpp
+   keduvoctranslation.cpp
    keduvocgrammar.cpp
    keduvockvtmlreader.cpp
    keduvockvtmlwriter.cpp
index 80e92d57f136f1a00ea108a7468a07fd0d86e5e6..638273721dde9cdf3ec1072d429c7f1f478e13cb 100644 (file)
@@ -18,6 +18,7 @@
 #include <KDebug>
 
 #include "keduvocexpression.h"
+#include "keduvoctranslation.h"
 
 
 class KEduVocExpression::KEduVocExpressionPrivate
@@ -39,7 +40,7 @@ public:
 
   // all these vectors must be deleted in removeTranslation()
   QStringList m_expressionTypes;
-  QStringList m_translations;
+//  QStringList m_translations;
   QStringList m_remarks;
   QStringList m_usageLabels;
   QStringList m_paraphrases;
@@ -66,11 +67,15 @@ public:
   int m_lesson;
   bool m_inQuery;
   bool m_active;
+
+  QMap <int, KEduVocTranslation> m_translations;
 };
 
 
 void KEduVocExpression::KEduVocExpressionPrivate::init()
 {
+  m_translations.clear();
+
   m_grades.append(KV_NORM_GRADE);
   m_reverseGrades.append(KV_NORM_GRADE);
   m_inQuery = false;
@@ -90,8 +95,8 @@ void KEduVocExpression::KEduVocExpressionPrivate::init()
 bool KEduVocExpression::KEduVocExpressionPrivate::operator==(const KEduVocExpression::KEduVocExpressionPrivate &p) const
 {
   return
-    m_expressionTypes == p.m_expressionTypes &&
     m_translations == p.m_translations &&
+    m_expressionTypes == p.m_expressionTypes &&
     m_remarks == p.m_remarks &&
     m_usageLabels == p.m_usageLabels &&
     m_paraphrases == p.m_paraphrases &&
@@ -176,8 +181,10 @@ KEduVocExpression::~KEduVocExpression()
 
 int KEduVocExpression::translationCount() const
 {
-  /// @todo: once we get rid of the idea that there exists an original this should return simply d->m_translations.count().
-  return d->m_translations.count() - 1;
+  /// @todo: maybe this should go away? it is very rare with QMap
+  // the minus 1 is because traditionally it used to be original + translations
+  /// @todo get rid of the minus one. but for now this implies too many other changes.
+  return d->m_translations.size() - 1;
 }
 
 
@@ -474,7 +481,7 @@ void KEduVocExpression::setPronunciation(int index, const QString & expr)
 
 void KEduVocExpression::addTranslation(const QString & expr, grade_t grade, grade_t rev_grade)
 {
-  if (d->m_translations.count() > 0) { // we only keep grades for translation 1..n - later this will change, as all combinations are allowed, so only from grades are saved relative to the other languages.
+  if (d->m_translations.count() > 0) { // we only keep grades for translation 1..n - later this will change, as all combinations are allowed, so only from grades are saved relative to the other languages. As soon as grades are only from grades and moved into the translation class this will become nice and free of sorrows.
     if (grade > KV_MAX_GRADE)
         grade = KV_MAX_GRADE;
 
@@ -484,21 +491,28 @@ void KEduVocExpression::addTranslation(const QString & expr, grade_t grade, grad
     d->m_grades.append(grade);
     d->m_reverseGrades.append(rev_grade);
   }
-  d->m_translations.append(expr.simplified());
+  //d->m_translations.append(expr.simplified());
+
+  // keys are always in ascending order, so we can insert with the last key + 1
+  // I suppose we deprecate this in favor of setTranslation(index, ... )
+  d->m_translations[d->m_translations.keys()[d->m_translations.keys().count()-1] + 1]
+    = KEduVocTranslation( expr.simplified() );
 }
 
 
 QString KEduVocExpression::translation(int index) const
 {
-  if (index > d->m_translations.count() - 1 || index < 0) {
+  if ( !d->m_translations.contains(index) ) {
     return "";
   }
-  return d->m_translations[index];
+  return d->m_translations.value(index).translation();
 }
 
 
 void KEduVocExpression::removeTranslation(int index)
 {
+    /// @todo IMPLEMENT ME - this will be really easy to implement as soon as the translation class contains all this rubbish.
+/*
   if (index < 0)
     return;
 
@@ -571,6 +585,7 @@ void KEduVocExpression::removeTranslation(int index)
 
   if (index < d->m_reverseQueryDates.count())
     d->m_reverseQueryDates.removeAt(index - 1);
+*/
 }
 
 
@@ -579,12 +594,18 @@ void KEduVocExpression::setTranslation(int index, const QString & expr)
   if (index < 0)
     return;
 
+///@todo get rid of this nonsense:
+/* not needed with qmap but for now all translations <= index are expected to exist
   // extend translations with empty strings if necessary
   for (int i = d->m_translations.count(); i < index + 1; i++) {
       d->m_translations.append("");
   }
-
+*/
+  for (int i = d->m_translations.count(); i <= index; i++) {
+      d->m_translations[i] = KEduVocTranslation("");
+  }
 //  if (index <= translations.count())
+
   d->m_translations[index] = expr.simplified();
 }
 
@@ -908,11 +929,18 @@ QString KEduVocExpression::original() const
 
 void KEduVocExpression::setOriginal(const QString & expr)
 {
+    if ( d->m_translations.contains(0) ) {
+        d->m_translations[0].setTranslation(expr);
+    } else {
+        d->m_translations[0] = KEduVocTranslation(expr);
+    }
+
+    /*
   if (d->m_translations.count() == 0) {
     d->m_translations.append(expr);
   } else {
     d->m_translations[0] = expr;
-  }
+  }*/
 }
 
 
index 925a879673d85508ab2707ee392ba42e90c210d4..0f24b4aed6fe97374873297c66cc72156267e06f 100644 (file)
@@ -295,7 +295,7 @@ bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent)
       }
       else
       {
-        if (!attribute.isNull() && attribute.value() != (i == 0 ? m_doc->originalIdentifier():m_doc->identifier(i)))
+        if (!attribute.isNull() && attribute.value() != (m_doc->identifier(i)))
         {
           // different originals ?
           m_errorMessage = i18n("Ambiguous definition of language code");
diff --git a/kdeeducore/keduvoctranslation.cpp b/kdeeducore/keduvoctranslation.cpp
new file mode 100644 (file)
index 0000000..4aedd7b
--- /dev/null
@@ -0,0 +1,418 @@
+//
+// C++ Implementation: KEduVocTranslationtranslation
+//
+// Description:
+//
+//
+// Author: Frederik Gladhorn <frederik.gladhorn@kdemail.net>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+//#include "keduvocexpression.h"
+
+#include "keduvoctranslation.h"
+#include <KDebug>
+
+class KEduVocTranslationPrivate
+{
+public:
+/*
+    KEduVocTranslationPrivate () // ( KEduVocTranslation* qq )
+            //: q ( qq )
+    {
+        kDebug() << "KEduVocTranslationPrivate()" <<endl;
+        init();
+    }
+
+    void init();
+
+    KEduVocTranslationPrivate& operator=(const KEduVocTranslationPrivate &translation);
+    bool operator== ( const KEduVocTranslationPrivate &p ) const;
+
+    //KEduVocTranslation* q;
+*/
+    QString m_translation; // This is the word itself. The vocabulary. This is what it is all about.
+
+//     QString m_types; // noun:male etc (language dependend)
+//     QString m_usageLabel;
+//     QString m_comment;
+//     QString m_paraphrase;
+//     QString m_synonym;
+//     QString m_example;
+//     QString m_antonym;
+//     QString m_pronunciation;
+//
+//     //QMap<int, KEduVocConjugation> m_conjugations; /// Conjugations are numbered 0..n with respect to the tenses they are for.
+//
+//     KEduVocComparison m_comparison;
+//
+//     KEduVocMultipleChoice m_multipleChoice;
+
+        // Here come all int indexFrom grades. (If you want, imagine the TO grades as int indexFrom of the other translation. That is where they belong. )
+    // User is asked to give THIS here as answer, than the grades go here.
+    // User answers, this is the source, grades go to the other translation.
+    // Grades go to the translation the user has to supply.
+    //not all have to be supplied
+
+    //QMap<int, TranslationGrade> m_grades;
+
+    // one false friend per other language is allowed
+    //QMap<int, QString> m_falseFriends;
+
+};
+
+/*
+void KEduVocTranslation::KEduVocTranslationPrivate::init()
+{
+kDebug() << "KEduVocTranslation::KEduVocTranslationPrivate::init()" << endl;
+    m_translation = QString();
+}
+*/
+/*
+bool KEduVocTranslation::KEduVocTranslationPrivate::operator== ( const KEduVocTranslation::KEduVocTranslationPrivate &p ) const
+{
+    /// @todo when it's all more defined...
+    return m_translation == p.m_translation;
+
+/*
+    return m_original == p.m_original &&
+           m_expressionTypes == p.m_expressionTypes &&
+           m_translations == p.m_translations &&
+           m_remarks == p.m_remarks &&
+           m_usageLabels == p.m_usageLabels &&
+           m_paraphrases == p.m_paraphrases &&
+           m_fauxAmi == p.m_fauxAmi &&
+           m_reverseFauxAmi == p.m_reverseFauxAmi &&
+           m_synonym == p.m_synonym &&
+           m_example == p.m_example &&
+           m_antonym == p.m_antonym &&
+           m_pronunciations == p.m_pronunciations &&
+           m_grades == p.m_grades &&
+           m_reverseGrades == p.m_reverseGrades &&
+           m_queryCounts == p.m_queryCounts &&
+           m_reverseQueryCounts == p.m_reverseQueryCounts &&
+           m_badCounts == p.m_badCounts &&
+           m_reverseBadCounts == p.m_reverseBadCounts &&
+           m_queryDates == p.m_queryDates &&
+           m_reverseQueryDates == p.m_reverseQueryDates &&
+           m_conjugations == p.m_conjugations &&
+           m_comparisons == p.m_comparisons &&
+           m_multipleChoices == p.m_multipleChoices &&
+           m_leitnerBox == p.m_leitnerBox &&
+           m_sortIndex == p.m_sortIndex &&
+           m_inQuery == p.m_inQuery &&
+           m_active == p.m_active;
+           */
+/*}
+*/
+/*
+void KEduVocTranslation::KEduVocTranslationPrivate::operator= ( const KEduVocTranslation::KEduVocTranslationPrivate &p )
+{
+    kDebug() << "KEduVocTranslation::KEduVocTranslationPrivate::operator=" << endl;
+}
+*/
+
+KEduVocTranslation::KEduVocTranslation() //: d ( new KEduVocTranslationPrivate )
+{
+}
+
+
+KEduVocTranslation::KEduVocTranslation( const QString &translation ) //: d ( new KEduVocTranslationPrivate )
+{
+    m_translation = translation.simplified();
+}
+
+
+KEduVocTranslation::~KEduVocTranslation()
+{
+    //delete d;
+}
+
+QString KEduVocTranslation::translation ( ) const
+{
+    return m_translation;
+}
+
+
+void KEduVocTranslation::setTranslation ( const QString & expr )
+{
+    m_translation = expr.simplified();
+}
+
+
+/**
+    @todo CHANGE ALL [index] to .value(index) in get methods! otherwise the element is automatically created!!!
+*/
+
+
+// QString KEduVocTranslation::comment ( ) const
+// {
+//     return d->m_comment;
+// }
+//
+//
+// void KEduVocTranslation::setComment ( const QString & expr )
+// {
+//     d->m_comment = expr.simplified();
+// }
+//
+//
+// void KEduVocTranslation::setFalseFriend ( int indexFrom, const QString & expr )
+// {
+// //    d->m_falseFriends[indexFrom] = expr.simplified();
+// }
+//
+//
+// QString KEduVocTranslation::falseFriend ( int indexFrom ) const
+// {
+// //    return d->m_falseFriends.value(indexFrom);
+// return QString();
+// }
+//
+//
+// void KEduVocTranslation::setSynonym (  const QString & expr )
+// {
+//     d->m_synonym = expr.simplified();
+// }
+//
+//
+// QString KEduVocTranslation::synonym ( ) const
+// {
+//     return d->m_synonym;
+// }
+//
+//
+// void KEduVocTranslation::setExample (  const QString & expr )
+// {
+//    d->m_example = expr.simplified();
+// }
+//
+//
+// QString KEduVocTranslation::example ( ) const
+// {
+//     return d->m_example;
+// }
+//
+//
+// void KEduVocTranslation::setUsageLabel (  const QString & usage )
+// {
+//     d->m_usageLabel = usage;
+// }
+//
+//
+// QString KEduVocTranslation::usageLabel () const
+// {
+//     return d->m_usageLabel;
+// }
+//
+//
+// void KEduVocTranslation::setParaphrase (  const QString & expr )
+// {
+//     d->m_paraphrase = expr.simplified();
+// }
+//
+//
+// QString KEduVocTranslation::paraphrase ( ) const
+// {
+//     return d->m_paraphrase;
+// }
+//
+//
+// void KEduVocTranslation::setAntonym (  const QString & expr )
+// {
+//     d->m_antonym = expr.simplified();
+// }
+//
+//
+// QString KEduVocTranslation::antonym ( ) const
+// {
+//     return d->m_antonym;
+// }
+//
+//
+// void KEduVocTranslation::setConjugation ( int tense, const KEduVocConjugation &con )
+// {
+// //    d->m_conjugations[tense] = con;
+// }
+//
+//
+// KEduVocConjugation KEduVocTranslation::conjugation ( int tense ) const
+// {
+// //    return d->m_conjugations.value(tense);
+// }
+//
+//
+// void KEduVocTranslation::setComparison (  const KEduVocComparison &con )
+// {
+//     d->m_comparison = con;
+// }
+//
+//
+// KEduVocComparison KEduVocTranslation::comparison ( ) const
+// {
+//     return d->m_comparison;
+// }
+//
+//
+// void KEduVocTranslation::setMultipleChoice (  const KEduVocMultipleChoice &mc )
+// {
+//     d->m_multipleChoice = mc;
+// }
+//
+//
+// KEduVocMultipleChoice KEduVocTranslation::multipleChoice ( ) const
+// {
+//     return d->m_multipleChoice;
+// }
+//
+//
+// QString KEduVocTranslation::pronunciation ( ) const
+// {
+//     return d->m_pronunciation;
+// }
+//
+//
+// void KEduVocTranslation::setPronunciation (  const QString & expr )
+// {
+//     d->m_pronunciation = expr.simplified();
+// }
+//
+//
+// grade_t KEduVocTranslation::grade (  int indexFrom ) const
+// {
+// //    return d->m_grades.value(indexFrom).m_grade;
+// }
+//
+//
+// void KEduVocTranslation::setGrade (  int indexFrom, grade_t grade )
+// {
+//     if ( grade > KV_MAX_GRADE )
+//         grade = KV_MAX_GRADE;
+//     if ( grade < KV_MIN_GRADE )
+//         grade = KV_MIN_GRADE;
+// //    d->m_grades[indexFrom].m_grade = grade;
+// }
+//
+//
+// void KEduVocTranslation::incGrade (  int indexFrom )
+// {
+//     setGrade ( indexFrom, grade( indexFrom) + 1 );
+// }
+//
+//
+// void KEduVocTranslation::decGrade (  int indexFrom )
+// {
+//     setGrade ( indexFrom, grade( indexFrom) - 1 );
+// }
+//
+//
+// count_t KEduVocTranslation::queryCount (  int indexFrom )  const
+// {
+// //    return d->m_grades.value(indexFrom).m_queryCount;
+// }
+//
+//
+// void KEduVocTranslation::setQueryCount (  int indexFrom, count_t count )
+// {
+// //    d->m_grades[indexFrom].m_queryCount = count;
+// }
+//
+//
+// count_t KEduVocTranslation::badCount (  int indexFrom ) const
+// {
+// //    return d->m_grades.value(indexFrom).m_badCount;
+// }
+//
+//
+// void KEduVocTranslation::setBadCount (  int indexFrom, count_t count )
+// {
+// //    d->m_grades[indexFrom].m_badCount = count;
+// }
+//
+//
+// QDateTime KEduVocTranslation::queryDate (  int indexFrom ) const
+// {
+// //    return d->m_grades.value(indexFrom).m_queryDate;
+// }
+//
+//
+// void KEduVocTranslation::setQueryDate (  int indexFrom, const QDateTime & date )
+// {
+// //    d->m_grades[indexFrom].m_queryDate = date;
+// }
+//
+//
+// bool KEduVocTranslation::uniqueType() const
+// { ///@todo what is this??? I have no clue... help!
+// /*
+//     bool unique = true;
+//     QString type0 = type ( 0 );
+//     for ( int i = 1; i < translationCount(); i++ )
+//         if ( type0 != type ( i ) )
+//             unique = false;
+//     return unique; */
+//     return false;
+// }
+//
+//
+// QString KEduVocTranslation::type() const
+// {
+//     return d->m_types;
+// }
+//
+//
+// void KEduVocTranslation::setType (  const QString &type )
+// {
+//     d->m_types = type;
+// }
+//
+//
+// void KEduVocTranslation::incQueryCount (  int indexFrom )
+// {
+//     setQueryCount ( indexFrom, queryCount ( indexFrom ) + 1 );
+// }
+//
+//
+// void KEduVocTranslation::incBadCount (  int indexFrom )
+// {
+//     setBadCount ( indexFrom, badCount ( indexFrom ) + 1 );
+// }
+//
+//
+// void KEduVocTranslation::resetGrades(){
+// //    d->m_grades.clear();
+// }
+//
+//
+// QList< int > KEduVocTranslation::conjugationTenses() const
+// {
+// //    return d->m_conjugations.keys();
+// }
+
+bool KEduVocTranslation::operator ==(const KEduVocTranslation & translation) const
+{
+    return m_translation == translation.m_translation;
+    //return ( *d == *translation.d );
+}
+
+
+KEduVocTranslation & KEduVocTranslation::operator =(const KEduVocTranslation & translation)
+{
+    // Check for self-assignment!
+    if (this == &translation) {      // Same object?
+      return *this;        // Yes, so skip assignment, and just return *this.
+      kDebug() << "Warning - self assignment" << endl;
+    }
+//kDebug() << "KEduVocTranslation & KEduVocTranslation::operator =(const KEduVocTranslation & translation)" << translation.d->m_translation << " d: " << d << endl;
+
+    m_translation = translation.m_translation;
+
+//    *d = *translation.d;
+
+//    d->m_translation = translation.d->m_translation;
+kDebug() << "KEduVocTranslation & KEduVocTranslation::operator =(const KEduVocTranslation & translation)" << translation.m_translation << "This: " << this << endl;
+    return *this;
+}
+
diff --git a/kdeeducore/keduvoctranslation.h b/kdeeducore/keduvoctranslation.h
new file mode 100644 (file)
index 0000000..7715562
--- /dev/null
@@ -0,0 +1,376 @@
+//
+// C++ Interface: keduvocexpressiontranslation
+//
+// Description:
+//
+//
+// Author: Frederik Gladhorn <frederik.gladhorn@kdemail.net>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#ifndef KEDUVOCEXPRESSIONTRANSLATION_H
+#define KEDUVOCEXPRESSIONTRANSLATION_H
+
+
+#include <libkdeedu_core_export.h>
+
+/*
+#define KV_MAX_GRADE       7
+#define KV_MIN_GRADE       0
+
+#define KV_NORM_GRADE      0       // not queried yet
+#define KV_NORM_COLOR      Qt::black
+#define KV_NORM_TEXT       I18N_NOOP("Not Queried Yet")
+
+#define KV_LEV1_GRADE      1
+#define KV_LEV1_TEXT       I18N_NOOP("Level 1")
+
+#define KV_LEV2_GRADE      2
+#define KV_LEV2_TEXT       I18N_NOOP("Level 2")
+
+#define KV_LEV3_GRADE      3
+#define KV_LEV3_TEXT       I18N_NOOP("Level 3")
+
+#define KV_LEV4_GRADE      4
+#define KV_LEV4_TEXT       I18N_NOOP("Level 4")
+
+#define KV_LEV5_GRADE      5
+#define KV_LEV5_TEXT       I18N_NOOP("Level 5")
+
+#define KV_LEV6_GRADE      6
+#define KV_LEV6_TEXT       I18N_NOOP("Level 6")
+
+#define KV_LEV7_GRADE      7
+#define KV_LEV7_TEXT       I18N_NOOP("Level 7")
+*/
+#include <QtCore/QDateTime>
+#include <QMap>
+#include <QString>
+
+//#include "keduvocgrammar.h"
+//#include "keduvocconjugation.h"
+//#include "keduvocmultiplechoice.h"
+/*
+///@todo move this into a seperate header, I guess
+typedef signed char grade_t;
+typedef unsigned short count_t;
+*/
+
+/**
+       @author Frederik Gladhorn <frederik.gladhorn@kdemail.net>
+*/
+
+
+class KEduVocTranslationPrivate;
+
+class KDEEDUCORE_EXPORT KEduVocTranslation
+{
+public:
+    KEduVocTranslation( );
+    KEduVocTranslation( const QString &translation );
+
+    ~KEduVocTranslation();
+
+    QString translation ( ) const;
+    void setTranslation ( const QString & expr );
+
+
+//     void resetGrades();
+//
+//
+//   /** sets the pronunciation of this expression
+//    *
+//    * @param index            index of expression
+//    * @param expression       pronunciation of this index
+//    */
+//   void setPronunciation( const QString & expression);
+//
+//   /** returns the pronunciation of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 pronunciation or "" if none available
+//    */
+//   QString pronunciation() const;
+//
+//   /** returns comments of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 comment or "" if no comment available
+//    */
+//   QString comment() const;
+//
+//   /** sets comment of this expression
+//    *
+//    * @param index            index of expression
+//    * @param expr             comment of this index
+//    */
+//   void setComment( const QString & expr);
+//
+//   /** sets false friend of this expression
+//    *
+//    * @param index            index of expression
+//    * @param indexint indexFrom        index of original translation
+//    * @param expression       false friend of this index
+//    */
+//   void setFalseFriend( int indexFrom, const QString & expression );
+//
+//   /** returns false friend of this expression
+//    *
+//    * @param index            index of expression
+//
+//    * @return                 false friend or "" if no string available
+//    */
+//   QString falseFriend( int indexFrom) const;
+//
+//   /** sets synonym this expression
+//    *
+//    * @param index            index of expression
+//    * @param expression       synonym of this index
+//    */
+//   void setSynonym( const QString & expression);
+//
+//   /** returns synonym of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 synonym or "" if no string available
+//    */
+//   QString synonym() const;
+//
+//   /** sets example this expression
+//    *
+//    * @param index            index of expression
+//    * @param expression       example of this index
+//    */
+//   void setExample( const QString & expression);
+//
+//   /** returns example of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 example or "" if no string available
+//    */
+//   QString example() const;
+//
+//   /** sets usage label this expression
+//    *
+//    * @param index            index of expression
+//    * @param usage            usage label of this index
+//    */
+//   void setUsageLabel( const QString & usage);
+//
+//   /** returns usage label of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 usage or "" if no string available
+//    */
+//   QString usageLabel() const;
+//
+//   /** sets paraphrase of this expression
+//    *
+//    * @param index            index of expression
+//    * @param expression       paraphrase of this index
+//    */
+//   void setParaphrase( const QString & expression);
+//
+//   /** returns paraphrase of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 paraphrase or "" if no string available
+//    */
+//   QString paraphrase() const;
+//
+//   /** sets antonym this expression
+//    *
+//    * @param index            index of expression
+//    * @param expression       antonym of this index
+//    */
+//   void setAntonym( const QString & expression);
+//
+//   /** returns antonym of this expression
+//    *
+//    * @param index            index of expression
+//    * @return                 antonym or "" if no string available
+//    */
+//   QString antonym() const;
+//
+//   /** returns type of this expression
+//    *
+//    * @return                 type or "" if no type available
+//    */
+//   QString type() const;
+//
+//   void setType(const QString& type);
+//
+//   /** all langs have same type ?
+//    *
+//    * @return                 true if all have same type
+//    */
+//   bool uniqueType () const;
+//
+//   /** sets type of this expression
+//    *
+//    * @param index            index of type
+//    * @param type             type of this expression ("" = none)
+//    */
+//   void appendType( const KEduVocType &type);
+//
+//   /** sets grade of given translation
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//    * @param grade            number of knowlegde: 0=known, x=numbers not knows
+//    */
+//   void setGrade( int indexFrom, grade_t grade );
+//
+//   /** returns grade of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom          the identifier displayed to the user
+//    * @return                 number of knowlegde: 0=known, x=numbers not knows
+//    */
+//   grade_t grade( int indexFrom ) const;
+//
+//   /** increments grade of given translation
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//
+//    */
+//   void incGrade(  int indexFrom );
+//
+//   /** decrements grade of given translation
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//
+//    */
+//   void decGrade(  int indexFrom );
+//
+//   /** returns last query date of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//
+//    */
+//   QDateTime queryDate(  int indexFrom ) const;
+//
+//   /** set last query date of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//    * @param date             the new date
+//
+//    */
+//   void setQueryDate(  int indexFrom, const QDateTime & date );
+//
+//   /** returns conjugations if available
+//    *
+//    * @param index            index of translation
+//    */
+//   KEduVocConjugation conjugation( int tense ) const;
+//
+//   /** sets conjugations
+//    *
+//    * @param index            index of translation
+//    * @param conjugation      conjugation block
+//    */
+//   void setConjugation( int tense, const KEduVocConjugation & conjugation);
+//     QList<int> conjugationTenses() const;
+//   /** returns comparison if available
+//    *
+//    * @param index            index of translation
+//    */
+//   KEduVocComparison comparison() const;
+//
+//   /** sets comparison
+//    *
+//    * @param index            index of translation
+//    * @param comparison       comparison block
+//    */
+//   void setComparison( const KEduVocComparison & comparison);
+//
+//   /** returns multiple choice if available
+//    *
+//    * @param index            index of multiple choice
+//    */
+//   KEduVocMultipleChoice multipleChoice() const;
+//
+//   /** sets multiple choice
+//    *
+//    * @param index            index of translation
+//    * @param mc               multiple choice block
+//    */
+//   void setMultipleChoice( const KEduVocMultipleChoice &mc);
+//
+//
+//   /** returns query count of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//
+//    */
+//   count_t queryCount(  int indexFrom  ) const;
+//
+//   /** set query count of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//    * @param count            the new count
+//
+//    */
+//   void setQueryCount( int indexFrom, count_t count );
+//
+//   /** returns bad query count of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//    * @param reverse          dito, in opposite direction
+//    */
+//   count_t badCount( int indexFrom ) const;
+//
+//   /** set bad query count of given translation as int
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//    * @param count            the new count
+//    */
+//   void setBadCount( int indexFrom, count_t count );
+//
+//   /** increment bad query count of given translation by 1
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//    */
+//   void incBadCount( int indexFrom );
+//
+//   /** increment query count of given translation by 1
+//    *
+//    * @param index            index of translation
+//    * @param indexint indexFrom        the identifier displayed to the user
+//
+//    */
+//   void incQueryCount( int indexFrom );
+
+    KEduVocTranslation& operator=(const KEduVocTranslation &translation);
+    bool operator==(const KEduVocTranslation &translation) const;
+
+private:
+/*
+    class TranslationGrade
+    {
+    public:
+        grade_t m_grade;
+        count_t m_queryCount;
+        count_t m_badCount;
+        QDateTime m_queryDate;
+    };
+*/
+
+    //KEduVocTranslationPrivate* const d;
+    QString m_translation;
+
+};
+
+#endif