1 | /*************************************************************************** |
2 | |
3 | C++ Interface: keduvocconjugation |
4 | |
5 | ----------------------------------------------------------------------- |
6 | |
7 | begin : Di Aug 28 2007 |
8 | |
9 | copyright : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net> |
10 | |
11 | ----------------------------------------------------------------------- |
12 | |
13 | ***************************************************************************/ |
14 | |
15 | /*************************************************************************** |
16 | * * |
17 | * This program is free software; you can redistribute it and/or modify * |
18 | * it under the terms of the GNU General Public License as published by * |
19 | * the Free Software Foundation; either version 2 of the License, or * |
20 | * (at your option) any later version. * |
21 | * * |
22 | ***************************************************************************/ |
23 | |
24 | |
25 | #ifndef KEDUVOCCONJUGATION_H |
26 | #define KEDUVOCCONJUGATION_H |
27 | |
28 | #include "libkeduvocdocument_export.h" |
29 | #include "keduvoctext.h" |
30 | #include "keduvocwordflags.h" |
31 | |
32 | #include <QtCore/QStringList> |
33 | |
34 | /** |
35 | * The conjugation of a verb |
36 | */ |
37 | class KEDUVOCDOCUMENT_EXPORT KEduVocConjugation |
38 | { |
39 | public: |
40 | |
41 | /** |
42 | * The constructor |
43 | */ |
44 | explicit KEduVocConjugation(); |
45 | |
46 | KEduVocConjugation( const KEduVocConjugation& rhs ); |
47 | |
48 | ~KEduVocConjugation(); |
49 | |
50 | KEduVocConjugation& operator = ( const KEduVocConjugation& a ); |
51 | bool operator == ( const KEduVocConjugation& a ) const; |
52 | |
53 | /** |
54 | * Returns an existing conjugation object. It is an error and leads to undefined behaviour |
55 | * to call this method with flags which are not in the list returned by keys(). |
56 | * |
57 | * BCI: return a pointer instead of a reference. |
58 | * |
59 | * @param flags Flags obtained by a previous call to keys() |
60 | * @return The existing conjugation object with the specified properties |
61 | */ |
62 | KEduVocText& conjugation(KEduVocWordFlags flags) const; |
63 | /** |
64 | * Updates or creates the conjugation object for the given word flags. |
65 | */ |
66 | void setConjugation(const KEduVocText& conjugation, KEduVocWordFlags flags); |
67 | |
68 | QList<KEduVocWordFlags> keys(); |
69 | |
70 | bool isEmpty(); |
71 | |
72 | /** |
73 | * Create xml for this declension |
74 | * @param parent |
75 | */ |
76 | void toKVTML2(QDomElement& parent, const QString &tense); |
77 | |
78 | /** |
79 | * Reads a declension from xml, returns 0 if it is empty |
80 | * @param parent |
81 | * @return |
82 | */ |
83 | static KEduVocConjugation* fromKVTML2(QDomElement& parent); |
84 | |
85 | private: |
86 | class Private; |
87 | Private* const d; |
88 | }; |
89 | |
90 | |
91 | #endif // KEDUVOCCONJUGATION_H |
92 | |
93 | |