• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/highscore

khighscore.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE games library
00003     Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
00004     Copyright (C) 2003 Nicolas Hadacek <hadacek@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License version 2 as published by the Free Software Foundation.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KHIGHSCORE_H
00022 #define KHIGHSCORE_H
00023 
00024 #include <libkdegames_export.h>
00025 
00026 #include <QtCore/QObject>
00027 
00028 class KConfig;
00029 
00080 class KDEGAMES_EXPORT KHighscore : public QObject
00081 {
00082     Q_OBJECT
00083     public:
00092         explicit KHighscore(bool forceLocal=true, QObject *parent=0);
00093 
00099         void readCurrentConfig();
00100 
00111         static void init(const char *appname);
00112 
00128         bool lockForWriting(QWidget *widget = 0);
00129 
00135         void writeAndUnlock();
00136 
00141         bool isLocked() const;
00142 
00147         ~KHighscore();
00148 
00156         void writeEntry(int entry, const QString& key, const QString& value);
00157 
00162         void writeEntry(int entry, const QString& key, int value);
00163 
00169         void writeEntry(int entry, const QString& key, const QVariant &value);
00170 
00182         QString readEntry(int entry, const QString& key, const QString& pDefault = "") const;
00183 
00195         int readNumEntry(int entry, const QString& key, int pDefault = -1) const;
00196 
00204         QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const;
00205 
00210         bool hasEntry(int entry, const QString& key) const;
00211 
00229         QStringList readList(const QString& key, int lastEntry = 20) const;
00230 
00242         void writeList(const QString& key, const QStringList& list);
00243 
00252         bool hasTable() const;
00253 
00261         void setHighscoreGroup(const QString& groupname = "");
00262         
00270         QStringList groupList() const;
00271 
00277         QString highscoreGroup() const;
00278 
00279     protected:
00284         QString group() const;
00285 
00291         KConfig* config() const;
00292 
00293         void init(bool forceLocal);
00294 
00295     private:
00296         class KHighscorePrivate;
00297         KHighscorePrivate* const d;
00298 };
00299 
00300 #endif

libkdegames/highscore

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

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal