File indexing completed on 2022-12-06 18:52:36

0001 /*
0002     TaskWidget.h  -  paint a task
0003     SPDX-FileCopyrightText: 2004 Sebastian Stein <seb.kde@hpfsc.de>
0004     SPDX-FileCopyrightText: 2008 Tadeu Araujo <tadeu.araujo@ltia.fc.unesp.br>
0005     SPDX-FileCopyrightText: 2008 Danilo Balzaque <danilo.balzaque@ltia.fc.unesp.br>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef TASKWIDGET_H
0011 #define TASKWIDGET_H
0012 
0013 #include "FractionBaseWidget.h"
0014 #include "Task.h"
0015 
0016 #include <QWidget>
0017 
0018 class QPaintEvent;
0019 
0020 /** important for add_sub and mul_div */
0021 #define YES 1
0022 #define NO  0
0023 
0024 /** important for op_vector */
0025 #define ADD 0
0026 #define SUB 1
0027 #define MUL 2
0028 #define DIV 3
0029 
0030 /*! class to paint task with fractions
0031  *
0032  *  \author Sebastian Stein */
0033 class TaskWidget : public FractionBaseWidget
0034 {
0035     Q_OBJECT
0036 public:
0037     /** constructor */
0038     explicit TaskWidget(QWidget * parent = nullptr, const Task &para_task = Task());
0039 
0040     /** destructor */
0041     ~TaskWidget() override;
0042 
0043     /** set the task to be displayed */
0044     void setTask(const Task &para_task);
0045 
0046     void setQuestionMixed(bool value);
0047 
0048 private:
0049 
0050     /** the task to be displayed */
0051     Task m_task;
0052 
0053     bool m_questionMixed;
0054 
0055     /** overriding the paint event of FractionBaseWidget */
0056     void paintEvent(QPaintEvent*) override;
0057 };
0058 
0059 #endif