1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00
OpenMW/apps/opencs/model/settings/usersettings.hpp

58 lines
1.4 KiB
C++
Raw Normal View History

2013-05-07 20:33:42 -05:00
#ifndef USERSETTINGS_HPP
#define USERSETTINGS_HPP
#include <QTextStream>
#include <QStringList>
#include <QString>
#include <QMap>
#include <boost/filesystem/path.hpp>
#include "support.hpp"
namespace Files { typedef std::vector<boost::filesystem::path> PathContainer;
struct ConfigurationManager;}
class QFile;
namespace CSMSettings {
2013-05-07 20:33:42 -05:00
struct UserSettings: public QObject
2013-05-07 20:33:42 -05:00
{
Q_OBJECT
2013-05-07 20:33:42 -05:00
public:
2013-06-12 12:36:35 +02:00
UserSettings();
~UserSettings();
static const UserSettings& instance();
2013-06-12 12:36:35 +02:00
void readSettings();
void setSettingsFiles(QStringList files);
2013-05-07 20:33:42 -05:00
2013-06-12 12:36:35 +02:00
QFile *openFile (const QString &) const;
bool writeFile(QFile *file, QMap<QString, SettingList *> &sections) const;
void getSettings (QTextStream &stream, SectionMap &settings) const;
QStringList getSettingsFiles () const;
CSMSettings::SectionMap getSettingsMap() const;
QString getSettingValue(QString section, QString setting) const;
2013-05-07 20:33:42 -05:00
private:
2013-06-12 12:36:35 +02:00
static UserSettings *mUserSettingsInstance;
CSMSettings::SectionMap mSectionMap;
QStringList mSettingsFiles;
UserSettings (UserSettings const &); //not implemented
void operator= (UserSettings const &); //not implemented
2013-05-07 20:33:42 -05:00
signals:
void signalUpdateEditorSetting (const QString &settingName, const QString &settingValue);
2013-05-07 20:33:42 -05:00
};
}
#endif // USERSETTINGS_HPP