Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * |
| 9 | * Copyright (C) 2007 by Dominik Wenger |
| 10 | * $Id: rbsettings.h 16059 2008-01-11 23:59:12Z domonoky $ |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 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 | |
Dominik Riebeling | ee09cb7 | 2008-02-10 18:25:49 +0000 | [diff] [blame] | 25 | #include <QtCore> |
| 26 | |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 27 | class QSettings; |
| 28 | |
| 29 | class 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 | //! access functions for the settings |
| 45 | bool cacheOffline(); |
| 46 | bool cacheDisabled(); |
| 47 | QString mountpoint(); |
| 48 | QString manualUrl(); |
| 49 | QString bleedingUrl(); |
| 50 | QString lastRelease(); |
| 51 | QString cachePath(); |
| 52 | QString bootloaderUrl(); |
| 53 | QString bootloaderInfoUrl(); |
| 54 | QString fontUrl(); |
| 55 | QString voiceUrl(); |
| 56 | QString doomUrl(); |
| 57 | QString downloadUrl(); |
| 58 | QString dailyUrl(); |
| 59 | QString serverConfUrl(); |
| 60 | QString themeUrl(); |
| 61 | QString genlangUrl(); |
| 62 | QString proxyType(); |
| 63 | QString proxy(); |
| 64 | QString bleedingInfo(); |
| 65 | QString ofPath(); |
| 66 | QString lastTalkedFolder(); |
| 67 | QString voiceLanguage(); |
| 68 | int wavtrimTh(); |
| 69 | QString ttsPath(QString tts); |
| 70 | QString ttsOptions(QString tts); |
| 71 | QString ttsVoice(QString tts); |
| 72 | int ttsSpeed(QString tts); |
| 73 | QString ttsLang(QString tts); |
Dominik Wenger | 5f641ed | 2008-02-11 17:39:07 +0000 | [diff] [blame] | 74 | bool ttsUseSapi4(); |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 75 | QString encoderPath(QString enc); |
| 76 | QString encoderOptions(QString enc); |
| 77 | double encoderQuality(QString enc); |
| 78 | int encoderComplexity(QString enc); |
| 79 | double encoderVolume(QString enc); |
| 80 | bool encoderNarrowband(QString enc); |
| 81 | |
| 82 | QStringList allPlatforms(); |
| 83 | QString name(QString plattform); |
| 84 | QString brand(QString plattform); |
| 85 | QStringList allLanguages(); |
Dominik Wenger | 6b0a1ec | 2008-06-23 20:31:44 +0000 | [diff] [blame] | 86 | QString nameOfTargetId(int id); |
Dominik Wenger | 1363881 | 2008-04-03 20:05:13 +0000 | [diff] [blame] | 87 | QMap<int, QString> usbIdMap(); |
| 88 | QMap<int, QString> usbIdErrorMap(); |
Dominik Riebeling | 229c64b | 2008-04-05 21:48:54 +0000 | [diff] [blame] | 89 | QMap<int, QString> usbIdIncompatMap(); |
Dominik Wenger | 1363881 | 2008-04-03 20:05:13 +0000 | [diff] [blame] | 90 | |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 91 | bool curNeedsBootloader(); |
| 92 | QString curBrand(); |
| 93 | QString curName(); |
| 94 | QString curPlatform(); |
Dominik Wenger | b30181a | 2008-02-13 18:25:01 +0000 | [diff] [blame] | 95 | QString curPlatformName(); |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 96 | QString curManual(); |
| 97 | bool curReleased(); |
| 98 | QString curBootloaderMethod(); |
| 99 | QString curBootloaderName(); |
| 100 | QString curVoiceName(); |
| 101 | QString curLang(); |
| 102 | QString curEncoder(); |
| 103 | QString curTTS(); |
| 104 | QString curResolution(); |
| 105 | int curTargetId(); |
Dominik Riebeling | ee09cb7 | 2008-02-10 18:25:49 +0000 | [diff] [blame] | 106 | |
Dominik Wenger | 7449751 | 2008-04-24 20:40:33 +0000 | [diff] [blame] | 107 | //! Set Fucntions |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 108 | void setOfPath(QString path); |
| 109 | void setCachePath(QString path); |
| 110 | void setBuild(QString build); |
| 111 | void setLastTalkedDir(QString dir); |
| 112 | void setVoiceLanguage(QString lang); |
| 113 | void setWavtrimTh(int th); |
| 114 | void setProxy(QString proxy); |
| 115 | void setProxyType(QString proxytype); |
| 116 | void setLang(QString lang); |
| 117 | void setMountpoint(QString mp); |
| 118 | void setCurPlatform(QString platt); |
| 119 | void setCacheDisable(bool on); |
| 120 | void setCacheOffline(bool on); |
| 121 | void setCurTTS(QString tts); |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 122 | void setTTSPath(QString tts, QString path); |
| 123 | void setTTSOptions(QString tts, QString options); |
| 124 | void setTTSSpeed(QString tts, int speed); |
| 125 | void setTTSVoice(QString tts, QString voice); |
| 126 | void setTTSLang(QString tts, QString lang); |
Dominik Wenger | 5f641ed | 2008-02-11 17:39:07 +0000 | [diff] [blame] | 127 | void setTTSUseSapi4(bool value); |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 128 | void setEncoderPath(QString enc, QString path); |
| 129 | void setEncoderOptions(QString enc, QString options); |
| 130 | void setEncoderQuality(QString enc, double q); |
| 131 | void setEncoderComplexity(QString enc, int c); |
| 132 | void setEncoderVolume(QString enc,double v); |
| 133 | void setEncoderNarrowband(QString enc,bool nb); |
Dominik Riebeling | ee09cb7 | 2008-02-10 18:25:49 +0000 | [diff] [blame] | 134 | |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 135 | private: |
Dominik Wenger | 7449751 | 2008-04-24 20:40:33 +0000 | [diff] [blame] | 136 | |
| 137 | //! helper function to get an entry in the current platform section |
| 138 | QVariant deviceSettingCurGet(QString entry,QString def=""); |
| 139 | //! helper function to get an entry out of a group in the userSettings |
| 140 | QVariant userSettingsGroupGet(QString group,QString entry,QVariant def=""); |
| 141 | //! helper function to set an entry in a group in the userSettings |
| 142 | void userSettingsGroupSet(QString group,QString entry,QVariant value); |
| 143 | |
| 144 | |
| 145 | //! private copy constructors to prvent copying |
Dominik Riebeling | 6a471d8 | 2008-04-24 21:42:31 +0000 | [diff] [blame] | 146 | RbSettings& operator= (const RbSettings& other) |
| 147 | { (void)other; return *this; } |
Dominik Wenger | db73339 | 2008-04-25 19:47:06 +0000 | [diff] [blame] | 148 | RbSettings(const RbSettings& other) :QObject() |
Dominik Riebeling | 6a471d8 | 2008-04-24 21:42:31 +0000 | [diff] [blame] | 149 | { (void)other; } |
Dominik Wenger | 7449751 | 2008-04-24 20:40:33 +0000 | [diff] [blame] | 150 | |
| 151 | //! pointers to our setting objects |
Dominik Wenger | 3a54c9b | 2008-01-25 00:12:25 +0000 | [diff] [blame] | 152 | QSettings *devices; |
| 153 | QSettings *userSettings; |
| 154 | |
| 155 | }; |
| 156 | |
| 157 | #endif |