author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdecore/kprefs.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/kdecore/kprefs.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/microkde/kdecore/kprefs.h b/microkde/kdecore/kprefs.h index 95d2724..d9d1572 100644 --- a/microkde/kdecore/kprefs.h +++ b/microkde/kdecore/kprefs.h | |||
@@ -1,52 +1,54 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 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 | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef _KPREFS_H | 20 | #ifndef _KPREFS_H |
21 | #define _KPREFS_H | 21 | #define _KPREFS_H |
22 | // $Id$ | 22 | // $Id$ |
23 | 23 | ||
24 | #include <qptrlist.h> | 24 | #include <q3ptrlist.h> |
25 | #include <qcolor.h> | 25 | #include <qcolor.h> |
26 | #include <qfont.h> | 26 | #include <qfont.h> |
27 | #include <qsize.h> | 27 | #include <qsize.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | //Added by qt3to4: | ||
30 | #include <Q3ValueList> | ||
29 | 31 | ||
30 | class KConfig; | 32 | class KConfig; |
31 | 33 | ||
32 | /** | 34 | /** |
33 | @short Class for storing a preferences setting | 35 | @short Class for storing a preferences setting |
34 | @author Cornelius Schumacher | 36 | @author Cornelius Schumacher |
35 | @see KPref | 37 | @see KPref |
36 | 38 | ||
37 | This class represents one preferences setting as used by @ref KPrefs. | 39 | This class represents one preferences setting as used by @ref KPrefs. |
38 | Subclasses of KPrefsItem implement storage functions for a certain type of | 40 | Subclasses of KPrefsItem implement storage functions for a certain type of |
39 | setting. Normally you don't have to use this class directly. Use the special | 41 | setting. Normally you don't have to use this class directly. Use the special |
40 | addItem() functions of KPrefs instead. If you subclass this class you will | 42 | addItem() functions of KPrefs instead. If you subclass this class you will |
41 | have to register instances with the function KPrefs::addItem(). | 43 | have to register instances with the function KPrefs::addItem(). |
42 | */ | 44 | */ |
43 | class KPrefsItem { | 45 | class KPrefsItem { |
44 | public: | 46 | public: |
45 | /** | 47 | /** |
46 | Constructor. | 48 | Constructor. |
47 | 49 | ||
48 | @param group Config file group. | 50 | @param group Config file group. |
49 | @param name Config file key. | 51 | @param name Config file key. |
50 | */ | 52 | */ |
51 | KPrefsItem(const QString &group,const QString &name) : | 53 | KPrefsItem(const QString &group,const QString &name) : |
52 | mGroup(group),mName(name) {} | 54 | mGroup(group),mName(name) {} |
@@ -262,55 +264,55 @@ class KPrefs { | |||
262 | const QString &defaultValue=""); | 264 | const QString &defaultValue=""); |
263 | /** | 265 | /** |
264 | Register an item of type QStringList. | 266 | Register an item of type QStringList. |
265 | 267 | ||
266 | @param key Key used in config file. | 268 | @param key Key used in config file. |
267 | @param reference Pointer to the variable, which is set by readConfig() | 269 | @param reference Pointer to the variable, which is set by readConfig() |
268 | and setDefaults() calls and read by writeConfig() calls. | 270 | and setDefaults() calls and read by writeConfig() calls. |
269 | @param defaultValue Default value, which is used by setDefaults() and | 271 | @param defaultValue Default value, which is used by setDefaults() and |
270 | when the config file does not yet contain the key of | 272 | when the config file does not yet contain the key of |
271 | this item. | 273 | this item. |
272 | */ | 274 | */ |
273 | void addItemStringList(const QString &key,QStringList *reference, | 275 | void addItemStringList(const QString &key,QStringList *reference, |
274 | const QStringList &defaultValue=QStringList()); | 276 | const QStringList &defaultValue=QStringList()); |
275 | 277 | ||
276 | /** | 278 | /** |
277 | Register an item of type QValueList<int>. | 279 | Register an item of type QValueList<int>. |
278 | 280 | ||
279 | @param key Key used in config file. | 281 | @param key Key used in config file. |
280 | @param reference Pointer to the variable, which is set by readConfig() | 282 | @param reference Pointer to the variable, which is set by readConfig() |
281 | and setDefaults() calls and read by writeConfig() calls. | 283 | and setDefaults() calls and read by writeConfig() calls. |
282 | @param defaultValue Default value, which is used by setDefaults() and | 284 | @param defaultValue Default value, which is used by setDefaults() and |
283 | when the config file does not yet contain the key of | 285 | when the config file does not yet contain the key of |
284 | this item. | 286 | this item. |
285 | */ | 287 | */ |
286 | void addItemIntList(const QString &key,QValueList<int> *reference, | 288 | void addItemIntList(const QString &key,Q3ValueList<int> *reference, |
287 | const QValueList<int> &defaultValue=QValueList<int>()); | 289 | const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); |
288 | 290 | ||
289 | protected: | 291 | protected: |
290 | /** | 292 | /** |
291 | Implemented by subclasses that use special defaults. | 293 | Implemented by subclasses that use special defaults. |
292 | */ | 294 | */ |
293 | virtual void usrSetDefaults() {}; | 295 | virtual void usrSetDefaults() {}; |
294 | /** | 296 | /** |
295 | Implemented by subclasses that read special config values. | 297 | Implemented by subclasses that read special config values. |
296 | */ | 298 | */ |
297 | virtual void usrReadConfig() {}; | 299 | virtual void usrReadConfig() {}; |
298 | /** | 300 | /** |
299 | Implemented by subclasses that write special config values. | 301 | Implemented by subclasses that write special config values. |
300 | */ | 302 | */ |
301 | virtual void usrWriteConfig() {}; | 303 | virtual void usrWriteConfig() {}; |
302 | 304 | ||
303 | /** | 305 | /** |
304 | Return the @ref KConfig object used for reading and writing the settings. | 306 | Return the @ref KConfig object used for reading and writing the settings. |
305 | */ | 307 | */ |
306 | KConfig *config() const; | 308 | KConfig *config() const; |
307 | 309 | ||
308 | private: | 310 | private: |
309 | static QString *mCurrentGroup; | 311 | static QString *mCurrentGroup; |
310 | 312 | ||
311 | KConfig *mConfig; // pointer to KConfig object | 313 | KConfig *mConfig; // pointer to KConfig object |
312 | 314 | ||
313 | QPtrList<KPrefsItem> mItems; | 315 | Q3PtrList<KPrefsItem> mItems; |
314 | }; | 316 | }; |
315 | 317 | ||
316 | #endif | 318 | #endif |