#include <kexthighscore.h>
Public Types | |
| enum | ScoreTypeBound { ScoreNotBound, ScoreBound } |
| enum | ShowMode { AlwaysShow, NeverShow, ShowForHigherScore, ShowForHighestScore } |
| Enumerate different conditions under which to show the high score dialog. More... | |
| enum | ScoreType { Normal, MinuteTime } |
| Score type (. More... | |
| enum | ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault, ElapsedTime } |
| Some predefined item types. More... | |
| enum | PlayerItemType { MeanScore, BestScore } |
| enum | LabelType { Standard, I18N, WW, Icon } |
| Possible type of label (. More... | |
Public Member Functions | |
| Manager (uint nbGameTypes=1, uint maxNbEntries=10) | |
| Constructor. | |
| virtual | ~Manager () |
| void | setWWHighscores (const KURL &url, const QString &version) |
| Set the world-wide highscores. | |
| void | setTrackLostGames (bool track) |
| Set if the number of lost games should be track for the world-wide highscores statistics. | |
| void | setTrackDrawGames (bool track) |
| void | setShowStatistics (bool show) |
| void | showStatistics (bool show) KDE_DEPRECATED |
| | |
| void | setShowDrawGamesStatistic (bool show) |
| void | setScoreHistogram (const QMemArray< uint > &scores, ScoreTypeBound type) |
| Set the ranges for the score histogram. | |
| void | setShowMode (ShowMode mode) |
| Set how the highscores dialog is shown at game end. | |
| void | setScoreType (ScoreType type) |
| Set score type. | |
| void | setScoreItem (uint worstScore, Item *item) |
| Replace the default score item in the highscores list by the given one. | |
| void | addScoreItem (const QString &name, Item *item) |
| Add an item in the highscores list (it will add a column to this list). | |
| void | setPlayerItem (PlayerItemType type, Item *item) |
| Replace an item in the players list. | |
| virtual bool | isStrictlyLess (const Score &s1, const Score &s2) const |
| virtual QString | gameTypeLabel (uint gameType, LabelType type) const |
Static Public Member Functions | |
| static Item * | createItem (ItemType type) |
| Create a predefined item. | |
Protected Member Functions | |
| virtual void | convertLegacy (uint gameType) |
| This method is called once for each player (ie for each user). | |
| void | submitLegacyScore (const Score &score) const |
| This method should be called from convertLegacy. | |
| virtual void | additionalQueryItems (KURL &url, const Score &score) const |
| This method is called before submitting a score to the world-wide highscores server. | |
Static Protected Member Functions | |
| static void | addToQueryURL (KURL &url, const QString &item, const QString &content) |
| Add an entry to the url to be submitted (. | |
Friends | |
| class | ManagerPrivate |
You need one instance of this class during the application lifetime ; in main() just insert
KExtHighscore::Manager highscoresManager;
This class has three functions :
The highscores and the players lists contain several items described by the Item class.
The highscores list contains by default :
The players list contains :
To submit a new score at game end, just construct a Score, set the score data and then call submitScore().
KExtHighscore::Score score(KExtHighscore::Won); score.setScore(myScore); KExtHighscore::submitScore(score, widget);
Definition at line 139 of file kexthighscore.h.
|
|
Some predefined item types.
Definition at line 255 of file kexthighscore.h. |
|
|
Possible type of label (.
Definition at line 303 of file kexthighscore.h. |
|
|
Definition at line 277 of file kexthighscore.h. |
|
|
Score type (.
Definition at line 238 of file kexthighscore.h. |
|
|
Definition at line 208 of file kexthighscore.h. |
|
|
Enumerate different conditions under which to show the high score dialog.
Definition at line 220 of file kexthighscore.h. |
|
||||||||||||
|
Constructor.
Definition at line 107 of file kexthighscore.cpp. References KExtHighscore::ManagerPrivate::init(), KExtHighscore::internal, and ManagerPrivate. Here is the call graph for this function: ![]() |
|
|
Definition at line 117 of file kexthighscore.cpp. References KExtHighscore::internal. |
|
||||||||||||
|
This method is called before submitting a score to the world-wide highscores server. You can reimplement this method to add an entry with addToQueryURL. By default this method does nothing.
Definition at line 345 of file kexthighscore.h. |
|
||||||||||||
|
Add an item in the highscores list (it will add a column to this list). Note : This method should be called at construction time. Definition at line 241 of file kexthighscore.cpp. References KExtHighscore::ItemArray::addItem(), KExtHighscore::internal, and KExtHighscore::ManagerPrivate::scoreInfos(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Add an entry to the url to be submitted (.
Definition at line 278 of file kexthighscore.cpp. Referenced by KExtHighscore::ManagerPrivate::modifySettings(), and KExtHighscore::ManagerPrivate::queryURL(). |
|
|
This method is called once for each player (ie for each user). You can reimplement it to convert old style highscores to the new mechanism (
Definition at line 320 of file kexthighscore.h. Referenced by KExtHighscore::ManagerPrivate::setGameType(). |
|
|
Create a predefined item.
Definition at line 206 of file kexthighscore.cpp. References BestScoreDefault, KExtHighscore::Item::DefaultNotDefined, ElapsedTime, MeanScoreDefault, KExtHighscore::Item::MinuteTime, KExtHighscore::Item::OneDecimal, ScoreDefault, KExtHighscore::Item::setPrettyFormat(), KExtHighscore::Item::setPrettySpecial(), and KExtHighscore::Item::ZeroNotDefined. Referenced by KExtHighscore::PlayerInfos::PlayerInfos(), KExtHighscore::ScoreInfos::ScoreInfos(), and setScoreType(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 264 of file kexthighscore.cpp. References I18N, Icon, Standard, and WW. Referenced by KExtHighscore::ManagerPrivate::exportHighscores(), KExtHighscore::HighscoresDialog::HighscoresDialog(), and KExtHighscore::ManagerPrivate::queryURL(). |
|
||||||||||||
|
s1<s2since the operator calls this method. Definition at line 201 of file kexthighscore.cpp. References KExtHighscore::Score::score(). Referenced by KExtHighscore::Score::operator<(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Replace an item in the players list. Note : This method should be called at construction time. Definition at line 246 of file kexthighscore.cpp. References BestScore, KExtHighscore::Item::defaultValue(), KExtHighscore::internal, KExtHighscore::ItemContainer::item(), KExtHighscore::ItemArray::item(), MeanScore, KExtHighscore::ManagerPrivate::playerInfos(), KExtHighscore::ManagerPrivate::scoreInfos(), KExtHighscore::Item::setDefaultValue(), and KExtHighscore::ItemArray::setItem(). Referenced by setScoreType(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Set the ranges for the score histogram. Note: should be called at construction time. Definition at line 160 of file kexthighscore.cpp. References KExtHighscore::PlayerInfos::createHistoItems(), KExtHighscore::internal, KExtHighscore::ManagerPrivate::playerInfos(), and ScoreBound. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Replace the default score item in the highscores list by the given one.
Note : This method should be called at construction time. Definition at line 231 of file kexthighscore.cpp. References KExtHighscore::internal, KExtHighscore::ItemContainer::item(), KExtHighscore::ItemArray::item(), KExtHighscore::ManagerPrivate::playerInfos(), KExtHighscore::ManagerPrivate::scoreInfos(), KExtHighscore::Item::setDefaultValue(), and KExtHighscore::ItemArray::setItem(). Referenced by setScoreType(). Here is the call graph for this function: ![]() |
|
|
Set score type. Helper method to quickly set the type of score. By default the type is Normal. Note: should be called at construction time. Definition at line 174 of file kexthighscore.cpp. References BestScore, BestScoreDefault, createItem(), MeanScore, MeanScoreDefault, KExtHighscore::Item::MinuteTime, MinuteTime, Normal, ScoreDefault, setPlayerItem(), KExtHighscore::Item::setPrettyFormat(), and setScoreItem(). Here is the call graph for this function: ![]() |
|
|
Definition at line 143 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::showDrawGames. |
|
|
Set how the highscores dialog is shown at game end. By default, the mode is ShowForHigherScore. Note: should be called at construction time. Definition at line 169 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::showMode. |
|
|
Definition at line 133 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::showStatistics. |
|
|
Definition at line 128 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::trackDrawGames. |
|
|
Set if the number of lost games should be track for the world-wide highscores statistics. By default, there is no tracking. False by default. Note: should be called at construction time. Definition at line 123 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::trackLostGames. |
|
||||||||||||
|
Set the world-wide highscores. By default there is no world-wide highscores. Note: should be called at construction time.
Definition at line 148 of file kexthighscore.cpp. References KExtHighscore::internal, KExtHighscore::ManagerPrivate::serverURL, and KExtHighscore::ManagerPrivate::version. |
|
|
Definition at line 138 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::showStatistics. |
|
|
This method should be called from convertLegacy. It is used to submit an old highscore (it will not be send over the network). For each score do something like: Score score(Won); score.setScore(oldScore); score.setData("name", name); submitLegacyScore(score); Definition at line 196 of file kexthighscore.cpp. References KExtHighscore::internal, and KExtHighscore::ManagerPrivate::submitLocal(). Here is the call graph for this function: ![]() |
|
|
Definition at line 358 of file kexthighscore.h. Referenced by Manager(). |
1.4.6