#pragma once

#include <QObject>
#include <QSettings>
#include <QString>
#include <QFont>

// ---------------------------------------------------------------------------
// Settings – Centralised persistent application settings.
// ---------------------------------------------------------------------------
class Settings : public QObject
{
    Q_OBJECT

public:
    explicit Settings(QObject *parent = nullptr);

    // Editor
    QFont   editorFont() const;
    void    setEditorFont(const QFont &font);

    int     tabSize() const;
    void    setTabSize(int size);

    bool    useSpacesForTabs() const;
    void    setUseSpacesForTabs(bool use);

    // Layout
    int     fileTreeWidth() const;
    void    setFileTreeWidth(int width);

    // Zuletzt geöffnete Dateien (Session-Wiederherstellung)
    QStringList lastOpenFiles() const;
    void        setLastOpenFiles(const QStringList &files);

    QString     lastActiveFile() const;
    void        setLastActiveFile(const QString &file);

    // Recent
    QString lastProjectPath() const;
    void    setLastProjectPath(const QString &path);

    // Erscheinungsbild
    bool    darkMode() const;
    void    setDarkMode(bool dark);

signals:
    void settingsChanged();

private:
    QSettings m_settings;
};
