Main Page | Class Hierarchy | Compound List | File List | Compound Members

cubedialog.h

00001 /***************************************************************************
00002                            cubedialog.h
00003                            -------------------
00004     copyright            : (C) 2004 by Jos van den Oever
00005     email                : jos@vandenoever.info
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
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

Generated on Thu Jan 15 23:13:57 2004 for CubeTest by doxygen 1.3.2