AlbumShaper 1.0a3
configuration.h
Go to the documentation of this file.
1//==============================================
2// copyright : (C) 2003-2005 by Will Stokes
3//==============================================
4// This program is free software; you can redistribute it
5// and/or modify it under the terms of the GNU General
6// Public License as published by the Free Software
7// Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//==============================================
10
11#ifndef CONFIGURATION_CONFIGURATION_H
12#define CONFIGURATION_CONFIGURATION_H
13
14//--------------------
15//forward declarations
16class QString;
17class SettingGroup;
18//--------------------
19
20//=====================================
23//=====================================
25{
26//------------------------------------------------------
27public:
29 static bool constructSettingsDirectory();
30
33
36 //----------------------------
38 bool loadSettings();
39
41 bool saveSettings();
42
44 void setString( QString group, QString key, QString value);
45
47 void setBool( QString group, QString key, bool val );
48
50 void setInt( QString group, QString key, int val );
51
53 QString getString(QString group, QString key);
54
56 bool getBool(QString group, QString key);
57
59 int getInt(QString group, QString key);
60
62 float getFloat(QString group, QString key);
63
65 double getDouble(QString group, QString key);
66
68 void resetSetting(QString group, QString key);
69
71 void removeGroup(QString group);
72 //------------------------------------------------------
73private:
76
79
82
85//------------------------------------------------------
86};
87#endif //CONFIGURATION_CONFIGURATION_H
Configuration object manages all user-specific application settings.
bool getBool(QString group, QString key)
Fetch bool setting.
~Configuration()
Destructor saves settings to disk.
QString settingsFilename
Settings filename.
double getDouble(QString group, QString key)
Fetch double setting.
void removeGroup(QString group)
Removes an entire group of settings.
SettingGroup * curGroup
pointer to currently selected group
SettingGroup * lastGroup
pointer to last group
float getFloat(QString group, QString key)
Fetch float setting.
void setInt(QString group, QString key, int val)
Set int setting.
Configuration()
Creates configuration variables using default values, then attempts to load settings from disk.
SettingGroup * firstGroup
pointer to first group
void setBool(QString group, QString key, bool val)
Set bool setting.
bool loadSettings()
Loads settings.
bool saveSettings()
Saves settings.
void setString(QString group, QString key, QString value)
Sets a setting value, if group does not exist it is created, if setting does not exist it is also cre...
void resetSetting(QString group, QString key)
Resets a setting to it's default value.
static bool constructSettingsDirectory()
Constructs any necessary directories for loading and saving user settings, returns false if unsuccess...
QString getString(QString group, QString key)
Fetch string setting.
int getInt(QString group, QString key)
Fetch int setting.
SettingGroup contains settings which are releated.