File indexing completed on 2024-04-28 07:36:29

0001 /*
0002  * SPDX-FileCopyrightText: 2007-2008 Frederik Gladhorn <gladhorn@kde.org>
0003  * SPDX-License-Identifier: GPL-2.0-or-later
0004  */
0005 
0006 #ifndef KEDUVOCIDENTIFIER_H
0007 #define KEDUVOCIDENTIFIER_H
0008 
0009 #include "keduvocdocument_export.h"
0010 
0011 #include "keduvocarticle.h"
0012 #include "keduvocpersonalpronoun.h"
0013 
0014 #include <QList>
0015 #include <QSet>
0016 #include <QString>
0017 
0018 /**
0019 Class to store meta information about a language or any other category in the vocabulary.
0020 */
0021 class KEDUVOCDOCUMENT_EXPORT KEduVocIdentifier
0022 {
0023 public:
0024     /**
0025      * Default ctor.
0026      */
0027     explicit KEduVocIdentifier();
0028 
0029     /**
0030      * Copy ctor.
0031      * @param other
0032      */
0033     KEduVocIdentifier(const KEduVocIdentifier &other);
0034 
0035     /**
0036      * dtor
0037      */
0038     ~KEduVocIdentifier();
0039 
0040     /**
0041      * assignment operator
0042      * @param other
0043      * @return
0044      */
0045     KEduVocIdentifier &operator=(const KEduVocIdentifier &other);
0046 
0047 public:
0048     /**
0049      * Name of this identifier. (English, Anatomy, Fruit salad...)
0050      * @return name
0051      */
0052     QString name() const;
0053     /**
0054      * Set the name
0055      * @param name
0056      */
0057     void setName(const QString &name);
0058 
0059     /**
0060      * The locale of the contents: en, de, es, ...
0061      * @return locale
0062      */
0063     QString locale() const;
0064     /**
0065      * Set the locale
0066      * @param name
0067      */
0068     void setLocale(const QString &name);
0069 
0070     /**
0071      * Articles (a, the in English, el, la,... in Spanish)
0072      * @returns articles
0073      */
0074     KEduVocArticle &article() const;
0075 
0076     /**
0077      * Sets the articles for this identifier
0078      * @param article              article block
0079      */
0080     void setArticle(const KEduVocArticle &article);
0081 
0082     /**
0083      * Get the personal pronouns for this identifier
0084      * @returns a KEduVocPersonalPronoun containing the personal pronouns
0085      */
0086     KEduVocPersonalPronoun &personalPronouns() const;
0087 
0088     /**
0089      * Sets personal pronouns
0090      * @param pronouns a KEduVocConjugation containing the personal pronouns
0091      */
0092     void setPersonalPronouns(const KEduVocPersonalPronoun &pronouns);
0093 
0094     /**
0095      * Returns the name of tense number @p tenseIndex
0096      * @param tenseIndex desired tense
0097      * @return name of the tense
0098      */
0099     QString tense(int tenseIndex) const;
0100 
0101     /**
0102      * Sets the name of a tense for this language
0103      * @param tenseIndex
0104      * @param tense
0105      */
0106     void setTense(int tenseIndex, const QString &tense);
0107 
0108     QStringList tenseList() const;
0109 
0110     void setTenseList(const QStringList &tenses);
0111 
0112 private:
0113     class Private;
0114     Private *const d;
0115 };
0116 
0117 #endif