00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef CUBEDIALOG_H
00017 #define CUBEDIALOG_H
00018 #include "question.h"
00019 #include <qvbox.h>
00020 #include <list>
00021 using std::list;
00022 class SideStyle;
00023 class ScoreKeeper;
00024 class Cube;
00025 class QLabel;
00026 class QPushButton;
00027 class QCubeLabel;
00028 class CubeDialog : public QVBox {
00029 Q_OBJECT
00030 public:
00031 CubeDialog(QWidget* parent=0, const char* name=0, WFlags f=0);
00032 void startQuestions();
00033 const ScoreKeeper &getScore() const;
00034 void readQuestions();
00035 void setSideStyle(const SideStyle *);
00036 void setQuestion(Question &);
00037 short blanks;
00038 protected:
00039 void keyPressEvent(QKeyEvent *);
00040 void resizeEvent(QResizeEvent *);
00041 private:
00042 bool autoq;
00043 bool beforeAnimation;
00044 bool next;
00045 bool stopAnimation;
00046 bool answered;
00047 bool restoreanswer;
00048 QLabel *msg;
00049 ScoreKeeper *score;
00050 QCubeLabel *sides;
00051 Cube *cube;
00052 Cube *answers[4];
00053 QPushButton *answerButtons[4], *ok, *reset;
00054 list<Question> questions;
00055 list<Question>::iterator q;
00056 const SideStyle *style;
00057
00058 void nextQuestion();
00059 void setAnswer(short i);
00060 void stopAnim();
00061 private slots:
00062 void answerA();
00063 void answerB();
00064 void answerC();
00065 void answerD();
00066 void afterAnimation();
00067 void answer();
00068 void resetQuestion();
00069 void handleRotation();
00070 signals:
00071 void finished();
00072 };
00073
00074 #endif