KAuth 5.109.0
objectdecorator.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2009-2012 Dario Freddi <drf@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KAUTH_OBJECTDECORATOR_H
9#define KAUTH_OBJECTDECORATOR_H
10
11// Qt
12#include <QObject>
13// KAuthCore
14#include <KAuth/Action>
15// lib
16#include "kauth_export.h"
17// Std
18#include <memory>
19
20namespace KAuth
21{
22class ObjectDecoratorPrivate;
23
31class KAUTH_EXPORT ObjectDecorator : public QObject
32{
33 Q_OBJECT
34public:
40 explicit ObjectDecorator(QObject *parent);
41
45 ~ObjectDecorator() override;
46
54
65 void setAuthAction(const KAuth::Action &action);
66
74 void setAuthAction(const QString &actionName);
75
76Q_SIGNALS:
92 void authorized(const KAuth::Action &action);
93
94private:
95 friend class ObjectDecoratorPrivate;
96 std::unique_ptr<ObjectDecoratorPrivate> const d;
97
98 Q_PRIVATE_SLOT(d, void slotActivated())
99 Q_PRIVATE_SLOT(d, void authStatusChanged(KAuth::Action::AuthStatus))
100};
101
102} // namespace KAuth
103
104#endif // KAUTH_OBJECTDECORATOR_H
Class to access, authorize and execute actions.
Definition action.h:76
A decorator to add auth features to a button or an action.
Definition objectdecorator.h:32
void authorized(const KAuth::Action &action)
Signal emitted when the action is authorized.
~ObjectDecorator() override
Destructs the decorator.
void setAuthAction(const QString &actionName)
Sets the action object associated with this decorator.
void setAuthAction(const KAuth::Action &action)
Sets the action object associated with this decorator.
KAuth::Action authAction() const
Returns the action object associated with this decorator, or an invalid action if it does not have on...
ObjectDecorator(QObject *parent)
Instantiate a new decorator attached to an object.
Definition action.h:24