/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2020 Henri Chain SPDX-FileCopyrightText: 2021 Ismael Asensio SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef RULEBOOKSETTINGS_H #define RULEBOOKSETTINGS_H #include "rulebooksettingsbase.h" #include namespace KWin { class Rules; class RuleSettings; class RuleBookSettings : public RuleBookSettingsBase { public: RuleBookSettings(KSharedConfig::Ptr config, QObject *parent = nullptr); RuleBookSettings(const QString &configname, KConfig::OpenFlags, QObject *parent = nullptr); RuleBookSettings(KConfig::OpenFlags, QObject *parent = nullptr); RuleBookSettings(QObject *parent = nullptr); ~RuleBookSettings(); void setRules(const QVector &); QVector rules(); bool usrSave() override; void usrRead() override; bool usrIsSaveNeeded() const; int ruleCount() const; RuleSettings *ruleSettingsAt(int row) const; RuleSettings *insertRuleSettingsAt(int row); void removeRuleSettingsAt(int row); void moveRuleSettings(int srcRow, int destRow); private: static QString generateGroupName(); private: QVector m_list; QStringList m_storedGroups; }; } #endif // RULEBOOKSETTINGS_H