#pragma once
#include "configlist.hpp"
#include "configobject.hpp"

namespace ZShell::config {

class PlayerAliasEntry : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(QString, from)
	CFG_PROPERTY(QString, to)

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

	[[nodiscard]] QStringList identityKeys() const override {
		return {QStringLiteral("from")};
	}
};

CONFIG_LIST_TYPE(PlayerAliasEntry, PlayerAliasList)

class Services : public ConfigObject {
	Q_OBJECT
	QML_ANONYMOUS

	CFG_PROPERTY(qreal, audioIncrement, 0.1)
	CFG_PROPERTY(qreal, brightnessIncrement, 0.1)
	CFG_PROPERTY(bool, ddcutilService, true)
	CFG_PROPERTY(QString, defaultPlayer, QStringLiteral("Spotify"))
	CFG_PROPERTY(QString, gpuType, QStringLiteral("NVIDIA"))
	CFG_PROPERTY(qreal, maxVolume, 1)
	CFG_PROPERTY(qreal, minBrightness, 0.01)
	CONFIG_LIST(
		PlayerAliasList,
		playerAliases,
		{
			vmap(
				{{"from", QStringLiteral("com.github.th_ch.youtube_music")},
				 {"to", QStringLiteral("YT Music")}}),
		})
	CFG_PROPERTY(bool, updates, true)
	CFG_PROPERTY(bool, useFahrenheit, false)
	CFG_PROPERTY(bool, useTwelveHourClock, false)
	CFG_PROPERTY(int, visualizerBars, 50)
	CFG_PROPERTY(QString, weatherLocation, QString())

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

} // namespace ZShell::config
