• 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
28class TQTabWidget;
29
30
31namespace KExtHighscore
32{
33
34class Score;
35class Item;
36
37class ManagerPrivate;
38extern ManagerPrivate *internal;
39
43TDE_EXPORT uint gameType();
44
48TDE_EXPORT void setGameType(uint gameType);
49
54TDE_EXPORT bool configure(TQWidget *parent);
55
59TDE_EXPORT void show(TQWidget *parent);
60
66TDE_EXPORT void submitScore(const Score &score, TQWidget *widget);
67
72TDE_EXPORT Score lastScore();
73
78TDE_EXPORT Score firstScore();
79
139class TDE_EXPORT Manager
140{
141 public:
150 Manager(uint nbGameTypes = 1, uint maxNbEntries = 10);
151 virtual ~Manager();
152
160 void setTrackLostGames(bool track);
161
170 void setTrackDrawGames(bool track);
171
182 void setShowStatistics(bool show);
183
185 // KDE4 remove this
186 void showStatistics(bool show) TDE_DEPRECATED;
187
194 void setShowDrawGamesStatistic(bool show);
195
196 enum ScoreTypeBound { ScoreNotBound, ScoreBound };
202 void setScoreHistogram(const TQMemArray<uint> &scores, ScoreTypeBound type);
203
208 enum ShowMode { AlwaysShow,
209 NeverShow,
210 ShowForHigherScore,
211 ShowForHighestScore
212 };
219 void setShowMode(ShowMode mode);
220
226 enum ScoreType { Normal, MinuteTime };
233 void setScoreType(ScoreType type);
234
243 enum ItemType { ScoreDefault, MeanScoreDefault, BestScoreDefault,
244 ElapsedTime };
245
248 static Item *createItem(ItemType type);
249
256 void setScoreItem(uint worstScore, Item *item);
257
263 void addScoreItem(const TQString &name, Item *item);
264
265 enum PlayerItemType { MeanScore, BestScore };
271 void setPlayerItem(PlayerItemType type, Item *item);
272
282 virtual bool isStrictlyLess(const Score &s1, const Score &s2) const;
283
291 enum LabelType { Standard, I18N, WW, Icon };
292
298 virtual TQString gameTypeLabel(uint gameType, LabelType type) const;
299
300 protected:
308 virtual void convertLegacy(uint gameType) { Q_UNUSED(gameType); }
309
323 void submitLegacyScore(const Score &score) const;
324
325 friend class ManagerPrivate;
326
327 private:
328 Manager(const Manager &);
329 Manager &operator =(const Manager &);
330};
331
332} // namespace
333
334#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::setTrackDrawGames
void setTrackDrawGames(bool track)
Definition kexthighscore.cpp:128
KExtHighscore::Manager::ShowMode
ShowMode
Enumerate different conditions under which to show the high score dialog.
Definition kexthighscore.h:208
KExtHighscore::Manager::AlwaysShow
@ AlwaysShow
Always show the dialog.
Definition kexthighscore.h:208
KExtHighscore::Manager::NeverShow
@ NeverShow
Never show the dialog.
Definition kexthighscore.h:209
KExtHighscore::Manager::ShowForHighestScore
@ ShowForHighestScore
Only for the top spot.
Definition kexthighscore.h:211
KExtHighscore::Manager::ShowForHigherScore
@ ShowForHigherScore
Show if score has improved.
Definition kexthighscore.h:210
KExtHighscore::Manager::ItemType
ItemType
Some predefined item types.
Definition kexthighscore.h:243
KExtHighscore::Manager::setTrackLostGames
void setTrackLostGames(bool track)
Set if the number of lost games should be track for the world-wide highscores statistics.
Definition kexthighscore.cpp:123
KExtHighscore::Manager::LabelType
LabelType
Possible type of label (.
Definition kexthighscore.h:291
KExtHighscore::Manager::setShowStatistics
void setShowStatistics(bool show)
Definition kexthighscore.cpp:133
KExtHighscore::Manager::ScoreType
ScoreType
Score type (.
Definition kexthighscore.h:226
KExtHighscore::Manager::Manager
Manager(uint nbGameTypes=1, uint maxNbEntries=10)
Constructor.
Definition kexthighscore.cpp:107
KExtHighscore::Manager::showStatistics
void showStatistics(bool show) TDE_DEPRECATED
Definition kexthighscore.cpp:138
KExtHighscore::Manager::setScoreHistogram
void setScoreHistogram(const TQMemArray< uint > &scores, ScoreTypeBound type)
Set the ranges for the score histogram.
Definition kexthighscore.cpp:148
KExtHighscore::Manager::convertLegacy
virtual void convertLegacy(uint gameType)
This method is called once for each player (ie for each user).
Definition kexthighscore.h:308
KExtHighscore::Manager::setShowDrawGamesStatistic
void setShowDrawGamesStatistic(bool show)
Definition kexthighscore.cpp:143
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.15.0
This website is maintained by Timothy Pearson.