diff options
Diffstat (limited to 'utils/rbutilqt/base/rbsettings.h')
-rw-r--r-- | utils/rbutilqt/base/rbsettings.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/utils/rbutilqt/base/rbsettings.h b/utils/rbutilqt/base/rbsettings.h new file mode 100644 index 0000000000..ef0c4eb134 --- /dev/null +++ b/utils/rbutilqt/base/rbsettings.h | |||
@@ -0,0 +1,105 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Dominik Wenger | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version 2 | ||
14 | * of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #ifndef RBSETTINGS_H | ||
22 | #define RBSETTINGS_H | ||
23 | |||
24 | #include <QtCore> | ||
25 | |||
26 | class RbSettings : public QObject | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | public: | ||
30 | |||
31 | //! All user settings | ||
32 | enum UserSettings { | ||
33 | RbutilVersion, | ||
34 | ShowChangelog, | ||
35 | CurrentPlatform, | ||
36 | Mountpoint, | ||
37 | CachePath, | ||
38 | Build, | ||
39 | ProxyType, | ||
40 | Proxy, | ||
41 | OfPath, | ||
42 | Platform, | ||
43 | Language, | ||
44 | BackupPath, | ||
45 | InstallRockbox, | ||
46 | InstallFonts, | ||
47 | InstallThemes, | ||
48 | InstallPluginData, | ||
49 | InstallVoice, | ||
50 | InstallManual, | ||
51 | Tts, | ||
52 | UseTtsCorrections, | ||
53 | TalkFolders, | ||
54 | TalkProcessFiles, | ||
55 | TalkProcessFolders, | ||
56 | TalkRecursive, | ||
57 | TalkSkipExisting, | ||
58 | TalkStripExtensions, | ||
59 | TalkIgnoreFiles, | ||
60 | TalkIgnoreWildcards, | ||
61 | VoiceLanguage, | ||
62 | TtsLanguage, | ||
63 | TtsOptions, | ||
64 | TtsPath, | ||
65 | TtsVoice, | ||
66 | TtsPitch, | ||
67 | EncoderPath, | ||
68 | EncoderOptions, | ||
69 | WavtrimThreshold, | ||
70 | EncoderComplexity, | ||
71 | TtsSpeed, | ||
72 | CacheDisabled, | ||
73 | TtsUseSapi4, | ||
74 | EncoderNarrowBand, | ||
75 | EncoderQuality, | ||
76 | EncoderVolume, | ||
77 | }; | ||
78 | |||
79 | //! call this to flush the user Settings | ||
80 | static void sync(); | ||
81 | //! returns the filename of the usersettings file | ||
82 | static QString userSettingFilename(); | ||
83 | //! get a value from user settings | ||
84 | static QVariant value(enum UserSettings setting); | ||
85 | //! set a user setting value | ||
86 | static void setValue(enum UserSettings setting , QVariant value); | ||
87 | //! get a user setting from a subvalue (ie for encoders and tts engines) | ||
88 | static QVariant subValue(QString sub, enum UserSettings setting); | ||
89 | //! set a user setting from a subvalue (ie for encoders and tts engines) | ||
90 | static void setSubValue(QString sub, enum UserSettings setting, QVariant value); | ||
91 | |||
92 | private: | ||
93 | //! you shouldnt call this, its a fully static calls | ||
94 | RbSettings() {} | ||
95 | //! create the setting objects if neccessary | ||
96 | static void ensureRbSettingsExists(); | ||
97 | //! create a settings path, substitute platform, tts and encoder | ||
98 | static QString constructSettingPath(QString path, QString substitute = QString()); | ||
99 | |||
100 | //! pointers to our setting object | ||
101 | static QSettings *userSettings; | ||
102 | }; | ||
103 | |||
104 | #endif | ||
105 | |||