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
00161
void setWWHighscores(
const KURL &url,
const QString &version);
00162
00169
void setTrackLostGames(
bool track);
00170
00179
void showStatistics(
bool show);
00180
00181
enum ScoreTypeBound { ScoreNotBound, ScoreBound };
00187
void setScoreHistogram(
const QMemArray<uint> &scores, ScoreTypeBound type);
00188
00189
enum ShowMode { AlwaysShow, NeverShow, ShowForHigherScore,
00190 ShowForHighestScore };
00197
void setShowMode(ShowMode mode);
00198
00204 enum ScoreType { Normal, MinuteTime };
00210
void setScoreType(ScoreType type);
00211
00220 enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
00221 ElapsedTime };
00225
static Item *createItem(ItemType type);
00226
00233
void setScoreItem(uint worstScore,
Item *item);
00234
00240
void addScoreItem(
const QString &name,
Item *item);
00241
00242
enum PlayerItemType { MeanScore, BestScore };
00248
void setPlayerItem(PlayerItemType type, Item *item);
00249
00259
virtual bool isStrictlyLess(
const Score &s1,
const Score &s2)
const;
00260
00268 enum LabelType { Standard, I18N, WW, Icon };
00269
00275
virtual QString gameTypeLabel(uint gameType, LabelType type)
const;
00276
00277
protected:
00285 virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
00286
00300
void submitLegacyScore(
const Score &score)
const;
00301
00310 virtual void additionalQueryItems(KURL &url,
const Score &score)
const
00311
{ Q_UNUSED(url); Q_UNUSED(score); }
00312
00320
static void addToQueryURL(KURL &url,
const QString &item,
00321
const QString &content);
00322
00323
friend class ManagerPrivate;
00324
00325
private:
00326
Manager(
const Manager &);
00327
Manager &operator =(
const Manager &);
00328 };
00329
00330 }
00331
00332
#endif