PolkitQt-1

polkitqt1-actiondescription.h
1/*
2 This file is part of the Polkit-qt project
3 SPDX-FileCopyrightText: 2009 Jaroslav Reznik <jreznik@redhat.com>
4 SPDX-FileCopyrightText: 2010 Dario Freddi <drf@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef POLKITQT1_ACTION_DESCRIPTION_H
10#define POLKITQT1_ACTION_DESCRIPTION_H
11
12#include "polkitqt1-core-export.h"
13
14#include <QList>
15#include <QMetaType>
16#include <QSharedData>
17
18typedef struct _PolkitActionDescription PolkitActionDescription;
19
20namespace PolkitQt1
21{
22/**
23 * \class ActionDescription polkitqt1-actiondescription.h ActionDescription
24 * \author Jaroslav Reznik <jreznik@redhat.com>
25 * \author Dario Freddi <drf@kde.org>
26 *
27 * \brief Class used to encapsulate a registered action.
28 */
29class POLKITQT1_CORE_EXPORT ActionDescription
30{
31public:
33 /** Unknown whether the subject is authorized, never returned in any public API. **/
34 Unknown = -1,
35 /** Subject is not authorized. **/
36 NotAuthorized = 0,
37 /** Authentication is required. **/
38 AuthenticationRequired = 1,
39 /** Authentication as an administrator is required. **/
40 AdministratorAuthenticationRequired = 2,
41 /** Authentication is required. If the authorization is obtained, it is retained. **/
42 AuthenticationRequiredRetained = 3,
43 /** Authentication as an administrator is required. If the authorization is obtained, it is retained. **/
44 AdministratorAuthenticationRequiredRetained = 4,
45 /** The subject is authorized. **/
46 Authorized = 5
47 };
48
49 typedef QList< ActionDescription > List;
50
52 /**
53 * \brief Constructor of ActionDescription object from PolkitActionDescription
54 *
55 * \warning Use this only if you are completely aware of what are you doing!
56 *
57 * \param actionDesciption PolkitActionDescription
58 */
59 explicit ActionDescription(PolkitActionDescription *actionDescription);
62
63 ActionDescription &operator=(const ActionDescription &other);
64
65 /**
66 * \brief Gets the action id for ActionDescription
67 *
68 * \return id of the action
69 */
70 QString actionId() const;
71
72 /**
73 * \brief Gets the description used for ActionDescription
74 *
75 * \return description of the action
76 */
77 QString description() const;
78
79 /**
80 * \brief Gets the message used for ActionDescription
81 *
82 * \return action message
83 */
84 QString message() const;
85
86 /**
87 * \brief Gets the vendor name for ActionDescription, if any
88 *
89 * \return vendor name
90 */
91 QString vendorName() const;
92
93 /**
94 * \brief Gets the vendor URL for ActionDescription, if any
95 *
96 * \return vendor URL or empty QString if there is no vendor URL
97 */
98 QString vendorUrl() const;
99
100 /**
101 * \brief Gets the icon name for ActionDescription, if any
102 *
103 * \return icon name or empty QString if there is no icon
104 */
105 QString iconName() const;
106
107 /**
108 * \brief Gets the implicit authorization for ActionDescription used for any subject
109 *
110 * \return A value from ImplicitAuthorization enumeration
111 */
113
114 /**
115 * \brief Gets the implicit authorization for ActionDescription used for subjects in inactive session on a local console
116 *
117 * \return A value from ImplicitAuthorization enumeration
118 */
119 ActionDescription::ImplicitAuthorization implicitInactive() const;
120
121 /**
122 * \brief Gets the implicit authorization for ActionDescription used for subjects in active session on a local console
123 *
124 * \return A value from ImplicitAuthorization enumeration
125 */
126 ActionDescription::ImplicitAuthorization implicitActive() const;
127
128private:
129 class Data;
131};
132}
133
134Q_DECLARE_METATYPE(PolkitQt1::ActionDescription::List)
135
136#endif //POLKIT_QT_ACTION_DESCRIPTION_H
Class used to encapsulate a registered action.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:55:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.