File indexing completed on 2025-01-05 05:07:03

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2011 Craig Drummond <craig.p.drummond@gmail.com>
0003 // SPDX-FileCopyrightText: 2018 Alexis Lopes Zubeta <contact@azubieta.net>
0004 // SPDX-FileCopyrightText: 2020 Tomaz Canabrava <tcanabrava@kde.org>
0005 #ifndef UFW_HELPER_H
0006 #define UFW_HELPER_H
0007 
0008 /*
0009  * UFW KControl Module
0010  */
0011 
0012 #include <KAuth/ActionReply>
0013 #include <QObject>
0014 #include <QVariantMap>
0015 #include <QtContainerFwd>
0016 
0017 class QByteArray;
0018 
0019 using namespace KAuth;
0020 
0021 namespace UFW
0022 {
0023 
0024 class Helper : public QObject
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     enum Status {
0030         STATUS_OK,
0031         STATUS_INVALID_CMD = -100,
0032         STATUS_INVALID_ARGUMENTS = -101,
0033         STATUS_OPERATION_FAILED = -102,
0034     };
0035 
0036 public Q_SLOTS:
0037 
0038     ActionReply query(const QVariantMap &args);
0039     ActionReply viewlog(const QVariantMap &args);
0040     ActionReply modify(const QVariantMap &args);
0041 
0042     ActionReply queryapps(const QVariantMap &args);
0043 
0044 private:
0045     ActionReply setStatus(const QVariantMap &args, const QString &cmd);
0046     ActionReply setDefaults(const QVariantMap &args, const QString &cmd);
0047     ActionReply setModules(const QVariantMap &args, const QString &cmd);
0048     ActionReply setProfile(const QVariantMap &args, const QString &cmd);
0049     ActionReply saveProfile(const QVariantMap &args, const QString &cmd);
0050     ActionReply deleteProfile(const QVariantMap &args, const QString &cmd);
0051     ActionReply addRules(const QVariantMap &args, const QString &cmd);
0052     ActionReply removeRule(const QVariantMap &args, const QString &cmd);
0053     ActionReply moveRule(const QVariantMap &args, const QString &cmd);
0054     ActionReply editRule(const QVariantMap &args, const QString &cmd);
0055     //     ActionReply editRuleDescr(const QVariantMap &args, const QString &cmd);
0056     ActionReply reset(const QString &cmd);
0057     ActionReply run(const QStringList &args, const QString &cmd);
0058     ActionReply run(const QStringList &args, const QStringList &second, const QString &cmd);
0059 
0060 private:
0061 };
0062 
0063 }
0064 
0065 #endif