• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames/highscore

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
  • highscore
kexthighscore.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2001-2004 Nicolas Hadacek (hadacek@kde.org)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KEXTHIGHSCORE_H
21 #define KEXTHIGHSCORE_H
22 
23 #include "kexthighscore_item.h"
24 
25 #include <kurl.h>
26 #include <libkdegames_export.h>
27 
28 #include <QtCore/QVector>
29 
30 
31 
32 namespace KExtHighscore
33 {
34 
35 class Score;
36 class Item;
37 
38 class ManagerPrivate;
39 extern ManagerPrivate *internal;
40 
44 KDEGAMES_EXPORT uint gameType();
45 
49 KDEGAMES_EXPORT void setGameType(uint gameType);
50 
55 KDEGAMES_EXPORT bool configure(QWidget *parent);
56 
60 KDEGAMES_EXPORT void show(QWidget *parent);
61 
68 KDEGAMES_EXPORT void submitScore(const Score &score, QWidget *widget);
69 
74 KDEGAMES_EXPORT Score lastScore();
75 
80 KDEGAMES_EXPORT Score firstScore();
81 
141 class KDEGAMES_EXPORT Manager
142 {
143  public:
152  explicit Manager(uint nbGameTypes = 1, uint maxNbEntries = 10);
153  virtual ~Manager();
154 
165  void setWWHighscores(const KUrl &url, const QString &version);
166 
174  void setTrackLostGames(bool track);
175 
183  void setTrackDrawGames(bool track);
184 
194  void setShowStatistics(bool show);
195 
201  void setShowDrawGamesStatistic(bool show);
202 
203  enum ScoreTypeBound { ScoreNotBound, ScoreBound };
209  void setScoreHistogram(const QVector<uint> &scores, ScoreTypeBound type);
210 
215  enum ShowMode { AlwaysShow,
216  NeverShow,
217  ShowForHigherScore,
218  ShowForHighestScore
219  };
226  void setShowMode(ShowMode mode);
227 
233  enum ScoreType { Normal, MinuteTime };
240  void setScoreType(ScoreType type);
241 
250  enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
251  ElapsedTime };
255  static Item *createItem(ItemType type);
256 
263  void setScoreItem(uint worstScore, Item *item);
264 
270  void addScoreItem(const QString &name, Item *item);
271 
272  enum PlayerItemType { MeanScore, BestScore };
278  void setPlayerItem(PlayerItemType type, Item *item);
279 
289  virtual bool isStrictlyLess(const Score &s1, const Score &s2) const;
290 
298  enum LabelType { Standard, I18N, WW, Icon };
299 
305  virtual QString gameTypeLabel(uint gameType, LabelType type) const;
306 
307  protected:
315  virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
316 
330  void submitLegacyScore(const Score &score) const;
331 
340  virtual void additionalQueryItems(KUrl &url, const Score &score) const
341  { Q_UNUSED(url); Q_UNUSED(score); }
342 
350  static void addToQueryURL(KUrl &url, const QString &item,
351  const QString &content);
352 
353  friend class ManagerPrivate;
354 
355  private:
356  Manager(const Manager &);
357  Manager &operator =(const Manager &);
358 };
359 
360 } // namespace
361 
362 #endif
QWidget
KExtHighscore::Manager
This class manages highscores and players entries (several players can share the same highscores list...
Definition: kexthighscore.h:141
KExtHighscore::Manager::ScoreType
ScoreType
Score type (.
Definition: kexthighscore.h:233
KExtHighscore::submitScore
void submitScore(const Score &score, QWidget *widget)
Submit a score.
Definition: kexthighscore.cpp:66
KExtHighscore::show
void show(QWidget *parent, int rank)
Definition: kexthighscore.cpp:59
KExtHighscore::Manager::PlayerItemType
PlayerItemType
Definition: kexthighscore.h:272
KExtHighscore::lastScore
Score lastScore()
Definition: kexthighscore.cpp:92
KExtHighscore::ManagerPrivate
Definition: kexthighscore_internal.h:227
KExtHighscore::Item
This class defines how to convert and how to display a highscore element (such as the score...
Definition: kexthighscore_item.h:39
KExtHighscore::Manager::ShowMode
ShowMode
Enumerate different conditions under which to show the high score dialog.
Definition: kexthighscore.h:215
KExtHighscore::Manager::additionalQueryItems
virtual void additionalQueryItems(KUrl &url, const Score &score) const
This method is called before submitting a score to the world-wide highscores server.
Definition: kexthighscore.h:340
KExtHighscore::Manager::ItemType
ItemType
Some predefined item types.
Definition: kexthighscore.h:250
KExtHighscore::ScoreType
ScoreType
Possible score type.
Definition: kexthighscore_item.h:168
KExtHighscore::Manager::LabelType
LabelType
Possible type of label (.
Definition: kexthighscore.h:298
KExtHighscore::Manager::WW
Definition: kexthighscore.h:298
QString
KExtHighscore::firstScore
Score firstScore()
Definition: kexthighscore.cpp:100
KExtHighscore::Manager::ScoreTypeBound
ScoreTypeBound
Definition: kexthighscore.h:203
KExtHighscore::setGameType
void setGameType(uint type)
Set the current game type.
Definition: kexthighscore.cpp:44
KExtHighscore::configure
bool configure(QWidget *parent)
Configure the highscores.
Definition: kexthighscore.cpp:49
KExtHighscore::gameType
uint gameType()
Get the current game type.
Definition: kexthighscore.cpp:38
KExtHighscore::Manager::ShowForHigherScore
Show if score has improved.
Definition: kexthighscore.h:217
QVector< uint >
kexthighscore_item.h
KExtHighscore::Manager::ScoreDefault
Definition: kexthighscore.h:250
KExtHighscore::Score
This class contains data for a score.
Definition: kexthighscore_item.h:178
KExtHighscore::Manager::NeverShow
Never show the dialog.
Definition: kexthighscore.h:216
KExtHighscore::Manager::convertLegacy
virtual void convertLegacy(uint gameType)
This method is called once for each player (ie for each user).
Definition: kexthighscore.h:315
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames/highscore

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

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal