KAuth

HelperProxy.h
1 /*
2  SPDX-FileCopyrightText: 2008 Nicola Gigante <[email protected]>
3  SPDX-FileCopyrightText: 2020 Harald Sitter <[email protected]>
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.kf5auth.HelperProxy/0.1")
54 
55 #endif
Q_OBJECTQ_OBJECT
Class that encapsulates a reply coming from the helper after executing an action.
Definition: actionreply.h:334
QMap< AuthDetail, QVariant > DetailsMap
Map of details.
Definition: action.h:110
Q_SIGNALSQ_SIGNALS
Definition: action.cpp:18
KAUTHCORE_EXPORT void progressStep(int step)
Send a progressStep signal to the caller application.
KAUTHCORE_EXPORT int callerUid()
Obtains the caller user id if available.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Feb 5 2023 04:14:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.