2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2020-02-18 13:52:08 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Henri Chain <henri.chain@enioka.com>
|
2021-03-19 18:43:47 +00:00
|
|
|
SPDX-FileCopyrightText: 2021 Ismael Asensio <isma.af@gmail.com>
|
2020-02-18 13:52:08 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2020-02-18 13:52:08 +00:00
|
|
|
|
|
|
|
#ifndef RULEBOOKSETTINGS_H
|
|
|
|
#define RULEBOOKSETTINGS_H
|
|
|
|
|
|
|
|
#include "rulebooksettingsbase.h"
|
|
|
|
#include <KSharedConfig>
|
|
|
|
|
|
|
|
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);
|
2021-03-19 18:43:47 +00:00
|
|
|
~RuleBookSettings();
|
|
|
|
|
2020-02-18 13:52:08 +00:00
|
|
|
void setRules(const QVector<Rules *> &);
|
|
|
|
QVector<Rules *> rules();
|
2021-03-19 18:43:47 +00:00
|
|
|
|
2020-02-18 13:52:08 +00:00
|
|
|
bool usrSave() override;
|
|
|
|
void usrRead() override;
|
2021-03-19 18:43:47 +00:00
|
|
|
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();
|
2020-02-18 13:52:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QVector<RuleSettings *> m_list;
|
2021-03-19 18:43:47 +00:00
|
|
|
QStringList m_storedGroups;
|
2020-02-18 13:52:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // RULEBOOKSETTINGS_H
|