]> Git trees. - libqmvoc.git/commitdiff
add declension to translation class
authorFrederik Gladhorn <gladhorn@kde.org>
Sun, 24 Feb 2008 16:35:54 +0000 (16:35 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Sun, 24 Feb 2008 16:35:54 +0000 (16:35 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=778794

keduvocdocument/keduvocdeclension.cpp
keduvocdocument/keduvocdeclension.h
keduvocdocument/keduvoctranslation.cpp
keduvocdocument/keduvoctranslation.h

index f77d5bd6a0ee5380a791f06d5134bebd935d6a6e..f58663149295ec12193324820d7f34ad74ff1c10 100644 (file)
  ***************************************************************************/
 
 #include "keduvocdeclension.h"
-
+/*
 #include "kvtml2defs.h"
 #include "keduvockvtml2writer.h"
 #include <QtXml/QDomDocument>
+*/
 #include <QtCore/QMap>
 
 class KEduVocDeclension::Private
@@ -76,13 +77,13 @@ bool KEduVocDeclension::isEmpty()
     return d->m_declensions.isEmpty();
 }
 
-void KEduVocDeclension::toXML(QDomElement & parent)
-{
-    if (isEmpty()) {
-        return;
-    }
-    QDomDocument domDoc = parent.ownerDocument();
-    QDomElement gradeElement = domDoc.createElement( KVTML_DECLENSION );
-
-}
+// void KEduVocDeclension::toXML(QDomElement & parent)
+// {
+//     if (isEmpty()) {
+//         return;
+//     }
+//     QDomDocument domDoc = parent.ownerDocument();
+//     QDomElement gradeElement = domDoc.createElement( KVTML_DECLENSION );
+// 
+// }
 
index c6c6a72ca5d2633492d11554f52f46aecbd97f68..c2e03a1876cd524c1cffb26c25c9b88f39dd0136 100644 (file)
@@ -94,7 +94,7 @@ public:
 
     bool isEmpty();
 
-    void toXML(QDomElement& parent);
+//     void toXML(QDomElement& parent);
 
 private:
     int indexOf(DeclensionNumber number, DeclensionCase decCase);
index 6f34b57d9204e0dfdd9bb6085545ba6e75129952..cf46db77ab1a5e574490283df45e5ce84aa53aee 100644 (file)
@@ -345,4 +345,27 @@ void KEduVocTranslation::setSuperlative(const QString & superlative)
     d->m_superlative = superlative;
 }
 
+KEduVocDeclension * KEduVocTranslation::declension()
+{
+    return d->m_declension;
+}
+
+void KEduVocTranslation::setDeclension(KEduVocDeclension * declension)
+{
+    // remove the old declension object
+    delete d->m_declension;
+    d->m_declension = declension;
+}
+
+void KEduVocTranslation::toXML(QDomElement & parent)
+{
+    kDebug() << "Write translation xml.";
+    KEduVocText::toXML(parent);
+    if (d->m_declension) {
+//         d->m_declension->toXML(parent);
+    }
+}
+
+
+
 
index d6ca13560b9b72a25d95c6b6a5a8cb94aa514df5..f90b8eca8d4a0dda863fe87c6c810f80c903d276 100644 (file)
@@ -27,6 +27,7 @@
 class KEduVocExpression;
 class KEduVocString;
 class KEduVocWordType;
+class KEduVocDeclension;
 
 /**
  @author Frederik Gladhorn <frederik.gladhorn@kdemail.net>
@@ -161,6 +162,19 @@ public:
     */
     void setConjugation( const QString& tense, const KEduVocConjugation & conjugation );
 
+    /**
+     * Returns a pointer to the declension object of this translation.
+     * Returns 0 if no declension object exists!
+     * @return the declension
+     */
+    KEduVocDeclension* declension();
+
+    /**
+     * Set a new declension for a translation
+     * @param declension
+     */
+    void setDeclension(KEduVocDeclension* declension);
+
     /**
      * Bad, only used for tense entry page, will be deleted later. Deprecated.
      * @param conjugation
@@ -221,6 +235,8 @@ public:
      */
     bool operator== ( const KEduVocTranslation &translation ) const;
 
+    void toXML(QDomElement& parent);
+
 private:
     class KEduVocTranslationPrivate;
     KEduVocTranslationPrivate* const d;