Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Score Class Reference

#include </home/clem/local/src/opie/noncore/games/kpacman/score.h>

Collaboration diagram for Score:

Collaboration graph
[legend]
List of all members.

Public Slots

void setScheme (int scheme, int mode, Bitfont *font=0)
void set (int score)
void set (int score, int player)
void setScore (int level, int player)
void setPause (bool paused)
void initKeys ()

Signals

void toggleNew ()
void forcedHallOfFame (bool)

Public Member Functions

 Score (QWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0)
 ~Score ()

Protected Member Functions

void timerEvent (QTimerEvent *)
void paintEvent (QPaintEvent *)
void keyPressEvent (QKeyEvent *)
void focusInEvent (QFocusEvent *)
void focusOutEvent (QFocusEvent *)
void confScheme ()
void confTiming (bool defGroup=TRUE)

Private Slots

void read ()
void write ()
void end ()

Private Member Functions

QRect rect (int col, float row, QString str, int align=AlignCenter)
int x (int col)
int y (float row)
QString formatDate (QDate date)
QFileInfo locateHighscoreFilePath ()

Private Attributes

Bitfontbitfont
int cursorBlinkMS
int hallOfFameMS
int afterPauseMS
bool paused
uint UpKey
uint DownKey
uint RightKey
uint LeftKey
int lastScore
int lastPlayer
int HighScore
int playerScore [maxPlayer]
QString playerName [maxPlayer]
struct {
   int   x
   int   y
   QChar   chr
   bool   on
cursor
int cursorBlinkTimer
bool scrollRepeat
struct {
   int   points
   int   levels
   QTime   duration
   QDateTime   moment
   QString   name
hallOfFame [10]
QFileInfo systemHighscoreFileInfo
QFileInfo privateHighscoreFileInfo
QFile highscoreFile
int scheme
int mode

Constructor & Destructor Documentation

Score::Score QWidget *  parent = 0,
const char *  name = 0,
int  scheme = -1,
int  mode = -1,
Bitfont font = 0
 

Definition at line 25 of file score.cpp.

References QString::at(), at(), bitfont, confScheme(), cursor, cursorBlinkMS, cursorBlinkTimer, FALSE, Bitfont::firstChar(), highscoreFile, i, initKeys(), Bitfont::lastChar(), lastPlayer, lastScore, locateHighscoreFilePath(), maxPlayer, minPlayerNameLength, mode, p, paused, playerName, playerScore, read(), scheme, QString::setExpand(), and QFile::setName().

Score::~Score  ) 
 

Definition at line 65 of file score.cpp.


Member Function Documentation

void Score::confScheme  )  [protected]
 

Definition at line 288 of file score.cpp.

References APP_CONFIG_BEGIN, APP_CONFIG_END, confTiming(), cursorBlinkMS, cursorBlinkTimer, FALSE, mode, RESTORE_CONFIG_GROUP, SAVE_CONFIG_GROUP, scheme, and QString::sprintf().

Referenced by Score(), and setScheme().

void Score::confTiming bool  defGroup = TRUE  )  [protected]
 

Definition at line 276 of file score.cpp.

References afterPauseMS, APP_CONFIG_BEGIN, APP_CONFIG_END, cursorBlinkMS, and hallOfFameMS.

Referenced by confScheme().

void Score::end  )  [private, slot]
 

Definition at line 496 of file score.cpp.

References afterPauseMS, FALSE, forcedHallOfFame(), lastPlayer, and paused.

Referenced by keyPressEvent(), and setScore().

void Score::focusInEvent QFocusEvent *   )  [inline, protected]
 

Definition at line 61 of file score.h.

void Score::focusOutEvent QFocusEvent *   )  [inline, protected]
 

Definition at line 62 of file score.h.

void Score::forcedHallOfFame bool   )  [signal]
 

Referenced by end().

QString Score::formatDate QDate  date  )  [private]
 

Definition at line 514 of file score.cpp.

References QDate::day(), QDate::isValid(), QDate::month(), QString::replace(), s, QString::sprintf(), tr, and QDate::year().

Referenced by paintEvent().

void Score::initKeys  )  [slot]
 

Definition at line 255 of file score.cpp.

References APP_CONFIG_BEGIN, APP_CONFIG_END, DownKey, LeftKey, RightKey, and UpKey.

