#ifndef EDITORSETTINGSOPTIONS_H
#define EDITORSETTINGSOPTIONS_H

#include <QObject>
//声明QtQml/qqml.h库，这个库包含Qt QML相关文件，可将C++类暴露给QML
#include <QtQml/qqml.h>
#include <sstream>
#include <QString>
#include <QWidget>
#include "lqtutils_enum.h"
//声明枚举类型
L_DECLARE_ENUM(FontTypeface, SansSerif, Serif, Mono)
L_DECLARE_ENUM(FontSizeAction, FontSizeIncrease, FontSizeDecrease)
L_DECLARE_ENUM(EditorTextWidth, TextWidthIncrease, TextWidthDecrease, TextWidthFullWidth)
L_DECLARE_ENUM(Theme, Light, Dark, Sepia)
L_DECLARE_ENUM(View, TextView, KanbanView)

class EditorSettingsOptions : public QObject
{
    Q_OBJECT

public:
    explicit EditorSettingsOptions(QObject *parent = nullptr);
};

//重载<<运算符，将枚举类型的值输出到标准输出流
std::ostream &operator<<(std::ostream &os, const Theme::Value &theme);
std::ostream &operator<<(std::ostream &os, const FontTypeface::Value &fontTypeface);
//为了适配标准输出流，重载字符串转换函数
std::string to_string(FontTypeface::Value fontTypeface);
std::string to_string(Theme::Value theme);

//更新CSS样式和类
void setCSSThemeAndUpdate(QWidget *obj, Theme::Value theme);
void setCSSClassesAndUpdate(QWidget *obj, std::string classNames);

#endif
