00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef KEXTHIGHSCORE_H
00021
#define KEXTHIGHSCORE_H
00022
00023
#include "kexthighscore_item.h"
00024
00025
#include <kurl.h>
00026
00027
class QTabWidget;
00028
00029
00030
namespace KExtHighscore
00031 {
00032
00033
class Score;
00034
class Item;
00035
00036
class ManagerPrivate;
00037
extern ManagerPrivate *internal;
00038
00042 uint gameType();
00043
00047
void setGameType(uint gameType);
00048
00053
bool configure(
QWidget *parent);
00054
00058
void show(
QWidget *parent);
00059
00065
void submitScore(
const Score &score,
QWidget *widget);
00066
00071 Score lastScore();
00072
00077 Score firstScore();
00078
00138 class Manager
00139 {
00140
public:
00149
Manager(uint nbGameTypes = 1, uint maxNbEntries = 10);
00150
virtual ~
Manager();
00151
00162
void setWWHighscores(
const KURL &url,
const QString &version);
00163
00171
void setTrackLostGames(
bool track);
00172
00181
void setTrackDrawGames(
bool track);
00182
00193
void setShowStatistics(
bool show);
00194
00196
00197
void showStatistics(
bool show) KDE_DEPRECATED;
00198
00205
void setShowDrawGamesStatistic(
bool show);
00206
00207
enum ScoreTypeBound { ScoreNotBound, ScoreBound };
00213
void setScoreHistogram(
const QMemArray<uint> &scores, ScoreTypeBound type);
00214
00215
enum ShowMode { AlwaysShow, NeverShow, ShowForHigherScore,
00216 ShowForHighestScore };
00223
void setShowMode(ShowMode mode);
00224
00230 enum ScoreType { Normal, MinuteTime };
00237
void setScoreType(ScoreType type);
00238
00247 enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
00248 ElapsedTime };
00252
static Item *
createItem(ItemType type);
00253
00260
void setScoreItem(uint worstScore,
Item *item);
00261
00267
void addScoreItem(
const QString &name,
Item *item);
00268
00269
enum PlayerItemType { MeanScore, BestScore };
00275
void setPlayerItem(PlayerItemType type, Item *item);
00276
00286
virtual bool isStrictlyLess(
const Score &s1,
const Score &s2)
const;
00287
00295 enum LabelType { Standard, I18N, WW, Icon };
00296
00302
virtual QString gameTypeLabel(uint gameType, LabelType type)
const;
00303
00304
protected:
00312 virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
00313
00327
void submitLegacyScore(
const Score &score)
const;
00328
00337 virtual void additionalQueryItems(KURL &url,
const Score &score)
const
00338
{ Q_UNUSED(url); Q_UNUSED(score); }
00339
00347
static void addToQueryURL(KURL &url,
const QString &item,
00348
const QString &content);
00349
00350
friend class ManagerPrivate;
00351
00352
private:
00353
Manager(
const Manager &);
00354
Manager &operator =(
const Manager &);
00355 };
00356
00357 }
00358
00359
#endif