File indexing completed on 2024-04-14 03:46:38

0001 /*
0002  * C++ Interface: keduvocconjugation
0003  * SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KEDUVOCCONJUGATION_H
0008 #define KEDUVOCCONJUGATION_H
0009 
0010 #include "keduvocdocument_export.h"
0011 #include "keduvoctext.h"
0012 #include "keduvocwordflags.h"
0013 
0014 #include <QStringList>
0015 
0016 /**
0017  * The conjugation of a verb
0018  */
0019 class KEDUVOCDOCUMENT_EXPORT KEduVocConjugation
0020 {
0021 public:
0022     /**
0023      * The constructor
0024      */
0025     explicit KEduVocConjugation();
0026 
0027     KEduVocConjugation(const KEduVocConjugation &rhs);
0028 
0029     ~KEduVocConjugation();
0030 
0031     KEduVocConjugation &operator=(const KEduVocConjugation &a);
0032     bool operator==(const KEduVocConjugation &a) const;
0033 
0034     /**
0035      *  Returns an existing conjugation object. It is an error and leads to undefined behavior
0036      *  to call this method with flags which are not in the list returned by keys().
0037      *
0038      *  BCI: return a pointer instead of a reference.
0039      *
0040      *  @param  flags Flags obtained by a previous call to keys()
0041      *  @return The existing conjugation object with the specified properties
0042      */
0043     KEduVocText &conjugation(KEduVocWordFlags flags) const;
0044     /**
0045      *  Updates or creates the conjugation object for the given word flags.
0046      */
0047     void setConjugation(const KEduVocText &conjugation, KEduVocWordFlags flags);
0048 
0049     QList<KEduVocWordFlags> keys();
0050 
0051     bool isEmpty();
0052 
0053     /**
0054      * Create xml for this declension
0055      * @param parent
0056      * @param tense
0057      */
0058     void toKVTML2(QDomElement &parent, const QString &tense);
0059 
0060     /**
0061      * Reads a declension from xml, returns 0 if it is empty
0062      * @param parent
0063      * @return
0064      */
0065     static KEduVocConjugation *fromKVTML2(QDomElement &parent);
0066 
0067 private:
0068     class Private;
0069     Private *const d;
0070 };
0071 
0072 #endif // KEDUVOCCONJUGATION_H