/***************************************************************************
                           scorekeeper.h
                           -------------------
    copyright            : (C) 2004 by Jos van den Oever
    email                : jos@vandenoever.info
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 SCOREKEEPER_H
#define SCOREKEEPER_H

/* This very simple class display two things:
	- the number of the current question and, if known, the total number of
	  questions.
	- the current score and, if known, the maximal score attainable.

   The names of the variables shouls speak for themselves.
   Functions for setting the background and the font are inherited from QVBox.
*/

#include <q3vbox.h>
//Added by qt3to4:
#include <QLabel>
class QLabel;
class ScoreKeeper : public Q3VBox {
Q_OBJECT
public:
	explicit ScoreKeeper(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
	// set all values to 0
	void reset();
	// increase, or decrease the score
	void addPoints(short i);
	// advance one question
	void nextQuestion();
	// return the number of questions registered
	int getQuestions() const;
	// return the number of points registered
	int getPoints() const;
	// set and get the maximum number of questions
	void setNumQuestions(int);
	int getNumQuestions() const;
	// set and get the maximum number of points
	void setMaxNumPoints(int);
	int getMaxNumPoints() const;
private:
	bool hasmaxquestions;
	bool hasmaxpoints;
	int numquestions, maxquestions;
	int numpoints, maxpoints;
	QLabel *questions;
	QLabel *points;
	void updateLabels();
};	
#endif