Referenced by Kpacman::confKeys(), and Score().

void Score::keyPressEvent QKeyEvent *   )  [protected]
 

Definition at line 178 of file score.cpp.

References bitfont, cursor, DownKey, end(), FALSE, Bitfont::firstChar(), hallOfFame, Bitfont::lastChar(), lastPlayer, lastScore, LeftKey, maxPlayer, paused, playerName, read(), rect(), RightKey, scrollRepeat, toggleNew(), TRUE, UpKey, write(), x, and y.

QFileInfo Score::locateHighscoreFilePath  )  [private]
 

Ermittelt die zu benutzende "highscore"-Datei, in die auch geschrieben werden kann. Über den "highscoreFilePath"-KConfig-Eintrag, kann abweichend von der Standardlokation der Standort der "highscore"-Datei spezifiziert werden. Wenn die systemweite "globale" Datei nicht beschrieben werden kann, wird mit einer privaten Datei gearbeitet.

Definition at line 572 of file score.cpp.

References privateHighscoreFileInfo.

Referenced by Score().

void Score::paintEvent QPaintEvent *   )  [protected]
 

Definition at line 70 of file score.cpp.

References bitBlt(), bitfont, BLACK, cursor, CYAN, QString::data(), QDateTime::date(), formatDate(), hallOfFame, height, HighScore, i, lastPlayer, lastScore, maxPlayer, moment, name, paused, pix, playerScore, points, Bitfont::rect(), rect(), RED, s, QString::sprintf(), Bitfont::text(), tr, QString::utf8(), WHITE, x, y, and YELLOW.

void Score::read  )  [private, slot]
 

Definition at line 439 of file score.cpp.

References QString::at(), bitfont, QFile::exists(), Bitfont::firstChar(), QString::fromLatin1(), hallOfFame, HighScore, highscoreFile, i, IO_ReadOnly, Bitfont::lastChar(), QString::length(), name, QFile::open(), s, and QFile::size().

Referenced by keyPressEvent(), and Score().

QRect Score::rect int  col,
float  row,
QString  str,
int  align = AlignCenter
[private]
 

Definition at line 529 of file score.cpp.

References bitfont, Bitfont::height(), QString::length(), Bitfont::rect(), Bitfont::width(), x, and y.

Referenced by keyPressEvent(), paintEvent(), set(), and timerEvent().

void Score::set int  score,
int  player
[slot]
 

Definition at line 368 of file score.cpp.

References FALSE, HighScore, lastPlayer, maxPlayer, playerScore, rect(), s, and QString::sprintf().

void Score::set int  score  )  [slot]
 

Definition at line 363 of file score.cpp.

void Score::setPause bool  paused  )  [slot]
 

Definition at line 484 of file score.cpp.

References bitfont, FALSE, height, paused, Bitfont::rect(), tr, and TRUE.

Referenced by Kpacman::pauseKpacman(), and Kpacman::togglePaused().

void Score::setScheme int  scheme,
int  mode,
Bitfont font = 0
[slot]
 

Definition at line 337 of file score.cpp.

References QString::at(), at(), bitfont, confScheme(), cursor, Bitfont::firstChar(), hallOfFame, i, Bitfont::lastChar(), QString::length(), maxPlayer, mode, name, p, playerName, and scheme.

Referenced by KpacmanWidget::setScheme().

void Score::setScore int  level,
int  player
[slot]
 

Definition at line 394 of file score.cpp.

References QDateTime::currentDateTime(), cursor, end(), hallOfFame, hallOfFameMS, i, lastPlayer, lastScore, maxPlayer, playerName, playerScore, points, and toggleNew().

void Score::timerEvent QTimerEvent *   )  [protected]
 

Definition at line 160 of file score.cpp.

References cursor, FALSE, lastPlayer, paused, rect(), scrollRepeat, and tr.

void Score::toggleNew  )  [signal]
 

Referenced by keyPressEvent(), and setScore().

void Score::write  )  [private, slot]
 

Definition at line 473 of file score.cpp.

References hallOfFame, highscoreFile, i, IO_WriteOnly, QFile::open(), and s.

Referenced by keyPressEvent().

int Score::x int  col  )  [private]
 

int Score::y float  row  )  [private]
 


