LibKEduVocDocument

keduvocidentifier.cpp
1/*
2 * SPDX-FileCopyrightText: 2007-2008 Frederik Gladhorn <gladhorn@kde.org>
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
6#include "keduvocidentifier.h"
7
8class KEduVocIdentifier::Private
9{
10public:
11 /// the name: English, Anatomy, Fruit salad
12 QString m_name;
13 /// the locale: en, de, es, ...
14 QString m_locale;
15
16 /**
17 * Let the user provide some additional information about the language.
18 * This could be Traditional/Simplified for Chinese to differentiate between them.
19 */
20 QString m_comment;
21
22 /** not sure yet: language|other|??? */
23 QString m_type;
24
25 /** I, you, he, she, it... */
26 KEduVocPersonalPronoun m_personalPronouns;
27
28 /** the for english ;)
29 der, die, das ... in german */
30 KEduVocArticle m_articles;
31
32 /** Future, present and past... and many more */
33 QStringList m_tenses;
34};
35
37 : d(new Private)
38{
39 ///@todo maybe the user locale would be more appropriate
40 d->m_locale = QStringLiteral("en");
41}
42
47
49 : d(new Private(*other.d))
50{
51#if 0
52 d->m_locale = other.d->m_locale;
53 d->m_name = other.d->m_name;
54 d->m_articles = other.d->m_articles;
55 d->m_personalPronouns = other.d->m_personalPronouns;
56 d->m_comment = other.d->m_comment;
57 d->m_tenses = other.d->m_tenses;
58 d->m_type = other.d->m_type;
59#endif
60}
61
63{
64 d->m_locale = other.d->m_locale;
65 d->m_name = other.d->m_name;
66 d->m_articles = other.d->m_articles;
67 d->m_personalPronouns = other.d->m_personalPronouns;
68 d->m_comment = other.d->m_comment;
69 d->m_tenses = other.d->m_tenses;
70 d->m_type = other.d->m_type;
71 return *this;
72}
73
75{
76 return d->m_name;
77}
78
80{
81 d->m_name = name;
82}
83
85{
86 return d->m_locale;
87}
88
90{
91 d->m_locale = locale;
92}
93
95{
96 d->m_articles = articles;
97}
98
100{
101 return d->m_articles;
102}
103
105{
106 return d->m_personalPronouns;
107}
108
110{
111 d->m_personalPronouns = pronouns;
112}
113
115{
116 Q_ASSERT(d->m_tenses.size() > tenseIndex);
117 return d->m_tenses.value(tenseIndex);
118}
119
120void KEduVocIdentifier::setTense(int tenseIndex, const QString &tense)
121{
122 Q_ASSERT(d->m_tenses.size() >= tenseIndex);
123 if (tenseIndex == d->m_tenses.size()) {
124 d->m_tenses.append(tense);
125 } else {
126 d->m_tenses[tenseIndex] = tense;
127 }
128}
129
130QStringList KEduVocIdentifier::tenseList() const
131{
132 return d->m_tenses;
133}
134
135void KEduVocIdentifier::setTenseList(const QStringList &tenses)
136{
137 d->m_tenses = tenses;
138}
Class representing the articles of a language.
Class to store meta information about a language or any other category in the vocabulary.
KEduVocArticle & article() const
Articles (a, the in English, el, la,... in Spanish)
void setPersonalPronouns(const KEduVocPersonalPronoun &pronouns)
Sets personal pronouns.
void setLocale(const QString &name)
Set the locale.
QString tense(int tenseIndex) const
Returns the name of tense number tenseIndex.
KEduVocPersonalPronoun & personalPronouns() const
Get the personal pronouns for this identifier.
QString name() const
Name of this identifier.
void setTense(int tenseIndex, const QString &tense)
Sets the name of a tense for this language.
KEduVocIdentifier & operator=(const KEduVocIdentifier &other)
assignment operator
KEduVocIdentifier()
Default ctor.
QString locale() const
The locale of the contents: en, de, es, ...
void setArticle(const KEduVocArticle &article)
Sets the articles for this identifier.
void setName(const QString &name)
Set the name.
The conjugation of a verb.
void append(QList< T > &&value)
qsizetype size() const const
T value(qsizetype i) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.