File indexing completed on 2022-11-29 13:00:35

0001 /*
0002     SPDX-FileCopyrightText: 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0003     SPDX-FileCopyrightText: 2011 Jan Gerrit Marker <jangerrit@weiler-marker.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef INFLECTIONWIDGET_H
0008 #define INFLECTIONWIDGET_H
0009 
0010 #include <memory>
0011 
0012 #include <QStackedWidget>
0013 
0014 #include <KEduVocDeclension>
0015 
0016 class KEduVocExpression;
0017 class KEduVocDocument;
0018 
0019 namespace Editor
0020 {
0021 class DeclensionWidget;
0022 class ConjugationWidget;
0023 
0024 class InflectionWidget : public QStackedWidget
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit InflectionWidget(QWidget *parent = nullptr);
0030 
0031 public Q_SLOTS:
0032     void setDocument(const std::shared_ptr<KEduVocDocument> &doc);
0033     void setTranslation(KEduVocExpression *entry, int translation);
0034 
0035 private Q_SLOTS:
0036     void setWordType();
0037 
0038 private:
0039     QWidget *m_wordTypeWidget{nullptr};
0040     DeclensionWidget *m_declensionWidget{nullptr};
0041     ConjugationWidget *m_conjugationWidget{nullptr};
0042 
0043     std::shared_ptr<KEduVocDocument> m_doc{nullptr};
0044     KEduVocExpression *m_entry{nullptr};
0045     int m_translation{-1};
0046 };
0047 
0048 }
0049 
0050 #endif