summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/rbsettings.h
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/rbsettings.h')
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h142
1 files changed, 142 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
new file mode 100644
index 0000000000..341577abc8
--- /dev/null
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -0,0 +1,142 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id$
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef RBSETTINGS_H
23#define RBSETTINGS_H
24
25#include <QtCore>
26
27class QSettings;
28
29class RbSettings : public QObject
30{
31 Q_OBJECT
32
33 public:
34 RbSettings() {}
35
36 //! open the settings files
37 void open();
38 //! call this to flush the user Settings
39 void sync();
40
41 // returns the filename of the usersettings file
42 QString userSettingFilename();
43
44 enum MapType {
45 MapDevice,
46 MapError,
47 MapIncompatible,
48 };
49 enum UserSettings {
50 RbutilVersion,
51 CurrentPlatform,
52 Mountpoint,
53 CachePath,
54 Build,
55 ProxyType,
56 Proxy,
57 OfPath,
58 Platform,
59 Language,
60 Tts,
61 LastTalkedFolder,
62 VoiceLanguage,
63 TtsLanguage,
64 TtsOptions,
65 TtsPath,
66 TtsVoice,
67 EncoderPath,
68 EncoderOptions,
69 WavtrimThreshold,
70 EncoderComplexity,
71 TtsSpeed,
72 CacheOffline,
73 CacheDisabled,
74 TtsUseSapi4,
75 EncoderNarrowBand,
76 EncoderQuality,
77 EncoderVolume,
78 };
79 enum SystemSettings {
80 ManualUrl,
81 BleedingUrl,
82 BootloaderUrl,
83 BootloaderInfoUrl,
84 FontUrl,
85 VoiceUrl,
86 DoomUrl,
87 ReleaseUrl,
88 DailyUrl,
89 ServerConfUrl,
90 GenlangUrl,
91 ThemesUrl,
92 BleedingInfo,
93 CurPlatformName,
94 CurManual,
95 CurBootloaderMethod,
96 CurBootloaderName,
97 CurBootloaderFile,
98 CurEncoder,
99 CurResolution,
100 CurBrand,
101 CurName,
102 CurBuildserverModel,
103 CurConfigureModel,
104 CurTargetId,
105 };
106
107 QVariant value(enum SystemSettings setting);
108 // generic and "current selection" values -- getters
109 QVariant value(enum UserSettings setting)
110 { QString empty; return subValue(empty, setting); }
111 void setValue(enum UserSettings setting , QVariant value)
112 { QString empty; return setSubValue(empty, setting, value); }
113
114 QVariant subValue(QString& sub, enum UserSettings setting);
115 QVariant subValue(const char* sub, enum UserSettings setting)
116 { QString s = sub; return subValue(s, setting); }
117 void setSubValue(QString& sub, enum UserSettings setting, QVariant value);
118 void setSubValue(const char* sub, enum UserSettings setting, QVariant value)
119 { QString s = sub; return setSubValue(s, setting, value); }
120
121 QStringList platforms(void);
122 QStringList languages(void);
123
124 QString name(QString plattform);
125 QString brand(QString plattform);
126
127 QMap<int, QString> usbIdMap(enum MapType);
128
129 private:
130 //! private copy constructors to prvent copying
131 RbSettings& operator= (const RbSettings& other)
132 { (void)other; return *this; }
133 RbSettings(const RbSettings& other) :QObject()
134 { (void)other; }
135 QString constructSettingPath(QString path, QString substitute = QString());
136
137 //! pointers to our setting objects
138 QSettings *systemSettings;
139 QSettings *userSettings;
140};
141
142#endif