Diffstat (limited to 'noncore/apps/zsafe/qsettings.h') (more/less context) (show whitespace changes)
-rwxr-xr-x | noncore/apps/zsafe/qsettings.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/noncore/apps/zsafe/qsettings.h b/noncore/apps/zsafe/qsettings.h new file mode 100755 index 0000000..b11b533 --- a/dev/null +++ b/noncore/apps/zsafe/qsettings.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | ** $Id$ | ||
3 | */ | ||
4 | |||
5 | #ifndef _QSETTINGS_H_ | ||
6 | #define _QSETTINGS_H_ | ||
7 | |||
8 | #include <qstring.h> | ||
9 | #include <qstringlist.h> | ||
10 | #include <qasciidict.h> | ||
11 | |||
12 | // class to hold one category item | ||
13 | |||
14 | class QSettings | ||
15 | { | ||
16 | public: | ||
17 | enum Format { | ||
18 | Native = 0, | ||
19 | Ini | ||
20 | }; | ||
21 | enum System { | ||
22 | Unix = 0, | ||
23 | Windows, | ||
24 | Mac | ||
25 | }; | ||
26 | enum Scope { | ||
27 | User, | ||
28 | Global | ||
29 | }; | ||
30 | |||
31 | QSettings(const QString &); | ||
32 | ~QSettings(); | ||
33 | |||
34 | void insertSearchPath (System, const QString &); | ||
35 | |||
36 | QString readEntry (const QString &, const QString &def = QString::null); | ||
37 | int readNumEntry (const QString &, int def = 0); | ||
38 | bool readBoolEntry (const QString &, bool def = 0); | ||
39 | |||
40 | bool writeEntry (const QString &, int); | ||
41 | bool writeEntry (const QString &, bool); | ||
42 | bool writeEntry (const QString &, const QString &); | ||
43 | bool writeEntry (const QString &, const char *); | ||
44 | |||
45 | bool removeEntry (const QString &); | ||
46 | |||
47 | QStringList entryList (const QString &) const; | ||
48 | |||
49 | protected: | ||
50 | |||
51 | private: | ||
52 | QAsciiDict <QString> prefs; // key, value dictonary | ||
53 | QString fn; // preference filename | ||
54 | |||
55 | }; | ||
56 | #endif // _QSETTINGS_H_ | ||