LibKEduVocDocument

keduvocwordtype.h
1/*
2 * SPDX-FileCopyrightText: 2007 Jeremy Whiting <jpwhiting@kde.org>
3 * SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KEDUVOCWORDTYPE_H
8#define KEDUVOCWORDTYPE_H
9
10#include "keduvocdocument_export.h"
11
12#include "keduvoccontainer.h"
13
14#include "keduvocwordflags.h"
15
16#include <QList>
17#include <QString>
18
21
22/** class to store translation word types */
23class KEDUVOCDOCUMENT_EXPORT KEduVocWordType : public KEduVocContainer
24{
25public:
26 /** default constructor */
27 explicit KEduVocWordType(const QString &name, KEduVocWordType *parent = nullptr);
28
29 /** destructor */
30 ~KEduVocWordType() override;
31
32 /** assignment operator */
33 // KEduVocWordType& operator= ( const KEduVocWordType& );
34
35 /**
36 * Internally (different from the name) the class can have one of the preset word types. These are used to determine special properties (verbs have
37 * conjugations available for example).
38 * @param flags
39 */
40 void setWordType(KEduVocWordFlags flags);
41
42 /**
43 * Return the raw WordTypeFlags. Returns NoInformation if no flags are set.
44 * @return WordTypeFlags
45 */
46 KEduVocWordFlags wordType() const;
47
48 /**
49 * Return a child class (or this class) that is of the specified type. Returns 0 if no class of that type is found.
50 * @param flags
51 * @return
52 */
53 KEduVocWordType *childOfType(KEduVocWordFlags flags);
54
55 /**
56 * The word type class does keep track of individual translations, because for one entry, the translations can have different word types (eg. genders of
57 * nouns tend to be different in different languages).
58 * @param row
59 * @return
60 */
61 KEduVocTranslation *translation(int row);
62
63 /**
64 * get a list of all entries in the lesson
65 * @param recursive include entries in sublessons
66 * @return
67 */
68 QList<KEduVocExpression *> entries(EnumEntriesRecursive recursive = NotRecursive) Q_DECL_OVERRIDE;
69
70 KEduVocExpression *entry(int row, EnumEntriesRecursive recursive = NotRecursive) Q_DECL_OVERRIDE;
71
72 /** get the number of entries in the lesson */
73 int entryCount(EnumEntriesRecursive recursive = NotRecursive) Q_DECL_OVERRIDE;
74
75private:
76 class Private;
77 Private *const d;
78
79 /** add an entry to the lesson
80 * @param entryid id of the entry to add
81 */
82 void addTranslation(KEduVocTranslation *translation);
83
84 /** remove an entry from the lesson
85 * @param entryid id of the entry to remove
86 */
87 void removeTranslation(KEduVocTranslation *translation);
88
89 friend class KEduVocTranslation;
90};
91
92#endif
class to store information about a container - that can be a lesson or word types
virtual QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive)=0
get a list of all entries in the container
void removeTranslation(int translation)
Removes a translation.
This class contains one vocabulary expression as an original with one or more translations.
class to store translation word types
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:55:29 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.