1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:15:31 +00:00
openmw-tes3mp/apps/opencs/model/settings/settingmanager.hpp

56 lines
1.4 KiB
C++
Raw Normal View History

2014-04-23 03:17:19 +00:00
#ifndef CSMSETTINGS_SETTINGMANAGER_HPP
#define CSMSETTINGS_SETTINGMANAGER_HPP
#include <QObject>
#include <QMap>
#include <QStringList>
#include <QTextStream>
#include <QSettings>
2014-04-23 03:17:19 +00:00
#include "support.hpp"
#include "setting.hpp"
namespace CSMSettings
{
typedef QMap <QString, QStringList *> DefinitionMap;
typedef QMap <QString, DefinitionMap *> DefinitionPageMap;
typedef QMap <QString, QList <Setting *> > SettingPageMap;
class SettingManager : public QObject
{
Q_OBJECT
QList <Setting *> mSettings;
public:
explicit SettingManager(QObject *parent = 0);
///retrieve a setting object from a given page and setting name
Setting *findSetting
(const QString &pageName, const QString &settingName = QString());
2014-04-23 03:17:19 +00:00
///Retreive a map of the settings, keyed by page name
SettingPageMap settingPageMap() const;
protected:
///add a new setting to the model and return it
Setting *createSetting (CSMSettings::SettingType typ,
const QString &page, const QString &name);
2014-04-23 03:17:19 +00:00
///add definitions to the settings specified in the page map
void addDefinitions (const QSettings *settings);
2014-04-23 03:17:19 +00:00
signals:
void userSettingUpdated (const QString &, const QStringList &);
2014-04-23 03:17:19 +00:00
public slots:
void updateUserSetting (const QString &, const QStringList &);
2014-04-23 03:17:19 +00:00
};
}
#endif // CSMSETTINGS_SETTINGMANAGER_HPP