File indexing completed on 2024-04-21 07:37:43

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