File indexing completed on 2024-10-13 06:32:36
0001 /* 0002 SPDX-FileCopyrightText: 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef CONJUGATIONWIDGET_H 0007 #define CONJUGATIONWIDGET_H 0008 0009 #include "ui_conjugationwidget.h" 0010 0011 #include <KEduVocWordFlags> 0012 0013 class KEduVocExpression; 0014 class KEduVocDocument; 0015 0016 namespace Editor 0017 { 0018 class ConjugationWidget : public QWidget, public Ui::ConjugationWidget 0019 { 0020 Q_OBJECT 0021 0022 public: 0023 explicit ConjugationWidget(QWidget *parent = nullptr); 0024 0025 public Q_SLOTS: 0026 void setDocument(KEduVocDocument *doc); 0027 void setTranslation(KEduVocExpression *entry, int translation); 0028 0029 Q_SIGNALS: 0030 void sigModified(); 0031 0032 private Q_SLOTS: 0033 void textChanged(const QString &); 0034 void slotTenseSelected(int); 0035 void slotNextTense(); 0036 void tenseEditingFinished(); 0037 0038 private: 0039 void updateVisiblePersons(); 0040 0041 void showWidgets(bool tenses, bool singular, bool dual, bool plural, bool maleVisible, bool femaleVisible, bool neuterVisible); 0042 0043 /** 0044 * Fill the line edits 0045 */ 0046 void updateEntries(); 0047 0048 QString m_lastTenseSelection; 0049 int m_identifier{-1}; 0050 KEduVocExpression *m_entry{nullptr}; 0051 KEduVocDocument *m_doc{nullptr}; 0052 0053 /** 0054 * All line edits and labels, index corresponding to KEduVocWordFlag::indexOf 0055 */ 0056 QMap<KEduVocWordFlags, QLineEdit *> m_conjugationLineEdits; 0057 }; 0058 0059 } 0060 0061 #endif