kexthighscore.h
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 #include <kdemacros.h>
00027
00028 class QTabWidget;
00029
00030
00031 namespace KExtHighscore
00032 {
00033
00034 class Score;
00035 class Item;
00036
00037 class ManagerPrivate;
00038 extern ManagerPrivate *internal;
00039
00043 KDE_EXPORT uint gameType();
00044
00048 KDE_EXPORT void setGameType(uint gameType);
00049
00054 KDE_EXPORT bool configure(QWidget *parent);
00055
00059 KDE_EXPORT void show(QWidget *parent);
00060
00066 KDE_EXPORT void submitScore(const Score &score, QWidget *widget);
00067
00072 KDE_EXPORT Score lastScore();
00073
00078 KDE_EXPORT Score firstScore();
00079
00139 class KDE_EXPORT Manager
00140 {
00141 public:
00150 Manager(uint nbGameTypes = 1, uint maxNbEntries = 10);
00151 virtual ~Manager();
00152
00163 void setWWHighscores(const KURL &url, const QString &version);
00164
00172 void setTrackLostGames(bool track);
00173
00182 void setTrackDrawGames(bool track);
00183
00194 void setShowStatistics(bool show);
00195
00197
00198 void showStatistics(bool show) KDE_DEPRECATED;
00199
00206 void setShowDrawGamesStatistic(bool show);
00207
00208 enum ScoreTypeBound { ScoreNotBound, ScoreBound };
00214 void setScoreHistogram(const QMemArray<uint> &scores, ScoreTypeBound type);
00215
00216 enum ShowMode { AlwaysShow, NeverShow, ShowForHigherScore,
00217 ShowForHighestScore };
00224 void setShowMode(ShowMode mode);
00225
00231 enum ScoreType { Normal, MinuteTime };
00238 void setScoreType(ScoreType type);
00239
00248 enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
00249 ElapsedTime };
00253 static Item *createItem(ItemType type);
00254
00261 void setScoreItem(uint worstScore, Item *item);
00262
00268 void addScoreItem(const QString &name, Item *item);
00269
00270 enum PlayerItemType { MeanScore, BestScore };
00276 void setPlayerItem(PlayerItemType type, Item *item);
00277
00287 virtual bool isStrictlyLess(const Score &s1, const Score &s2) const;
00288
00296 enum LabelType { Standard, I18N, WW, Icon };
00297
00303 virtual QString gameTypeLabel(uint gameType, LabelType type) const;
00304
00305 protected:
00313 virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
00314
00328 void submitLegacyScore(const Score &score) const;
00329
00338 virtual void additionalQueryItems(KURL &url, const Score &score) const
00339 { Q_UNUSED(url); Q_UNUSED(score); }
00340
00348 static void addToQueryURL(KURL &url, const QString &item,
00349 const QString &content);
00350
00351 friend class ManagerPrivate;
00352
00353 private:
00354 Manager(const Manager &);
00355 Manager &operator =(const Manager &);
00356 };
00357
00358 }
00359
00360 #endif
This file is part of the documentation for libkdegames Library Version 3.3.91.