diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /kbruch/src/taskview.h | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbruch/src/taskview.h')
-rw-r--r-- | kbruch/src/taskview.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/kbruch/src/taskview.h b/kbruch/src/taskview.h new file mode 100644 index 00000000..60c3e75c --- /dev/null +++ b/kbruch/src/taskview.h @@ -0,0 +1,113 @@ +/*************************************************************************** + taskview.cpp - Header File + ------------------- + begin : Tue Feb 08 13:42:00 CET 2002 + copyright : (C) 2001 - 2004 by Sebastian Stein + email : seb.kde@hpfsc.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TASKVIEW_H +#define TASKVIEW_H + +#define _CHECK_TASK 0 +#define _NEXT_TASK 1 + +#include "exercisebase.h" +#include "resultwidget.h" +#include "task.h" +#include "taskwidget.h" + +#ifdef DEBUG +#include <kdebug.h> +#endif + +#include <qwidget.h> + + +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QSpacerItem; +class QLabel; +class QPushButton; +class QLineEdit; +class QFrame; + +/*! Constructs a QWidget, which shows the task to the user. + * The class also provides input fields, so that the user can enter the result. + * It also controls the interaction, so that the entered result gets checked + * and a new task can be generated. + * \author Sebastian Stein + * */ +class TaskView : public ExerciseBase +{ + Q_OBJECT + +public: + /** constructor */ + TaskView(QWidget * parent = 0, const char * name = 0, + bool padd_sub = true, bool pmul_div = false, + unsigned int pnr_ratios = 2, unsigned int pmax_md = 10); + + /** destructor */ + ~TaskView(); + + /** set new task parameters, which will be used for the next task to be + * generated */ + void setTaskParameters(bool padd_sub, bool pmul_div, unsigned int pnr_ratios, unsigned int pmax_md); + + /** force the creation of a new task */ + void forceNewTask(); + +public slots: + void update(); + +signals: + /** class emits this signal, if the task was solved correctly by the user */ + void signalTaskSolvedCorrect(); + + /** class emits this signal, if the task was solved not correctly by the user + * */ + void signalTaskSolvedWrong(); + +private: + bool add_sub; + bool mul_div; + unsigned int nr_ratios; + unsigned int curr_nr_ratios; + unsigned int max_md; + short m_currentState; + + ResultWidget* m_resultWidget; + QPushButton* m_checkButton; + QLabel* result_label; + TaskWidget* m_taskWidget; + QLineEdit* numer_edit; + QFrame* edit_line; + QLineEdit* deno_edit; + + QGridLayout* baseGrid; + QWidget* baseWidget; + QVBoxLayout* realLayout; + + task current_task; + ratio result; + ratio entered_result; + + void showResult(); + void nextTask(); + +private slots: + void slotCheckButtonClicked(); +}; + +#endif |