• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
  • highscore
kexthighscore.h
1 /*
2  This file is part of the TDE 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 <tdemacros.h>
27 
28 class TQTabWidget;
29 
30 
31 namespace KExtHighscore
32 {
33 
34 class Score;
35 class Item;
36 
37 class ManagerPrivate;
38 extern ManagerPrivate *internal;
39 
43 TDE_EXPORT uint gameType();
44 
48 TDE_EXPORT void setGameType(uint gameType);
49 
54 TDE_EXPORT bool configure(TQWidget *parent);
55 
59 TDE_EXPORT void show(TQWidget *parent);
60 
66 TDE_EXPORT void submitScore(const Score &score, TQWidget *widget);
67 
72 TDE_EXPORT Score lastScore();
73 
78 TDE_EXPORT Score firstScore();
79 
139 class TDE_EXPORT Manager
140 {
141  public:
150  Manager(uint nbGameTypes = 1, uint maxNbEntries = 10);
151  virtual ~Manager();
152 
163  void setWWHighscores(const KURL &url, const TQString &version);
164 
172  void setTrackLostGames(bool track);
173 
182  void setTrackDrawGames(bool track);
183 
194  void setShowStatistics(bool show);
195 
197  // KDE4 remove this
198  void showStatistics(bool show) TDE_DEPRECATED;
199 
206  void setShowDrawGamesStatistic(bool show);
207 
208  enum ScoreTypeBound { ScoreNotBound, ScoreBound };
214  void setScoreHistogram(const TQMemArray<uint> &scores, ScoreTypeBound type);
215 
220  enum ShowMode { AlwaysShow,
221  NeverShow,
222  ShowForHigherScore,
223  ShowForHighestScore
224  };
231  void setShowMode(ShowMode mode);
232 
238  enum ScoreType { Normal, MinuteTime };
245  void setScoreType(ScoreType type);
246 
255  enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
256  ElapsedTime };
260  static Item *createItem(ItemType type);
261 
268  void setScoreItem(uint worstScore, Item *item);
269 
275  void addScoreItem(const TQString &name, Item *item);
276 
277  enum PlayerItemType { MeanScore, BestScore };
283  void setPlayerItem(PlayerItemType type, Item *item);
284 
294  virtual bool isStrictlyLess(const Score &s1, const Score &s2) const;
295 
303  enum LabelType { Standard, I18N, WW, Icon };
304 
310  virtual TQString gameTypeLabel(uint gameType, LabelType type) const;
311 
312  protected:
320  virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
321 
335  void submitLegacyScore(const Score &score) const;
336 
345  virtual void additionalQueryItems(KURL &url, const Score &score) const
346  { Q_UNUSED(url); Q_UNUSED(score); }
347 
355  static void addToQueryURL(KURL &url, const TQString &item,
356  const TQString &content);
357 
358  friend class ManagerPrivate;
359 
360  private:
361  Manager(const Manager &);
362  Manager &operator =(const Manager &);
363 };
364 
365 } // namespace
366 
367 #endif
KExtHighscore::Item
This class defines how to convert and how to display a highscore element (such as the score,...
Definition: kexthighscore_item.h:41
KExtHighscore::Manager
This class manages highscores and players entries (several players can share the same highscores list...
Definition: kexthighscore.h:140
KExtHighscore::Manager::ShowMode
ShowMode
Enumerate different conditions under which to show the high score dialog.
Definition: kexthighscore.h:220
KExtHighscore::Manager::AlwaysShow
@ AlwaysShow
Always show the dialog.
Definition: kexthighscore.h:220
KExtHighscore::Manager::NeverShow
@ NeverShow
Never show the dialog.
Definition: kexthighscore.h:221
KExtHighscore::Manager::ShowForHigherScore
@ ShowForHigherScore
Show if score has improved.
Definition: kexthighscore.h:222
KExtHighscore::Manager::ItemType
ItemType
Some predefined item types.
Definition: kexthighscore.h:255
KExtHighscore::Manager::LabelType
LabelType
Possible type of label (.
Definition: kexthighscore.h:303
KExtHighscore::Manager::ScoreType
ScoreType
Score type (.
Definition: kexthighscore.h:238
KExtHighscore::Manager::convertLegacy
virtual void convertLegacy(uint gameType)
This method is called once for each player (ie for each user).
Definition: kexthighscore.h:320
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:345
KExtHighscore::Score
This class contains data for a score.
Definition: kexthighscore_item.h:176

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.1
This website is maintained by Timothy Pearson.