libkdegames/highscore
khighscore.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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