From 1a5da51ad8ee74aec82d733823cabff7c1346ffd Mon Sep 17 00:00:00 2001 From: Reto Zingg Date: Sat, 15 Dec 2012 19:28:48 +0200 Subject: [PATCH] adapt qmvoctranslation.h for querymee --- qmvoctranslation.h | 113 ++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/qmvoctranslation.h b/qmvoctranslation.h index 9038e51..91efbfa 100644 --- a/qmvoctranslation.h +++ b/qmvoctranslation.h @@ -1,7 +1,13 @@ +/*************************************************************************** +* this file is from kdeedu project. Filename: keduvoctranslation.h +***************************************************************************/ + /*************************************************************************** Vocabulary Expression Translation for KDE Edu ----------------------------------------------------------------------- Copyright 2007-2008 Frederik Gladhorn + Copyright 2010, 2012 Reto Zingg + ***************************************************************************/ /*************************************************************************** @@ -14,26 +20,27 @@ ***************************************************************************/ -#ifndef KEDUVOCTRANSLATION_H -#define KEDUVOCTRANSLATION_H +#ifndef QMVOCTRANSLATION_H +#define QMVOCTRANSLATION_H -#include "libkeduvocdocument_export.h" -#include "keduvocconjugation.h" -#include "keduvoctext.h" -#include +#include "libqmvocdocument_export.h" +#include "qmvocconjugation.h" +#include "qmvoctext.h" +// #include +#include #include -class KEduVocExpression; -class KEduVocString; -class KEduVocWordType; -class KEduVocLeitnerBox; -class KEduVocDeclension; +class QmVocExpression; +class QmVocString; +class QmVocWordType; +class QmVocLeitnerBox; +class QmVocDeclension; /** @author Frederik Gladhorn */ -class KEDUVOCDOCUMENT_EXPORT KEduVocTranslation - :public KEduVocText +class QMVOCDOCUMENT_EXPORT QmVocTranslation + :public QmVocText { public: enum Related { @@ -45,23 +52,23 @@ public: /** * Default constructor for an empty translation. */ - KEduVocTranslation(KEduVocExpression* entry); + QmVocTranslation(QmVocExpression* entry); /** * Constructor * @param translation is used as translation */ - KEduVocTranslation(KEduVocExpression* entry, const QString &translation ); + QmVocTranslation(QmVocExpression* entry, const QString &translation ); /** copy constructor for d-pointer safety */ - KEduVocTranslation( const KEduVocTranslation &other ); + QmVocTranslation( const QmVocTranslation &other ); /** * Destructor */ - ~KEduVocTranslation(); + ~QmVocTranslation(); - KEduVocExpression* entry(); + QmVocExpression* entry(); /** Sets the pronunciation of this expression * @param expression pronunciation of this index @@ -130,53 +137,53 @@ public: * * @return type or "" if no type available */ - KEduVocWordType* wordType() const; + QmVocWordType* wordType() const; /** Sets the word type of this expression * @param type type of this expression ("" = none) */ - void setWordType( KEduVocWordType* wordType ); + void setWordType( QmVocWordType* wordType ); /** Returns the leitner box of this translation * @return the box */ - KEduVocLeitnerBox* leitnerBox() const; + QmVocLeitnerBox* leitnerBox() const; /** Sets the leitner box of this translation * @param leitnerBox the box */ - void setLeitnerBox( KEduVocLeitnerBox* leitnerBox ); + void setLeitnerBox( QmVocLeitnerBox* leitnerBox ); /** * Returns a conjugation if available * @param tense tense of the requested conjugation * @return the conjugation */ - KEduVocConjugation& conjugation( const QString& tense ); + QmVocConjugation& conjugation( const QString& tense ); /** adds conjugations or replaces them, if they exist. * @param conjugation conjugation */ - void setConjugation( const QString& tense, const KEduVocConjugation & conjugation ); + void setConjugation( const QString& tense, const QmVocConjugation & conjugation ); /** * Returns a pointer to the declension object of this translation. * Returns 0 if no declension object exists! * @return the declension */ - KEduVocDeclension* declension(); + QmVocDeclension* declension(); /** * Set a new declension for a translation * @param declension */ - void setDeclension(KEduVocDeclension* declension); + void setDeclension(QmVocDeclension* declension); /** * Bad, only used for tense entry page, will be deleted later. Deprecated. * @param conjugation */ - void setConjugations( const QMap& conjugations ); + void setConjugations( const QMap& conjugations ); QStringList conjugationTenses() const; @@ -184,7 +191,7 @@ public: * Bad, only compatibility. Deprecated. * @return */ - KDE_DEPRECATED QMap conjugations() const; + KDE_DEPRECATED QMap conjugations() const; /** * Comparison forms of adjectives/adverbs. @@ -192,16 +199,16 @@ public: KDE_DEPRECATED QString comparative() const; KDE_DEPRECATED void setComparative(const QString& comparative); // TODO rename to comparative and remove the deprecated function - KEduVocText comparativeForm() const; - void setComparativeForm(const KEduVocText& comparative); + QmVocText comparativeForm() const; + void setComparativeForm(const QmVocText& comparative); KDE_DEPRECATED QString superlative() const; KDE_DEPRECATED void setSuperlative(const QString& superlative); - KEduVocText superlativeForm() const; - void setSuperlativeForm(const KEduVocText& superlative); + QmVocText superlativeForm() const; + void setSuperlativeForm(const QmVocText& superlative); - KEduVocText article() const; - void setArticle(const KEduVocText& article); + QmVocText article() const; + void setArticle(const QmVocText& article); /** Returns multiple choice if available */ @@ -213,98 +220,98 @@ public: // void setMultipleChoice( const QStringList &mc ); /** Get the sound url for this translation if it exists */ - KUrl soundUrl(); + QUrl soundUrl(); /** Set the sound url for this translation * @param url url of the sound file */ - void setSoundUrl(const KUrl &url); + void setSoundUrl(const QUrl &url); /** Get the image url for this translation if it exists */ - KUrl imageUrl(); + QUrl imageUrl(); /** Set the image url for this translation * @param url url of the image */ - void setImageUrl(const KUrl &url); + void setImageUrl(const QUrl &url); /** * Add a false friend * @param falseFriend false friend of this index */ - void addFalseFriend( KEduVocTranslation* falseFriend ); + void addFalseFriend( QmVocTranslation* falseFriend ); /** * Remove a false friend * @param falseFriend false friend of this index */ - void removeFalseFriend( KEduVocTranslation* falseFriend ); + void removeFalseFriend( QmVocTranslation* falseFriend ); /** * Returns false friends of this expression * @return list of false friends */ - QList falseFriends() const; + QList falseFriends() const; /** * Add a synonym * @param synonym */ - void addSynonym( KEduVocTranslation* synonym ); + void addSynonym( QmVocTranslation* synonym ); /** * Remove a synonym * @param synonym */ - void removeSynonym( KEduVocTranslation* synonym ); + void removeSynonym( QmVocTranslation* synonym ); /** * Returns synonyms of this expression * @return synonyms */ - QList synonyms() const; + QList synonyms() const; /** * Add a antonym * @param antonym */ - void addAntonym( KEduVocTranslation* antonym ); + void addAntonym( QmVocTranslation* antonym ); /** * Remove a antonym * @param antonym */ - void removeAntonym( KEduVocTranslation* antonym ); + void removeAntonym( QmVocTranslation* antonym ); /** * Returns antonyms of this expression * @return antonyms */ - QList antonyms() const; + QList antonyms() const; /** * Equal operator to assing a translation to another one. * @param translation translation to be copied * @return reference to the new translation */ - KEduVocTranslation& operator= ( const KEduVocTranslation &translation ); + QmVocTranslation& operator= ( const QmVocTranslation &translation ); /** * Compare two translations, including word type etc. * @param translation * @return true if equal */ - bool operator== ( const KEduVocTranslation &translation ) const; + bool operator== ( const QmVocTranslation &translation ) const; void fromKVTML2(QDomElement& parent); void toKVTML2(QDomElement& parent); private: - class KEduVocTranslationPrivate; - KEduVocTranslationPrivate* const d; + class QmVocTranslationPrivate; + QmVocTranslationPrivate* const d; // for the copy constructor - void setEntry(KEduVocExpression* entry); - friend class KEduVocExpression; + void setEntry(QmVocExpression* entry); + friend class QmVocExpression; }; #endif -- 2.47.3