| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2008 Nicola Gigante <nicola.gigante@gmail.com> |
| 3 | SPDX-FileCopyrightText: 2020 Harald Sitter <sitter@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KAUTH_HELPER_PROXY_H |
| 9 | #define KAUTH_HELPER_PROXY_H |
| 10 | |
| 11 | #include <QMap> |
| 12 | #include <QObject> |
| 13 | #include <QString> |
| 14 | #include <QVariant> |
| 15 | |
| 16 | #include "action.h" |
| 17 | #include "actionreply.h" |
| 18 | |
| 19 | namespace KAuth |
| 20 | { |
| 21 | typedef Action::DetailsMap DetailsMap; |
| 22 | |
| 23 | class HelperProxy : public QObject |
| 24 | { |
| 25 | Q_OBJECT |
| 26 | |
| 27 | public: |
| 28 | ~HelperProxy() override; |
| 29 | |
| 30 | // Application-side methods |
| 31 | virtual void executeAction(const QString &action, const QString &helperID, const DetailsMap &details, const QVariantMap &arguments, int timeout) = 0; |
| 32 | virtual void stopAction(const QString &action, const QString &helperID) = 0; |
| 33 | |
| 34 | // Helper-side methods |
| 35 | virtual bool initHelper(const QString &name) = 0; |
| 36 | virtual void setHelperResponder(QObject *o) = 0; |
| 37 | virtual bool hasToStopAction() = 0; |
| 38 | virtual void sendDebugMessage(int level, const char *msg) = 0; |
| 39 | virtual void sendProgressStep(int step) = 0; |
| 40 | virtual void sendProgressStepData(const QVariantMap &step) = 0; |
| 41 | // Attempts to resolve the UID of the unprivileged remote process. |
| 42 | virtual int callerUid() const = 0; |
| 43 | |
| 44 | Q_SIGNALS: |
| 45 | void actionStarted(const QString &action); |
| 46 | void actionPerformed(const QString &action, const KAuth::ActionReply &reply); |
| 47 | void progressStep(const QString &action, int progress); |
| 48 | void progressStepData(const QString &action, const QVariantMap &data); |
| 49 | }; |
| 50 | |
| 51 | } // namespace KAuth |
| 52 | |
| 53 | Q_DECLARE_INTERFACE(KAuth::HelperProxy, "org.kde.kf6auth.HelperProxy/0.1" ) |
| 54 | |
| 55 | #endif |
| 56 | |