all repos — mgba @ 37212c1f238d25448cfde5a3ec16ca23ab036658

mGBA Game Boy Advance Emulator

src/platform/qt/ConfigController.h (view raw)

 1#ifndef QGBA_CONFIG_CONTROLLER
 2#define QGBA_CONFIG_CONTROLLER
 3
 4#include <QObject>
 5
 6extern "C" {
 7#include "gba-config.h"
 8#include "util/configuration.h"
 9}
10
11struct GBAArguments;
12
13namespace QGBA {
14class ConfigController : public QObject {
15Q_OBJECT
16
17public:
18	constexpr static const char* const PORT = "qt";
19
20	ConfigController(QObject* parent = nullptr);
21	~ConfigController();
22
23	const GBAOptions* options() const { return &m_opts; }
24	bool parseArguments(GBAArguments* args, int argc, char* argv[]);
25
26public slots:
27	void setOption(const char* key, bool value);
28	void setOption(const char* key, int value);
29	void setOption(const char* key, unsigned value);
30	void setOption(const char* key, const char* value);
31
32	void write();
33
34private:
35	GBAConfig m_config;
36	GBAOptions m_opts;
37};
38
39}
40
41#endif