File indexing completed on 2024-04-14 03:49:09

0001 /*
0002     SPDX-FileCopyrightText: 2010 Frederik Gladhorn <gladhorn@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef CONJUGATIONMODEWIDGET_H
0007 #define CONJUGATIONMODEWIDGET_H
0008 
0009 #include "abstractwidget.h"
0010 
0011 namespace Ui
0012 {
0013 class ConjugationPracticeWidget;
0014 }
0015 
0016 namespace Practice
0017 {
0018 struct PersonConjugationSolutionWidgets;
0019 
0020 class ConjugationModeWidget : public AbstractModeWidget
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit ConjugationModeWidget(GuiFrontend *frontend, QWidget *parent = nullptr);
0026     ~ConjugationModeWidget() override;
0027     QVariant userInput() override;
0028 
0029     void setQuestion(const QVariant &question) override;
0030     void setSolution(const QVariant &solution) override;
0031     void setHint(const QVariant &hint) override;
0032     void setFeedback(const QVariant &feedback) override;
0033     void setFeedbackState(AbstractFrontend::ResultState feedbackState) override
0034     {
0035         Q_UNUSED(feedbackState);
0036     }
0037     void setResultState(AbstractFrontend::ResultState resultState) override
0038     {
0039         Q_UNUSED(resultState);
0040     }
0041 
0042     void setQuestionFont(const QFont &font) override;
0043     void setSolutionFont(const QFont &font) override;
0044     void setQuestionSound(const QUrl &soundUrl) override;
0045     void setSolutionSound(const QUrl &soundUrl) override;
0046     void setSolutionPronunciation(const QString &pronunciationText) override;
0047     void setQuestionPronunciation(const QString &pronunciationText) override;
0048     void setSynonym(const QString & /*entry*/) override
0049     {
0050     }
0051 
0052 public Q_SLOTS:
0053     void showQuestion() override;
0054     void showSolution() override;
0055     void showSynonym() override
0056     {
0057     }
0058 
0059 private Q_SLOTS:
0060     void nextConjugationForm();
0061 
0062 private:
0063     virtual void setNumberOfConjugationWidgets(const int numberOfForms);
0064 
0065     Ui::ConjugationPracticeWidget *m_ui{nullptr};
0066     QStringList m_solution;
0067     QList<PersonConjugationSolutionWidgets *> m_personWidgets;
0068     QFont m_solutionFont;
0069 };
0070 
0071 }
0072 
0073 #endif