LibKEduVocDocument

keduvocexpression.h
1/*
2 * Vocabulary Expression for KDE Edu
3 * SPDX-FileCopyrightText: 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
4 * SPDX-FileCopyrightText: 2005-2007 Peter Hedlund <peter.hedlund@kdemail.net>
5 * SPDX-FileCopyrightText: 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8#ifndef KEDUVOCEXPRESSION_H
9#define KEDUVOCEXPRESSION_H
10
11#include "keduvocdocument_export.h"
12
13#include <QDateTime>
14
15#include "keduvocarticle.h"
16#include "keduvoclesson.h"
17#include "keduvocmultiplechoice.h"
18#include "keduvoctranslation.h"
19
20class KEduVocLesson;
21
22/**
23 This class contains one vocabulary expression as an original with one or more
24 translations
25 */
26class KEDUVOCDOCUMENT_EXPORT KEduVocExpression
27{
28public:
29 /** default constructor for an empty vocabulary expression
30 */
31 explicit KEduVocExpression();
32
33 /** Constructor for a vocabulary expression with one translation
34 *
35 * @param expression translation
36 */
37 explicit KEduVocExpression(const QString &expression);
38
39 /** Constructor for a vocabulary expression with an original and one or more translations
40 *
41 * @param translations translations
42 */
43 explicit KEduVocExpression(const QStringList &translations);
44
46
48
49 /** return the lesson
50 */
51 KEduVocLesson *lesson() const;
52
53 /** reset all grades of the entry
54 * @param index identifier (language)
55 */
56 void resetGrades(int index);
57
58 /** returns flag if entry is activated for queries
59 */
60 bool isActive() const;
61
62 /** set entry active (enabled for queries)
63 */
64 void setActive(bool flag = true);
65
66 int sizeHint() const;
67 void setSizeHint(int sizeHint);
68
69 /**
70 * Add a translation to this expression
71 * @param index number of translation = the identifier
72 * @param expression the translation
73 */
74 void setTranslation(int index, const QString &expression);
75
76 /** removes a translation
77 *
78 * @param index number of translation 1..x
79 */
80 void removeTranslation(int index);
81
82 /**
83 * Get a pointer to the translation
84 * @param index of the language identifier
85 * @return the translation
86 */
87 KEduVocTranslation *translation(int index);
88 KEduVocTranslation *translation(int index) const;
89
90 QList<int> translationIndices() const;
91
92 KEduVocExpression &operator=(const KEduVocExpression &expression);
93 bool operator==(const KEduVocExpression &expression) const;
94
95private:
96 class KEduVocExpressionPrivate;
97 KEduVocExpressionPrivate *const d;
98
99 /** only called by lesson to add itself to the lesson list
100 */
101 void setLesson(KEduVocLesson *l);
102
103 friend class KEduVocLesson;
104};
105
106#endif // KEduVocExpression_H
This class contains one vocabulary expression as an original with one or more translations.
class to store information about a lesson
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.