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 #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     // KDE4 remove this
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 } // namespace
00359 
00360 #endif
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 16 14:17:07 2005 by doxygen 1.4.0 written by Dimitri van Heesch, © 1997-2003