12#include "kauthcore_export.h"
15#include <QSharedDataPointer>
19#if __has_include(<chrono>)
130#if KAUTHCORE_ENABLE_DEPRECATED_SINCE(5, 71)
139 KAUTHCORE_DEPRECATED_VERSION_BELATED(5, 71, 5, 68,
"Use constructor with DetailsMap")
140 Action(const QString &name, const QString &details);
225#if __has_include(<chrono>)
230 void setTimeout(std::chrono::milliseconds msec)
232 setTimeout(
int(msec.count()));
236#if KAUTHCORE_ENABLE_DEPRECATED_SINCE(5, 71)
246 KAUTHCORE_DEPRECATED_VERSION_BELATED(5, 71, 5, 68,
"Use setDetailsV2() with DetailsMap")
247 void setDetails(const QString &details);
264#if KAUTHCORE_ENABLE_DEPRECATED_SINCE(5, 71)
274 KAUTHCORE_DEPRECATED_VERSION_BELATED(5, 71, 5, 68,
"Use detailsV2() with DetailsMap")
275 QString details() const;
448 QSharedDataPointer<ActionData> d;
Class to access, authorize and execute actions.
Definition action.h:76
QString helperId() const
Gets the default helper ID used for actions execution.
void setTimeout(int timeout)
Sets the action's timeout.
int timeout() const
Gets the action's timeout.
void setArguments(const QVariantMap &arguments)
Sets the map object used to pass arguments to the helper.
Action(const QString &name, const DetailsMap &details)
This creates a new action object with this name and details.
void addArgument(const QString &key, const QVariant &value)
Convenience method to add an argument.
QMap< AuthDetail, QVariant > DetailsMap
Map of details.
Definition action.h:110
void setName(const QString &name)
Sets the action's name.
AuthStatus status() const
Gets information about the authorization status of an action.
QString name() const
Gets the action's name.
bool hasHelper() const
Checks if the action has an helper.
bool operator!=(const Action &action) const
Negated comparison operator.
bool isValid() const
Returns if the object represents a valid action.
DetailsMap detailsV2() const
Gets the action's details.
~Action()
Virtual destructor.
void setHelperId(const QString &id)
Sets the default helper ID used for actions execution.
void setParentWidget(QWidget *parent)
Sets a parent widget for the authentication dialog.
QVariantMap arguments() const
Returns map object used to pass arguments to the helper.
Action & operator=(const Action &action)
Assignment operator.
ExecuteJob * execute(ExecutionMode mode=ExecuteMode)
Get the job object used to execute the action.
QWidget * parentWidget() const
Returns the parent widget for the authentication dialog for this action.
AuthStatus
The three values set by authorization methods.
Definition action.h:82
@ DeniedStatus
The authorization has been denied by the authorization backend.
Definition action.h:83
@ AuthRequiredStatus
The user could obtain the authorization after authentication.
Definition action.h:87
@ InvalidStatus
An invalid action cannot be authorized.
Definition action.h:85
@ UserCancelledStatus
The user pressed Cancel the authentication dialog. Currently used only on the mac.
Definition action.h:88
@ ErrorStatus
An error occurred.
Definition action.h:84
@ AuthorizedStatus
The authorization has been granted by the authorization backend.
Definition action.h:86
void setDetailsV2(const DetailsMap &details)
Sets the action's details.
bool operator==(const Action &action) const
Comparison operator.
AuthDetail
The backend specific details.
Definition action.h:101
Job for executing an Action.
Definition executejob.h:40