• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/highscore

kexthighscore.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KEXTHIGHSCORE_H
00021 #define KEXTHIGHSCORE_H
00022 
00023 #include "kexthighscore_item.h"
00024 
00025 #include <kurl.h>
00026 #include <libkdegames_export.h>
00027 
00028 #include <QtCore/QVector>
00029 
00030 
00031 
00032 namespace KExtHighscore
00033 {
00034 
00035 class Score;
00036 class Item;
00037 
00038 class ManagerPrivate;
00039 extern ManagerPrivate *internal;
00040 
00044 KDEGAMES_EXPORT uint gameType();
00045 
00049 KDEGAMES_EXPORT void setGameType(uint gameType);
00050 
00055 KDEGAMES_EXPORT bool configure(QWidget *parent);
00056 
00060 KDEGAMES_EXPORT void show(QWidget *parent);
00061 
00068 KDEGAMES_EXPORT void submitScore(const Score &score, QWidget *widget);
00069 
00074 KDEGAMES_EXPORT Score lastScore();
00075 
00080 KDEGAMES_EXPORT Score firstScore();
00081 
00141 class KDEGAMES_EXPORT Manager
00142 {
00143  public:
00152     explicit Manager(uint nbGameTypes = 1, uint maxNbEntries = 10);
00153     virtual ~Manager();
00154     
00165     void setWWHighscores(const KUrl &url, const QString &version);
00166 
00174     void setTrackLostGames(bool track);
00175     
00183     void setTrackDrawGames(bool track);
00184 
00194     void setShowStatistics(bool show);
00195     
00201     void setShowDrawGamesStatistic(bool show);
00202 
00203     enum ScoreTypeBound { ScoreNotBound, ScoreBound };
00209     void setScoreHistogram(const QVector<uint> &scores, ScoreTypeBound type);
00210 
00215     enum ShowMode { AlwaysShow,          
00216                     NeverShow,           
00217                     ShowForHigherScore,  
00218                     ShowForHighestScore  
00219                   };
00226     void setShowMode(ShowMode mode);
00227 
00233     enum ScoreType { Normal, MinuteTime };
00240     void setScoreType(ScoreType type);
00241 
00250     enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
00251                     ElapsedTime };
00255     static Item *createItem(ItemType type);
00256 
00263     void setScoreItem(uint worstScore, Item *item);
00264 
00270     void addScoreItem(const QString &name, Item *item);
00271 
00272     enum PlayerItemType { MeanScore, BestScore };
00278     void setPlayerItem(PlayerItemType type, Item *item);
00279 
00289     virtual bool isStrictlyLess(const Score &s1, const Score &s2) const;
00290 
00298     enum LabelType { Standard, I18N, WW, Icon };
00299 
00305     virtual QString gameTypeLabel(uint gameType, LabelType type) const;
00306 
00307  protected:
00315     virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
00316 
00330     void submitLegacyScore(const Score &score) const;
00331 
00340     virtual void additionalQueryItems(KUrl &url, const Score &score) const
00341         { Q_UNUSED(url); Q_UNUSED(score); }
00342 
00350     static void addToQueryURL(KUrl &url, const QString &item,
00351                               const QString &content);
00352 
00353     friend class ManagerPrivate;
00354 
00355  private:
00356     Manager(const Manager &);
00357     Manager &operator =(const Manager &);
00358 };
00359 
00360 } // namespace
00361 
00362 #endif

libkdegames/highscore

Skip menu "libkdegames/highscore"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal