#pragma once

#include "configobject.hpp"
#include "configlist.hpp"

#include <QVariantList>
#include <QStringList>
#include <qqmlintegration.h>

namespace ZShell::config {

class UtilitiesSizes : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(int, toastWidth, 430)
	CFG_PROPERTY(int, width, 430)

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

class Toasts : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(bool, audioInputChanged, true)
	CFG_PROPERTY(bool, audioOutputChanged, true)
	CFG_PROPERTY(bool, capsLockChanged, true)
	CFG_PROPERTY(bool, chargingChanged, true)
	CFG_PROPERTY(bool, configLoaded, true)
	CFG_PROPERTY(bool, dndChanged, true)
	CFG_PROPERTY(bool, gameModeChanged, true)
	CFG_PROPERTY(bool, kbLayoutChanged, true)
	CFG_PROPERTY(bool, kbLimit, true)
	CFG_PROPERTY(bool, nowPlaying, false)
	CFG_PROPERTY(bool, numLockChanged, true)
	CFG_PROPERTY(bool, vpnChanged, true)

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

class Vpn : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(bool, enabled, false)
	CFG_PROPERTY(QStringList, provider, (QStringList{QStringLiteral("netbird")}))

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

class Utilities : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(bool, enabled, true)
	CFG_PROPERTY(int, maxToasts, 4)
	CONFIG_SUBOBJECT(UtilitiesSizes, sizes)
	CONFIG_SUBOBJECT(Toasts, toasts)
	CONFIG_SUBOBJECT(Vpn, vpn)
	CONFIG_LIST(
		EntryList,
		quickToggles,
		{LIST_ENTRY(dnd, true),
		 LIST_ENTRY(wifi, true),
		 LIST_ENTRY(settings, true),
		 LIST_ENTRY(bluetooth, true),
		 LIST_ENTRY(mic, true),
		 LIST_ENTRY(audio, true),
		 LIST_ENTRY(gameMode, true)})

	public:
	explicit Utilities(QObject* parent = nullptr)
		: ConfigObject(parent)
		, m_sizes(new UtilitiesSizes(this))
		, m_toasts(new Toasts(this))
		, m_vpn(new Vpn(this)) {}
};

} // namespace ZShell::config
