File indexing completed on 2024-04-21 03:51:01

0001 /*
0002     SPDX-FileCopyrightText: 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef DECLENSIONWIDGET_H
0007 #define DECLENSIONWIDGET_H
0008 
0009 #include "ui_declensionwidget.h"
0010 
0011 #include <KEduVocDeclension>
0012 
0013 class KEduVocExpression;
0014 class KEduVocDocument;
0015 
0016 namespace Editor
0017 {
0018 class DeclensionWidget : public QWidget, public Ui::DeclensionWidget
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit DeclensionWidget(QWidget *parent = nullptr);
0024 
0025 public Q_SLOTS:
0026     void setDocument(KEduVocDocument *doc);
0027     void setTranslation(KEduVocExpression *entry, int translation);
0028 
0029     /**
0030      * Fill the line edits
0031      */
0032     void updateEntries();
0033 
0034     void nextNumber();
0035 
0036 Q_SIGNALS:
0037     void sigModified();
0038 
0039 private Q_SLOTS:
0040     void textChanged(const QString &);
0041 
0042 private:
0043     int currentAdditionalWordFlag();
0044     void setupLineEdits();
0045 
0046     int m_identifier{-1};
0047     KEduVocExpression *m_entry{nullptr};
0048     KEduVocDocument *m_doc{nullptr};
0049 
0050     /**
0051      * All line edits and labels, index corresponding to KEduVocWordFlag::indexOf
0052      */
0053     QMap<int, QLineEdit *> m_DeclensionLineEdits;
0054 };
0055 
0056 }
0057 
0058 #endif