1 /*
2  * %kadu copyright begin%
3  * Copyright 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
4  * %kadu copyright end%
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #pragma once
21 
22 #include "exports.h"
23 
24 #include <QtCore/QRect>
25 #include <QtGui/QColor>
26 #include <QtGui/QFont>
27 
28 class ConfigurationApi;
29 
30 class KADUAPI DeprecatedConfigurationApi final
31 {
32 	bool changeEntry(const QString &group, const QString &name, const QString &value);
33 	QString getEntry(const QString &group, const QString &name) const;
34 
35 	ConfigurationApi *m_xmlConfigFile;
36 	QString m_fileName;
37 
38 public:
39 	DeprecatedConfigurationApi(ConfigurationApi *xmlConfigFile, const QString &fileName);
40 
41 	void writeEntry(const QString &group, const QString &name, const QString &value);
42 	void writeEntry(const QString &group, const QString &name, const char *value);
43 	void writeEntry(const QString &group, const QString &name, const int value);
44 	void writeEntry(const QString &group, const QString &name, const bool value);
45 	void writeEntry(const QString &group, const QString &name, const QRect &value);
46 	void writeEntry(const QString &group, const QString &name, const QColor &value);
47 	void writeEntry(const QString &group, const QString &name, const QFont &value);
48 
49 	QString readEntry(const QString &group, const QString &name, const QString &def = QString()) const;
50 	int readNumEntry(const QString &group, const QString &name, int def = 0) const;
51 	unsigned int readUnsignedNumEntry(const QString &group, const QString &name, unsigned int def = 0) const;
52 	bool readBoolEntry(const QString &group, const QString &name, bool def = false) const;
53 	QRect readRectEntry(const QString &group, const QString &name, const QRect *def = 0L) const;
54 	QColor readColorEntry(const QString &group, const QString &name, const QColor *def = 0L) const;
55 	QFont readFontEntry(const QString &group, const QString &name, const QFont *def = 0L) const;
56 
57 	void removeVariable(const QString &group, const QString &name);
58 
59 	void addVariable(const QString &group, const QString &name, const QString &value);
60 	void addVariable(const QString &group, const QString &name, const char *value);
61 	void addVariable(const QString &group, const QString &name, const int value);
62 	void addVariable(const QString &group, const QString &name, const bool value);
63 	void addVariable(const QString &group, const QString &name, const QColor &value);
64 	void addVariable(const QString &group, const QString &name, const QFont &value);
65 
66 };
67