libkdegames Library API Documentation

kexthighscore.h

00001 /* 00002 This file is part of the KDE games library 00003 Copyright (C) 2001-2004 Nicolas Hadacek (hadacek@kde.org) 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 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 // KDE4 remove this 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 } // namespace 00358 00359 #endif
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 26 00:21:38 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003