20 #ifndef __PREFERENCES_H__ 21 #define __PREFERENCES_H__ 33 #include "global/settings/types/preferencekeys.h" 83 QVariant _defaultValue = 0;
84 bool _showInAdvancedList =
true;
87 QMetaType::Type _type = QMetaType::UnknownType;
88 Preference(QVariant defaultValue) : _defaultValue(defaultValue) {}
91 Preference(QVariant defaultValue, QMetaType::Type type,
bool showInAdvancedList =
true);
96 QMetaType::Type
type() {
return _type;}
102 IntPreference(
int defaultValue,
bool showInAdvancedList =
true);
114 BoolPreference(
bool defaultValue,
bool showInAdvancedList =
true);
133 EnumPreference(QVariant defaultValue,
bool showInAdvancedList =
true);
154 bool _storeInMemoryOnly =
false;
155 bool _returnDefaultValues =
false;
156 bool _initialized =
false;
159 QSettings* settings()
const;
162 QVariant
get(
const QString key)
const;
163 bool has(
const QString key)
const;
164 void set(
const QString key, QVariant value,
bool temporary =
false);
165 void remove(
const QString key);
167 QVariant preference(
const QString key)
const;
168 QMetaType::Type type(
const QString key)
const;
169 bool checkIfKeyExists(
const QString key)
const;
170 bool checkType(
const QString key, QMetaType::Type t)
const;
174 QMap<QString, QVariant> getDefaultLocalPreferences();
175 bool useLocalPrefs =
false;
180 void init(
bool storeInMemoryOnly =
false);
188 QVariant defaultValue(
const QString key)
const;
189 bool getBool(
const QString key)
const;
190 QColor getColor(
const QString key)
const;
191 QString getString(
const QString key)
const;
192 int getInt(
const QString key)
const;
193 double getDouble(
const QString key)
const;
196 void setToDefaultValue(
const QString key);
197 void setPreference(
const QString key, QVariant value);
202 void setTemporaryPreference(
const QString key, QVariant value);
211 bool isThemeDark()
const;
216 set(key, QVariant::fromValue<T>(t));
221 void updateMidiRemote(
int recordId,
MidiRemoteType type,
int data);
222 void clearMidiRemote(
int recordId);
225 void setLocalPreference(QString key, QVariant value);
239 return out << static_cast<int>(val);
254 return out << static_cast<int>(val);
269 return out << static_cast<int>(val);
QMetaType::Type type()
Definition: preferences.h:96
Definition: preferences.h:58
Definition: preferences.h:56
Definition: preferences.h:59
Definition: preferences.h:53
Definition: preferences.h:50
prefs_map_t _allPreferences
Definition: preferences.h:150
Definition: preferences.h:62
Definition: preferences.h:118
Definition: preferences.h:106
const prefs_map_t & allPreferences() const
Definition: preferences.h:185
int getInt(int byte, int bits)
Definition: ove.cpp:5182
QMap< QString, QVariant > localPreferences
Definition: preferences.h:173
Definition: preferences.h:63
Definition: preferences.h:100
QSettings * _settings
Definition: preferences.h:157
Definition: preferences.h:131
void updateLocalPreferences()
Definition: preferences.h:228
void setReturnDefaultValuesMode(bool returnDefaultValues)
Definition: preferences.h:183
MidiRemoteType
Definition: globals.h:91
Definition: preferences.h:61
void setUseLocalPreferences(bool value)
Definition: preferences.h:226
Definition: preferences.h:124
Definition: preferences.h:55
QDataStream & operator>>(QDataStream &in, Ms::MuseScoreStyleType &val)
Definition: preferences.h:243
virtual ~Preference()
Definition: preferences.h:92
Definition: preferences.h:51
Definition: preferences.h:49
void setCustomPreference(const QString key, T t)
Definition: preferences.h:214
Definition: globals.h:100
QDataStream & operator<<(QDataStream &out, const Ms::MuseScoreStyleType &val)
Definition: preferences.h:237
Definition: preferences.h:46
Definition: preferences.h:52
MuseScoreStyleType
Definition: preferences.h:66
Definition: aeolus.cpp:26
Definition: preferences.h:48
bool getUseLocalPreferences()
Definition: preferences.h:227
QString mscoreGlobalShare
Definition: mscore.cpp:124
Definition: preferences.h:112
Definition: preferences.h:45
QHash< QString, QVariant > _inMemorySettings
Definition: preferences.h:153
bool showInAdvancedList() const
Definition: preferences.h:95
Definition: preferences.h:282
Definition: preferences.h:54
Preferences preferences
Definition: inspectorplugin.cpp:31
MusicxmlExportBreaks
Definition: preferences.h:72
SessionStart
Definition: preferences.h:39
Definition: preferences.h:47
Definition: inspectorplugin.h:25
Definition: preferences.h:81
QVariant defaultValue() const
Definition: preferences.h:94
QMap< QString, QVariant > getLocalPreferences()
Definition: preferences.h:224
QHash< QString, Preference * > prefs_map_t
Definition: preferences.h:143
Preference(QVariant defaultValue)
Definition: preferences.h:88
Definition: preferences.h:60
Definition: preferences.h:57