diff --git a/cmake b/cmake index de8a3b94..c4e9d83c 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit de8a3b94ba7d40becf5a647e5d429ebeeeab64ba +Subproject commit c4e9d83cb2da9bf250a1a3443e02e7303dfc9c84 diff --git a/src/noggit/application/Configuration/SettingsEntry.cpp b/src/noggit/application/Configuration/SettingsEntry.cpp new file mode 100644 index 00000000..f745d5fa --- /dev/null +++ b/src/noggit/application/Configuration/SettingsEntry.cpp @@ -0,0 +1,6 @@ +// This file is part of Noggit3, licensed under GNU General Public License (version 3). + +#include "SettingsEntry.hpp" + +using namespace Noggit::Application::Configuration; + diff --git a/src/noggit/application/Configuration/SettingsEntry.hpp b/src/noggit/application/Configuration/SettingsEntry.hpp new file mode 100644 index 00000000..31a459c0 --- /dev/null +++ b/src/noggit/application/Configuration/SettingsEntry.hpp @@ -0,0 +1,69 @@ +// This file is part of Noggit3, licensed under GNU General Public License (version 3). + +#ifndef NOGGIT_SETTINGSENTRY_HPP +#define NOGGIT_SETTINGSENTRY_HPP + +#include +#include +#include + +#include + +class QJsonObject; +class QWidget; + +namespace Noggit::Application::Configuration +{ + + using filepath = std::string; + + enum class SettingsEntryType + { + FILE_PATH, + DIR_PATH, + STRING, + COLOR_RGB, + COLOR_RGBA, + DOUBLE, + INT, + BOOL + }; + + enum class SettingsEntryDataType + { + STRING, + DOUBLE, + COLOR, + INT, + BOOL + }; + + + class SettingsEntry : public QObject + { + Q_OBJECT + public: + SettingsEntry() = default; + + virtual QWidget* createWidget(QWidget* parent) = 0; + virtual QJsonObject valueToJson() = 0; + virtual void valueFromJson(QJsonObject const& json_obj) = 0; + + //ValueType value() { return _value; }; + //void setValue(ValueType value) { _value = value; emit valueChanged(_type, &_value); } + + signals: + //void valueChanged(std::variant< const& value); + + private: + SettingsEntryType _type; + std::variant _value; + + }; + + + + +} + +#endif //NOGGIT_SETTINGSENTRY_HPP