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 /kpercentage/kpercentage/kanswer.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 'kpercentage/kpercentage/kanswer.h')
-rw-r--r-- | kpercentage/kpercentage/kanswer.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/kpercentage/kpercentage/kanswer.h b/kpercentage/kpercentage/kanswer.h new file mode 100644 index 00000000..32519398 --- /dev/null +++ b/kpercentage/kpercentage/kanswer.h @@ -0,0 +1,104 @@ +/*************************************************************************** + kanswer.h - description + ------------------- + begin : Fri Nov 30 2001 + copyright : (C) 2001 by Matthias Messmer & + Carsten Niehaus & + Robert Gogolok + email : bmlmessmer@web.de & + cniehaus@gmx.de & + mail@robert-gogolok.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 KANSWER_H +#define KANSWER_H + +// Qt includes + +// KDE includes +#include <kdialog.h> + +class QCanvas; +class QCanvasPixmapArray; +class QCanvasSprite; +class QCanvasView; +class QHBoxLayout; +class QLabel; + +class KAnimation; + +class KPushButton; + +/** + * A small dialog, which gives feedback, if the input was wrong or false. + * It provides reading several sentences from file and selecting by chance. + * + * @author Matthias Messmer & Carsten Niehaus & Robert Gogolok + */ +class KAnswer : public KDialog +{ + Q_OBJECT + public: + /** + * The constructor doesn't need any parameters but the parent, + * because it will not be used in any other context. + * + * @param parent Parent widget for modal functionality + */ + KAnswer( QWidget *parent ); + + // public functions + /** setting/changing feedback text and pic */ + void setAnswer( int modus ); + + public slots: + /** reimplemented: close the window after some time */ + void timerEvent( QTimerEvent * ); + void accept(); + + int exec(); + + private: + // private functions + /** Loads feadback sentences from file */ + void loadAnswers(); + /** Gets a answer by chance for well solved tasks. */ + QString getRightAnswer(); + /** Gets a answer by chance for not solved tasks. */ + QString getWrongAnswer(); + + // GUI widgets + /** Label for the answer text */ + QLabel *TextLabelAnswer; + /** OK button */ + KPushButton *ButtonOK; + + /** List of feedback text for well solved tasks. */ + QStringList rightAnswerList; + /** List of feedback text for not solved tasks. */ + QStringList wrongAnswerList; + + QHBoxLayout *mainLayout; + + KAnimation *right_animation; + KAnimation *wrong_animation; + + int advPer; + + QCanvasView *canvas_view; + QCanvasPixmapArray *pixs; + QCanvas *canvas; + + void setupSprite(); +}; + +#endif |