libkdegames Library API Documentation

KScoreDialog Class Reference

A simple high score dialog. More...

#include <kscoredialog.h>

List of all members.

Public Types

typedef QMap< int, QStringFieldInfo
enum  Fields {
  Name = 1 << 0, Level = 1 << 1, Custom1 = 1 << 10, Custom2 = 1 << 11,
  Custom3 = 1 << 12, Time = 1 << 28, Score = 1 << 29
}

Public Methods

 KScoreDialog (int fields, QWidget *parent=0, const char *name=0)
 ~KScoreDialog ()
void setConfigGroup (const QString &group)
void setComment (const QString &comment)
void addField (int field, const QString &header, const QString &key)
int addScore (int newScore, const FieldInfo &newInfo, bool askName, bool lessIsMore)
int addScore (int newScore, const FieldInfo &newInfo, bool askName=true)
int highScore ()
virtual void show ()


Detailed Description

A simple high score dialog.

Definition at line 40 of file kscoredialog.h.


Constructor & Destructor Documentation

KScoreDialog::KScoreDialog int    fields,
QWidget   parent = 0,
const char *    name = 0
 

Parameters:
fields  Which fields should be listed.
parent  passed to parent QWidget constructor
name  passed to parent QWidget constructor

Definition at line 67 of file kscoredialog.cpp.


Member Function Documentation

void KScoreDialog::setConfigGroup const QString   group
 

Parameters:
group  to use for reading/writing highscores from/to. By default the class will use "High Score"

Definition at line 98 of file kscoredialog.cpp.

void KScoreDialog::setComment const QString   comment
 

Parameters:
comment  to add when showing high-scores. The comment is only used once.

Definition at line 104 of file kscoredialog.cpp.

void KScoreDialog::addField int    field,
const QString   header,
const QString   key
 

Define an extra FieldInfo entry.

Parameters:
field  Id of this field
header  Header shown in the dialog for this field
key  used to store this field with.

Definition at line 109 of file kscoredialog.cpp.

int KScoreDialog::addScore int    newScore,
const FieldInfo &    newInfo,
bool    askName,
bool    lessIsMore
 

Adds a new score to the list.

Parameters:
newScore  the score of this game.
newInfo  additional info about the score.
askName  Whether to prompt for the players name.
lessIsMore  If true, the lowest score is the best score.
Returns:
The highscore position if the score was good enough to make it into the list (1 being topscore) or 0 otherwise.

Definition at line 323 of file kscoredialog.cpp.

int KScoreDialog::highScore  
 

Returns the current best score.

Definition at line 389 of file kscoredialog.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 10:06:40 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003