/***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/ 
/*
	This class is taken from the tutorial " How to implement User defined settings"
	on the www.kdevelop.org website written by Andreas Nicolai.
*/

#ifndef KFCONFIGURATION_H
#define KFCONFIGURATION_H

#include <qstring.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>

/// This is the one and only configuration object.
/// The member functions read() and write() can be used to load and save
/// the properties to the application configuration file.
class KFConfiguration {
public:
	/// Reads the configuration data from the application config file.
	/// If a property does not already exist in the config file it will be
	/// set to a default value.
	void read();
	/// Writes the configuration data to the application config file.
	void write() const;

	int m_Level;
	int m_GameLevel;
	QString m_Image;
	QString m_player;
	static const int m_defaultLevel;
	static const int m_defaultGameLevel;
	static const QString m_defaultImage;
	static const QString m_defaultPlayer;

private:
	KFConfiguration();
	KFConfiguration( const KFConfiguration& );

	friend KFConfiguration& Config();
};

/// Returns a reference to the application configuration object.
KFConfiguration& Config();

#endif  // KFCONFIGURATION_H
