KAuth

AuthBackend.h
1/*
2 SPDX-FileCopyrightText: 2008 Nicola Gigante <nicola.gigante@gmail.com>
3 SPDX-FileCopyrightText: 2009-2010 Dario Freddi <drf@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef KAUTH_AUTH_BACKEND_H
9#define KAUTH_AUTH_BACKEND_H
10
11#include <QObject>
12
13#include "action.h"
14
15namespace KAuth
16{
17typedef Action::DetailsMap DetailsMap;
18
19class AuthBackend : public QObject
20{
22 Q_DISABLE_COPY(AuthBackend)
23
24public:
25 enum Capability {
26 NoCapability = 0,
27 AuthorizeFromClientCapability = 1,
28 AuthorizeFromHelperCapability = 2,
29 PreAuthActionCapability = 4,
30 };
31 Q_DECLARE_FLAGS(Capabilities, Capability)
32
33 AuthBackend();
34 ~AuthBackend() override;
35 virtual void setupAction(const QString &action) = 0;
36 virtual void preAuthAction(const QString &action, QWindow *parent);
37 virtual Action::AuthStatus authorizeAction(const QString &action) = 0;
38 virtual Action::AuthStatus actionStatus(const QString &action) = 0;
39 virtual QByteArray callerID() const = 0;
40 virtual bool isCallerAuthorized(const QString &action, const QByteArray &callerID, const QVariantMap &details) = 0;
41 virtual QVariantMap backendDetails(const DetailsMap &details);
42
43 Capabilities capabilities() const;
44
45protected:
46 void setCapabilities(Capabilities capabilities);
47
49 void actionStatusChanged(const QString &action, KAuth::Action::AuthStatus status);
50
51private:
52 class Private;
53 Private *const d;
54};
55
56Q_DECLARE_OPERATORS_FOR_FLAGS(AuthBackend::Capabilities)
57
58} // namespace Auth
59
60Q_DECLARE_INTERFACE(KAuth::AuthBackend, "org.kde.kf6auth.AuthBackend/0.1")
61
62#endif
QMap< AuthDetail, QVariant > DetailsMap
Map of details.
Definition action.h:112
AuthStatus
The three values set by authorization methods.
Definition action.h:84
Q_SCRIPTABLE CaptureState status()
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.