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
16 class QString;
17 class SettingGroup;
18 //--------------------
19 
20 //=====================================
23 //=====================================
25 {
26 //------------------------------------------------------
27 public:
29  static bool constructSettingsDirectory();
30 
32  Configuration();
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  //------------------------------------------------------
73 private:
76 
79 
82 
85 //------------------------------------------------------
86 };
87 #endif //CONFIGURATION_CONFIGURATION_H
void removeGroup(QString group)
Removes an entire group of settings.
void setInt(QString group, QString key, int val)
Set int setting.
SettingGroup * lastGroup
pointer to last group
Definition: configuration.h:81
float getFloat(QString group, QString key)
Fetch float setting.
QString getString(QString group, QString key)
Fetch string setting.
bool getBool(QString group, QString key)
Fetch bool setting.
void resetSetting(QString group, QString key)
Resets a setting to it's default value.
bool loadSettings()
Loads 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 setBool(QString group, QString key, bool val)
Set bool setting.
int getInt(QString group, QString key)
Fetch int setting.
Configuration()
Creates configuration variables using default values, then attempts to load settings from disk...
static bool constructSettingsDirectory()
Constructs any necessary directories for loading and saving user settings, returns false if unsuccess...
bool saveSettings()
Saves settings.
SettingGroup * firstGroup
pointer to first group
Definition: configuration.h:78
SettingGroup * curGroup
pointer to currently selected group
Definition: configuration.h:84
Configuration object manages all user-specific application settings.
Definition: configuration.h:24
double getDouble(QString group, QString key)
Fetch double setting.
~Configuration()
Destructor saves settings to disk.
QString settingsFilename
Settings filename.
Definition: configuration.h:75
SettingGroup contains settings which are releated.
Definition: settinggroup.h:27