• 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
khighscore.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
4  Copyright (C) 2003 Nicolas Hadacek <hadacek@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KHIGHSCORE_H
22 #define KHIGHSCORE_H
23 
24 #include <libkdegames_export.h>
25 
26 #include <QtCore/QObject>
27 
28 class KConfig;
29 
82 class KDEGAMES_EXPORT KHighscore : public QObject
83 {
84  Q_OBJECT
85  public:
94  explicit KHighscore(bool forceLocal=true, QObject *parent=0);
95 
101  void readCurrentConfig();
102 
113  static void init(const char *appname);
114 
130  bool lockForWriting(QWidget *widget = 0);
131 
137  void writeAndUnlock();
138 
143  bool isLocked() const;
144 
149  ~KHighscore();
150 
158  void writeEntry(int entry, const QString& key, const QString& value);
159 
164  void writeEntry(int entry, const QString& key, int value);
165 
171  void writeEntry(int entry, const QString& key, const QVariant &value);
172 
184  QString readEntry(int entry, const QString& key, const QString& pDefault = QLatin1String("")) const;
185 
197  int readNumEntry(int entry, const QString& key, int pDefault = -1) const;
198 
206  QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const;
207 
212  bool hasEntry(int entry, const QString& key) const;
213 
231  QStringList readList(const QString& key, int lastEntry = 20) const;
232 
244  void writeList(const QString& key, const QStringList& list);
245 
254  bool hasTable() const;
255 
263  void setHighscoreGroup(const QString& groupname = QLatin1String(""));
264 
272  QStringList groupList() const;
273 
279  QString highscoreGroup() const;
280 
281  protected:
286  QString group() const;
287 
293  KConfig* config() const;
294 
295  void init(bool forceLocal);
296 
297  private:
298  class KHighscorePrivate;
299  KHighscorePrivate* const d;
300 };
301 
302 #endif
KHighscore
Class for managing highscore tables.
Definition: khighscore.h:82
QWidget
QObject
QString
QStringList
QLatin1String
QVariant
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