Member Data Documentation

int Score::afterPauseMS [private]
 

Definition at line 87 of file score.h.

Referenced by confTiming(), and end().

Bitfont* Score::bitfont [private]
 

Definition at line 68 of file score.h.

Referenced by keyPressEvent(), paintEvent(), read(), rect(), Score(), setPause(), and setScheme().

QChar Score::chr [private]
 

Definition at line 105 of file score.h.

struct { ... } Score::cursor [private]
 

Referenced by keyPressEvent(), paintEvent(), Score(), setScheme(), setScore(), and timerEvent().

int Score::cursorBlinkMS [private]
 

Definition at line 85 of file score.h.

Referenced by confScheme(), confTiming(), and Score().

int Score::cursorBlinkTimer [private]
 

Definition at line 109 of file score.h.

Referenced by confScheme(), and Score().

uint Score::DownKey [private]
 

Definition at line 92 of file score.h.

Referenced by initKeys(), and keyPressEvent().

QTime Score::duration [private]
 

Definition at line 115 of file score.h.

struct { ... } Score::hallOfFame[10] [private]
 

Referenced by keyPressEvent(), paintEvent(), read(), setScheme(), setScore(), and write().

int Score::hallOfFameMS [private]
 

Definition at line 86 of file score.h.

Referenced by confTiming(), and setScore().

int Score::HighScore [private]
 

Definition at line 98 of file score.h.

Referenced by paintEvent(), read(), and set().

QFile Score::highscoreFile [private]
 

Definition at line 123 of file score.h.

Referenced by read(), Score(), and write().

int Score::lastPlayer [private]
 

Definition at line 97 of file score.h.

Referenced by end(), keyPressEvent(), paintEvent(), Score(), set(), setScore(), and timerEvent().

int Score::lastScore [private]
 

Definition at line 96 of file score.h.

Referenced by keyPressEvent(), paintEvent(), Score(), and setScore().

uint Score::LeftKey [private]
 

Definition at line 94 of file score.h.

Referenced by initKeys(), and keyPressEvent().

int Score::levels [private]
 

Definition at line 114 of file score.h.

int Score::mode [private]
 

Definition at line 126 of file score.h.

Referenced by confScheme(), Score(), and setScheme().

QDateTime Score::moment [private]
 

Definition at line 116 of file score.h.

Referenced by paintEvent().

QString Score::name [private]
 

Definition at line 117 of file score.h.

Referenced by paintEvent(), read(), and setScheme().

bool Score::on [private]
 

Definition at line 106 of file score.h.

bool Score::paused [private]
 

Definition at line 89 of file score.h.

Referenced by end(), keyPressEvent(), paintEvent(), Score(), setPause(), and timerEvent().

QString Score::playerName[maxPlayer] [private]
 

Definition at line 100 of file score.h.

Referenced by keyPressEvent(), Score(), setScheme(), and setScore().

int Score::playerScore[maxPlayer] [private]
 

Definition at line 99 of file score.h.

Referenced by paintEvent(), Score(), set(), and setScore().

int Score::points [private]
 

Definition at line 113 of file score.h.

Referenced by paintEvent(), and setScore().

QFileInfo Score::privateHighscoreFileInfo [private]
 

Definition at line 121 of file score.h.

Referenced by locateHighscoreFilePath().

uint Score::RightKey [private]
 

Definition at line 93 of file score.h.

Referenced by initKeys(), and keyPressEvent().

int Score::scheme [private]
 

Definition at line 125 of file score.h.

Referenced by confScheme(), Score(), and setScheme().

bool Score::scrollRepeat [private]
 

Definition at line 110 of file score.h.

Referenced by keyPressEvent(), and timerEvent().

QFileInfo Score::systemHighscoreFileInfo [private]
 

Definition at line 120 of file score.h.

uint Score::UpKey [private]
 

Definition at line 91 of file score.h.

Referenced by initKeys(), and keyPressEvent().

int Score::x [private]
 

Definition at line 555 of file score.cpp.

Referenced by keyPressEvent(), paintEvent(), and rect().

int Score::y [private]
 

Definition at line 560 of file score.cpp.

Referenced by keyPressEvent(), paintEvent(), and rect().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:51:14 2005 for OPIE by  doxygen 1.4.2