File indexing completed on 2024-04-28 07:39:24

0001 /*
0002     dialog page for multiple choice suggestions
0003     SPDX-FileCopyrightText: 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
0004     SPDX-FileCopyrightText: 2005-2006 Peter Hedlund <peter.hedlund@kdemail.net>
0005     SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef MULTIPLECHOICEWIDGET_H
0010 #define MULTIPLECHOICEWIDGET_H
0011 
0012 #include "ui_multiplechoicewidget.h"
0013 
0014 #include <QModelIndex>
0015 
0016 class KEduVocExpression;
0017 class KEduVocTranslation;
0018 class QStringListModel;
0019 
0020 namespace Editor
0021 {
0022 class MultipleChoiceWidget : public QWidget, public Ui::multipleChoiceWidget
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit MultipleChoiceWidget(QWidget *parent = nullptr);
0028 
0029 public Q_SLOTS:
0030     void setTranslation(KEduVocExpression *entry, int translation);
0031 
0032 protected:
0033     bool eventFilter(QObject *obj, QEvent *event) override;
0034 
0035 private Q_SLOTS:
0036     void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
0037     void slotAddChoiceButton();
0038     void slotRemoveChoiceButton();
0039 
0040 private:
0041     KEduVocTranslation *m_translation{nullptr};
0042     QStringListModel *m_choicesModel{nullptr};
0043 };
0044 }
0045 
0046 #endif