Save all settings in talkfile dialog.
[maemo-rb.git] / rbutil / rbutilqt / base / rbsettings.h
blob45ec7092e283d35b17384614f1a6ce2db7c88e4a
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
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.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ****************************************************************************/
21 #ifndef RBSETTINGS_H
22 #define RBSETTINGS_H
24 #include <QtCore>
26 class RbSettings : public QObject
28 Q_OBJECT
29 public:
31 //! All user settings
32 enum UserSettings {
33 RbutilVersion,
34 CurrentPlatform,
35 Mountpoint,
36 CachePath,
37 Build,
38 ProxyType,
39 Proxy,
40 OfPath,
41 Platform,
42 Language,
43 Tts,
44 UseTtsCorrections,
45 TalkFolders,
46 TalkProcessFiles,
47 TalkProcessFolders,
48 TalkRecursive,
49 TalkSkipExisting,
50 TalkStripExtensions,
51 TalkIgnoreFiles,
52 TalkIgnoreWildcards,
53 VoiceLanguage,
54 TtsLanguage,
55 TtsOptions,
56 TtsPath,
57 TtsVoice,
58 TtsPitch,
59 EncoderPath,
60 EncoderOptions,
61 WavtrimThreshold,
62 EncoderComplexity,
63 TtsSpeed,
64 CacheOffline,
65 CacheDisabled,
66 TtsUseSapi4,
67 EncoderNarrowBand,
68 EncoderQuality,
69 EncoderVolume,
72 //! call this to flush the user Settings
73 static void sync();
74 //! returns the filename of the usersettings file
75 static QString userSettingFilename();
76 //! get a value from user settings
77 static QVariant value(enum UserSettings setting);
78 //! set a user setting value
79 static void setValue(enum UserSettings setting , QVariant value);
80 //! get a user setting from a subvalue (ie for encoders and tts engines)
81 static QVariant subValue(QString sub, enum UserSettings setting);
82 //! set a user setting from a subvalue (ie for encoders and tts engines)
83 static void setSubValue(QString sub, enum UserSettings setting, QVariant value);
85 private:
86 //! you shouldnt call this, its a fully static calls
87 RbSettings() {}
88 //! create the setting objects if neccessary
89 static void ensureRbSettingsExists();
90 //! create a settings path, substitute platform, tts and encoder
91 static QString constructSettingPath(QString path, QString substitute = QString());
93 //! pointers to our setting object
94 static QSettings *userSettings;
97 #endif