File indexing completed on 2022-10-04 13:56:32

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     /**
0024      * The constructor
0025      */
0026     explicit KEduVocConjugation();
0027 
0028     KEduVocConjugation( const KEduVocConjugation& rhs );
0029 
0030     ~KEduVocConjugation();
0031 
0032     KEduVocConjugation& operator = ( const KEduVocConjugation& a );
0033     bool operator == ( const KEduVocConjugation& a ) const;
0034 
0035     /**
0036      *  Returns an existing conjugation object. It is an error and leads to undefined behavior
0037      *  to call this method with flags which are not in the list returned by keys().
0038      *
0039      *  BCI: return a pointer instead of a reference.
0040      *
0041      *  @param  flags Flags obtained by a previous call to keys()
0042      *  @return The existing conjugation object with the specified properties
0043      */
0044     KEduVocText& conjugation(KEduVocWordFlags flags) const;
0045     /**
0046      *  Updates or creates the conjugation object for the given word flags.
0047      */
0048     void setConjugation(const KEduVocText& conjugation, KEduVocWordFlags flags);
0049 
0050     QList<KEduVocWordFlags> keys();
0051 
0052     bool isEmpty();
0053 
0054     /**
0055      * Create xml for this declension
0056      * @param parent
0057      * @param tense
0058      */
0059     void toKVTML2(QDomElement& parent, const QString &tense);
0060 
0061     /**
0062      * Reads a declension from xml, returns 0 if it is empty
0063      * @param parent
0064      * @return
0065      */
0066     static KEduVocConjugation* fromKVTML2(QDomElement& parent);
0067 
0068 private:
0069     class Private;
0070     Private* const d;
0071 };
0072 
0073 
0074 #endif // KEDUVOCCONJUGATION_H
0075