+/***************************************************************************
+* this file is from kdeedu project. Filename: keduvoctranslation.h
+***************************************************************************/
+
/***************************************************************************
Vocabulary Expression Translation for KDE Edu
-----------------------------------------------------------------------
Copyright 2007-2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
+ Copyright 2010, 2012 Reto Zingg <g.d0b3rm4n@gmail.com>
+
***************************************************************************/
/***************************************************************************
***************************************************************************/
-#ifndef KEDUVOCTRANSLATION_H
-#define KEDUVOCTRANSLATION_H
+#ifndef QMVOCTRANSLATION_H
+#define QMVOCTRANSLATION_H
-#include "libkeduvocdocument_export.h"
-#include "keduvocconjugation.h"
-#include "keduvoctext.h"
-#include <KDE/KUrl>
+#include "libqmvocdocument_export.h"
+#include "qmvocconjugation.h"
+#include "qmvoctext.h"
+// #include <KDE/KUrl>
+#include <QUrl>
#include <QtCore/QString>
-class KEduVocExpression;
-class KEduVocString;
-class KEduVocWordType;
-class KEduVocLeitnerBox;
-class KEduVocDeclension;
+class QmVocExpression;
+class QmVocString;
+class QmVocWordType;
+class QmVocLeitnerBox;
+class QmVocDeclension;
/**
@author Frederik Gladhorn <frederik.gladhorn@kdemail.net>
*/
-class KEDUVOCDOCUMENT_EXPORT KEduVocTranslation
- :public KEduVocText
+class QMVOCDOCUMENT_EXPORT QmVocTranslation
+ :public QmVocText
{
public:
enum Related {
/**
* 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
*
* @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<QString, KEduVocConjugation>& conjugations );
+ void setConjugations( const QMap<QString, QmVocConjugation>& conjugations );
QStringList conjugationTenses() const;
* Bad, only compatibility. Deprecated.
* @return
*/
- KDE_DEPRECATED QMap <QString, KEduVocConjugation> conjugations() const;
+ KDE_DEPRECATED QMap <QString, QmVocConjugation> conjugations() const;
/**
* Comparison forms of adjectives/adverbs.
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
*/
// 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<KEduVocTranslation*> falseFriends() const;
+ QList<QmVocTranslation*> 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<KEduVocTranslation*> synonyms() const;
+ QList<QmVocTranslation*> 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<KEduVocTranslation*> antonyms() const;
+ QList<QmVocTranslation*> 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