• 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
kscoredialog.h
Go to the documentation of this file.
1 /****************************************************************
2 Copyright (c) 1998 Sandro Sigala <ssigala@globalnet.it>
3 Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
4 Copyright (c) 2007 Matt Williams <matt@milliams.com>
5 All rights reserved.
6 
7 Permission to use, copy, modify, and distribute this software
8 and its documentation for any purpose and without fee is hereby
9 granted, provided that the above copyright notice appear in all
10 copies and that both that the copyright notice and this
11 permission notice and warranty disclaimer appear in supporting
12 documentation, and that the name of the author not be used in
13 advertising or publicity pertaining to distribution of the
14 software without specific, written prior permission.
15 
16 The author disclaim all warranties with regard to this
17 software, including all implied warranties of merchantability
18 and fitness. In no event shall the author be liable for any
19 special, indirect or consequential damages or any damages
20 whatsoever resulting from loss of use, data or profits, whether
21 in an action of contract, negligence or other tortious action,
22 arising out of or in connection with the use or performance of
23 this software.
24 ****************************************************************/
25 
26 #ifndef KSCOREDIALOG_H
27 #define KSCOREDIALOG_H
28 
29 #include <libkdegames_export.h>
30 
31 #include <QtCore/QMap>
32 #include <QtCore/QFlags>
33 
34 #include <kdialog.h>
35 
36 class KLocalizedString;
37 class KgDifficulty;
38 
96 class KDEGAMES_EXPORT KScoreDialog : public KDialog
97 {
98  Q_OBJECT
99 
100  public:
102  enum Fields {
103  Name = 1 << 0,
104  Level = 1 << 1,
105  Date = 1 << 2,
106  Time = 1 << 3,
107  Score = 1 << 4,
108 
109  Custom1 = 1 << 10,
110  Custom2 = 1 << 11,
111  Custom3 = 1 << 12,
112  Custom4 = 1 << 13,
113  Custom5 = 1 << 14,
114 
115  Max = 1 << 30
116  };
117 
119  enum AddScoreFlag
120  {
121  AskName = 0x1,
122  LessIsMore = 0x2
123  };
124  Q_DECLARE_FLAGS(AddScoreFlags, AddScoreFlag)
125 
126  typedef QMap<int, QString> FieldInfo;
127 
132  explicit KScoreDialog(int fields=Name, QWidget *parent=0);
133 
134  ~KScoreDialog();
135 
146  void KDE_DEPRECATED setConfigGroup(const QString& group = QString());
147  //void setConfigGroup(const QString& group, const QString& i18nName);
148 
158  void setConfigGroup(const QPair<QByteArray, QString>& group);
159 
168  void addLocalizedConfigGroupName(const QPair<QByteArray, QString>& group);
169 
180  void addLocalizedConfigGroupNames(const QMap<QByteArray, QString>& groups);
181 
193  void setHiddenConfigGroups(const QList<QByteArray>& hiddenGroups);
194 
205  void setConfigGroupWeights(const QMap<int, QByteArray>& weights);
206 
211  void setComment(const QString& comment);
212 
219  void addField(int field, const QString& header, const QString& key);
220 
225  void hideField(int field);
226 
236  int addScore(const FieldInfo& newInfo = FieldInfo(), const AddScoreFlags& flags=0);
237 
247  int addScore(int newScore, const AddScoreFlags& flags=0);
248 
252  int highScore();
253 
264  void initFromDifficulty(const KgDifficulty* difficulty, bool setConfigGroup = true);
265 
267  virtual void show();
269  virtual void exec();
270 
271  private Q_SLOTS:
272  void slotGotReturn();
273  void slotGotName();
274  void slotForgetScore();
275 
276  private:
277  void keyPressEvent(QKeyEvent *ev);
278 
279  private:
280  class KScoreDialogPrivate;
281  KScoreDialogPrivate* const d;
282 };
283 Q_DECLARE_OPERATORS_FOR_FLAGS(KScoreDialog::AddScoreFlags)
284 
285 #endif //KSCOREDIALOG_H
QWidget
QByteArray
KScoreDialog::AddScoreFlag
AddScoreFlag
Flags for setting preferences for adding scores.
Definition: kscoredialog.h:119
KExtHighscore::show
void show(QWidget *parent, int rank)
Definition: kexthighscore.cpp:59
QMap
KScoreDialog
A simple high score implementation.
Definition: kscoredialog.h:96
typedef
KDialog
QString
QList
QPair
QKeyEvent
KScoreDialog::Fields
Fields
Highscore fields.
Definition: kscoredialog.h:102
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