#pragma once

#include "configobject.hpp"
#include <qqmlregistration.h>

namespace ZShell::config {

class Anim : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(int, mediaGifSpeedAdjustment, 300)
	CFG_PROPERTY(qreal, sessionGifSpeed, 0.7)

	public:
	explicit Anim(QObject* parent = nullptr) : ConfigObject(parent) {}
};

class Deform : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(qreal, scale, 1)

	public:
	explicit Deform(QObject* parent = nullptr) : ConfigObject(parent) {}
};

class FontFamily : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(QString, clock, QStringLiteral("Rubik"))
	CFG_PROPERTY(QString, material, QStringLiteral("Material Symbols Rounded"))
	CFG_PROPERTY(QString, mono, QStringLiteral("CaskaydiaCove NF"))
	CFG_PROPERTY(QString, sans, QStringLiteral("Segoe UI Variable Text"))

	public:
	explicit FontFamily(QObject* parent = nullptr) : ConfigObject(parent) {}
};

class Font : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CONFIG_SUBOBJECT(FontFamily, family)

	public:
	explicit Font(QObject* parent = nullptr)
		: ConfigObject(parent), m_family(new FontFamily(this)) {}
};

class Transparency : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(qreal, base, 0.85)
	CFG_PROPERTY(bool, enabled, false)
	CFG_PROPERTY(qreal, layers, 0.4)

	public:
	explicit Transparency(QObject* parent = nullptr) : ConfigObject(parent) {}
};

class Appearance : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CONFIG_SUBOBJECT(Anim, anim)
	CONFIG_SUBOBJECT(Deform, deform)
	CONFIG_SUBOBJECT(Font, font)
	CONFIG_SUBOBJECT(Transparency, transparency)

	public:
	explicit Appearance(QObject* parent = nullptr)
		: ConfigObject(parent)
		, m_anim(new Anim(this))
		, m_deform(new Deform(this))
		, m_font(new Font(this))
		, m_transparency(new Transparency(this)) {}
};

} // namespace ZShell::config
