KAuth 5.109.0
executejob.h
1/*
2 SPDX-FileCopyrightText: 2012 Dario Freddi <drf@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KAUTH_EXECUTE_JOB_H
8#define KAUTH_EXECUTE_JOB_H
9
10#include <kjob.h>
11
12#include "action.h"
13#include "actionreply.h"
14
15#include <memory>
16
17namespace KAuth
18{
19class ExecuteJobPrivate;
20
39class KAUTHCORE_EXPORT ExecuteJob : public KJob
40{
41 Q_OBJECT
42
43private:
44 KAUTHCORE_NO_EXPORT ExecuteJob(const KAuth::Action &action, KAuth::Action::ExecutionMode mode, QObject *parent);
45
46 friend class Action;
47
48 friend class ExecuteJobPrivate;
49 std::unique_ptr<ExecuteJobPrivate> const d;
50
51 Q_PRIVATE_SLOT(d, void doExecuteAction())
52 Q_PRIVATE_SLOT(d, void doAuthorizeAction())
53 Q_PRIVATE_SLOT(d, void actionPerformedSlot(const QString &action, const KAuth::ActionReply &reply))
54 Q_PRIVATE_SLOT(d, void progressStepSlot(const QString &action, int i))
55 Q_PRIVATE_SLOT(d, void statusChangedSlot(const QString &action, KAuth::Action::AuthStatus status))
56
57public:
59 ~ExecuteJob() override;
60
67 void start() override;
68
72 Action action() const;
73
86 QVariantMap data() const;
87
88public Q_SLOTS:
100 bool kill(KillVerbosity verbosity = Quietly);
101
102Q_SIGNALS:
116 void newData(const QVariantMap &data);
117
123
124private:
125 Q_DISABLE_COPY(ExecuteJob)
126};
127
128} // namespace Auth
129
130#endif
Class that encapsulates a reply coming from the helper after executing an action.
Definition actionreply.h:335
Class to access, authorize and execute actions.
Definition action.h:76
AuthStatus
The three values set by authorization methods.
Definition action.h:82
Job for executing an Action.
Definition executejob.h:40
void newData(const QVariantMap &data)
Signal emitted by the helper to notify the action's progress.
QVariantMap data() const
Use this to get the data set in the action by HelperSupport::progressStep(QVariant) or returned at th...
void statusChanged(KAuth::Action::AuthStatus status)
Signal emitted when the authentication status changes.
~ExecuteJob() override
Virtual destructor.
Action action() const
void start() override
Starts the job asynchronously.
bool kill(KillVerbosity verbosity=Quietly)
Attempts to halt the execution of the action associated with this job.
Definition action.h:24