FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / rbutil / rbutilqt / base / rbsettings.h
blobe178be0e525c37b573a38cf636140402f00c0004
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id$
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef RBSETTINGS_H
23 #define RBSETTINGS_H
25 #include <QtCore>
27 class QSettings;
29 class RbSettings : public QObject
31 Q_OBJECT
32 public:
33 //! Type of requested usb-id map
34 enum MapType {
35 MapDevice,
36 MapError,
37 MapIncompatible,
40 //! All user settings
41 enum UserSettings {
42 RbutilVersion,
43 CurrentPlatform,
44 Mountpoint,
45 CachePath,
46 Build,
47 ProxyType,
48 Proxy,
49 OfPath,
50 Platform,
51 Language,
52 Tts,
53 LastTalkedFolder,
54 VoiceLanguage,
55 TtsLanguage,
56 TtsOptions,
57 TtsPath,
58 TtsVoice,
59 EncoderPath,
60 EncoderOptions,
61 WavtrimThreshold,
62 EncoderComplexity,
63 TtsSpeed,
64 CacheOffline,
65 CacheDisabled,
66 TtsUseSapi4,
67 EncoderNarrowBand,
68 EncoderQuality,
69 EncoderVolume,
72 //! All system settings
73 enum SystemSettings {
74 ManualUrl,
75 BleedingUrl,
76 BootloaderUrl,
77 BootloaderInfoUrl,
78 FontUrl,
79 VoiceUrl,
80 DoomUrl,
81 ReleaseUrl,
82 DailyUrl,
83 ServerConfUrl,
84 GenlangUrl,
85 ThemesUrl,
86 BleedingInfo,
87 CurPlatformName,
88 CurManual,
89 CurBootloaderMethod,
90 CurBootloaderName,
91 CurBootloaderFile,
92 CurEncoder,
93 CurBrand,
94 CurName,
95 CurBuildserverModel,
96 CurConfigureModel,
99 //! call this to flush the user Settings
100 static void sync();
101 //! returns the filename of the usersettings file
102 static QString userSettingFilename();
103 //! return a list of all platforms (rbutil internal names)
104 static QStringList platforms(void);
105 //! returns a list of all languages
106 static QStringList languages(void);
107 //! maps a platform to its name
108 static QString name(QString plattform);
109 //! maps a platform to its brand
110 static QString brand(QString plattform);
111 //! returns a map of usb-ids and their targets
112 static QMap<int, QString> usbIdMap(enum MapType);
113 //! get a value from system settings
114 static QVariant value(enum SystemSettings setting);
115 //! get a value from user settings
116 static QVariant value(enum UserSettings setting);
117 //! set a user setting value
118 static void setValue(enum UserSettings setting , QVariant value);
119 //! get a user setting from a subvalue (ie for encoders and tts engines)
120 static QVariant subValue(QString sub, enum UserSettings setting);
121 //! set a user setting from a subvalue (ie for encoders and tts engines)
122 static void setSubValue(QString sub, enum UserSettings setting, QVariant value);
123 //! get a value from system settings for a named platform.
124 static QVariant platformValue(QString platform, enum SystemSettings setting);
126 private:
127 //! you shouldnt call this, its a fully static calls
128 RbSettings() {}
129 //! create the setting objects if neccessary
130 static void ensureRbSettingsExists();
131 //! create a settings path, substitute platform, tts and encoder
132 static QString constructSettingPath(QString path, QString substitute = QString());
134 //! pointers to our setting objects
135 static QSettings *systemSettings;
136 static QSettings *userSettings;
139 #endif