Release version 0.99.2-1
[fmit.git] / src / AutoQSettings.h
1 // Copyright 2007 "Gilles Degottex"
2
3 // This file is part of "fmit"
4
5 // "Music" is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation; either version 2.1 of the License, or
8 // (at your option) any later version.
9 //
10 // "Music" is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19 #ifndef _AutoQSettings_h_
20 #define _AutoQSettings_h_
21
22 #include <assert.h>
23 #include <list>
24 #include <qsettings.h>
25 #include <qcheckbox.h>
26 #include <qspinbox.h>
27 #include <qlineedit.h>
28 #include <qcombobox.h>
29 #include <qgroupbox.h>
30 #include <qradiobutton.h>
31
32 class AutoQSettings : public QSettings
33 {
34         std::list<QCheckBox*> m_elements_checkbox;
35         std::list<QSpinBox*> m_elements_spinbox;
36         std::list<QLineEdit*> m_elements_lineedit;
37         std::list<QComboBox*> m_elements_combobox;
38         std::list<QGroupBox*> m_elements_qgroupbox;
39         std::list<QRadioButton*> m_elements_qradiobutton;
40
41   public:
42         AutoQSettings(const QString& domain, const QString& product, const QString& setting_version);
43
44         void add(QCheckBox* el);
45         void add(QSpinBox* el);
46         void add(QLineEdit* el);
47         void add(QComboBox* el);
48         void add(QGroupBox* el);
49         void add(QRadioButton* el);
50
51         void save(QCheckBox* el);
52         void load(QCheckBox* el);
53
54         void save();
55         void load();
56         void clear();
57 };
58
59 #endif // _AutoQSettings_h_