• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
  • highscore
khighscore.h
1/*
2 This file is part of the TDE 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 $Id$
22*/
23#ifndef __KHIGHSCORE_H__
24#define __KHIGHSCORE_H__
25
26#include <tqstring.h>
27#include <tqobject.h>
28#include <tdemacros.h>
29class TDEConfig;
30class KFileLock;
31class KRawConfig;
32class KHighscorePrivate;
33
84class TDE_EXPORT KHighscore : public TQObject
85{
86 TQ_OBJECT
87
88public:
93 KHighscore(TQObject* parent = 0);
94
104 KHighscore(bool forceLocal, TQObject *parent);
105
112 void readCurrentConfig();
113
124 static void init(const char *appname);
125
141 bool lockForWriting(TQWidget *widget = 0);
142
149 void writeAndUnlock();
150
156 bool isLocked() const;
157
162 ~KHighscore();
163
171 void writeEntry(int entry, const TQString& key, const TQString& value);
172
177 void writeEntry(int entry, const TQString& key, int value);
178
184 void writeEntry(int entry, const TQString& key, const TQVariant &value);
185
197 TQString readEntry(int entry, const TQString& key, const TQString& pDefault = TQString()) const;
198
210 int readNumEntry(int entry, const TQString& key, int pDefault = -1) const;
211
219 TQVariant readPropertyEntry(int entry, const TQString &key, const TQVariant &pDefault) const;
220
225 bool hasEntry(int entry, const TQString& key) const;
226
244 TQStringList readList(const TQString& key, int lastEntry = 20) const;
245
257 void writeList(const TQString& key, const TQStringList& list);
258
266 bool hasTable() const;
267
271 void sync();
272
280 void setHighscoreGroup(const TQString& groupname = TQString());
281
287 const TQString& highscoreGroup() const;
288
289protected:
294 TQString group() const;
295
301 TDEConfig* config() const;
302
303 void init(bool forceLocal);
304
305private:
306 KHighscorePrivate* d;
307
308 static KFileLock *_lock; // lock on system-wide highscore file
309 static KRawConfig *_config; // config for system-wide highscore file
310};
311
312#endif
KHighscore
Class for managing highscore tables.
Definition: khighscore.h:85

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.4
This website is maintained by Timothy Pearson.