• Skip to content
  • Skip to link menu
KDE 4.2 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 
00082 class KDEGAMES_EXPORT KHighscore : public QObject
00083 {
00084     Q_OBJECT
00085     public:
00094         explicit KHighscore(bool forceLocal=true, QObject *parent=0);
00095 
00101         void readCurrentConfig();
00102 
00113         static void init(const char *appname);
00114 
00130         bool lockForWriting(QWidget *widget = 0);
00131 
00137         void writeAndUnlock();
00138 
00143         bool isLocked() const;
00144 
00149         ~KHighscore();
00150 
00158         void writeEntry(int entry, const QString& key, const QString& value);
00159 
00164         void writeEntry(int entry, const QString& key, int value);
00165 
00171         void writeEntry(int entry, const QString& key, const QVariant &value);
00172 
00184         QString readEntry(int entry, const QString& key, const QString& pDefault = "") const;
00185 
00197         int readNumEntry(int entry, const QString& key, int pDefault = -1) const;
00198 
00206         QVariant readPropertyEntry(int entry, const QString &key, const QVariant &pDefault) const;
00207 
00212         bool hasEntry(int entry, const QString& key) const;
00213 
00231         QStringList readList(const QString& key, int lastEntry = 20) const;
00232 
00244         void writeList(const QString& key, const QStringList& list);
00245 
00254         bool hasTable() const;
00255 
00263         void setHighscoreGroup(const QString& groupname = "");
00264         
00272         QStringList groupList() const;
00273 
00279         QString highscoreGroup() const;
00280 
00281     protected:
00286         QString group() const;
00287 
00293         KConfig* config() const;
00294 
00295         void init(bool forceLocal);
00296 
00297     private:
00298         class KHighscorePrivate;
00299         KHighscorePrivate* const d;
00300 };
00301 
00302 #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