PolkitQt-1

polkitqt1-actiondescription.cpp
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#include "polkitqt1-actiondescription.h"
10
11#include <QString>
12
13#include <polkit/polkit.h>
14
15namespace PolkitQt1
16{
17
18class Q_DECL_HIDDEN ActionDescription::Data : public QSharedData
19{
20public:
21 Data() {}
22 Data(const Data& other)
23 : QSharedData(other)
24 , actionId(other.actionId)
25 , description(other.description)
26 , message(other.message)
27 , vendorName(other.vendorName)
28 , vendorUrl(other.vendorUrl)
29 , iconName(other.iconName)
30 , implicitAny(other.implicitAny)
31 , implicitInactive(other.implicitInactive)
32 , implicitActive(other.implicitActive)
33 {
34 }
35 virtual ~Data() {}
36
37 QString actionId;
38 QString description;
39 QString message;
40 QString vendorName;
41 QString vendorUrl;
42 QString iconName;
43
47};
48
49ActionDescription::ActionDescription()
50 : d(new Data)
51{
52
53}
54
55ActionDescription::ActionDescription(PolkitActionDescription *polkitActionDescription)
56 : d(new Data)
57{
58 d->actionId = QString::fromUtf8(polkit_action_description_get_action_id(polkitActionDescription));
59 d->description = QString::fromUtf8(polkit_action_description_get_description(polkitActionDescription));
60 d->message = QString::fromUtf8(polkit_action_description_get_message(polkitActionDescription));
61 d->vendorName = QString::fromUtf8(polkit_action_description_get_vendor_name(polkitActionDescription));
62 d->vendorUrl = QString::fromUtf8(polkit_action_description_get_vendor_url(polkitActionDescription));
63 d->iconName = QString::fromUtf8(polkit_action_description_get_icon_name(polkitActionDescription));
64
65 d->implicitAny = static_cast<ActionDescription::ImplicitAuthorization>(polkit_action_description_get_implicit_any(
66 polkitActionDescription));
67 d->implicitInactive = static_cast<ActionDescription::ImplicitAuthorization>(polkit_action_description_get_implicit_inactive(
68 polkitActionDescription));
69 d->implicitActive = static_cast<ActionDescription::ImplicitAuthorization>(polkit_action_description_get_implicit_active(
70 polkitActionDescription));
71}
72
73ActionDescription::ActionDescription(const PolkitQt1::ActionDescription& other)
74 : d(other.d)
75{
76}
77
78ActionDescription& ActionDescription::operator=(const PolkitQt1::ActionDescription& other)
79{
80 d = other.d;
81 return *this;
82}
83
84ActionDescription::~ActionDescription()
85{
86}
87
89{
90 return d->actionId;
91}
92
94{
95 return d->description;
96}
97
99{
100 return d->message;
101}
102
104{
105 return d->vendorName;
106}
107
109{
110 return d->vendorUrl;
111}
112
114{
115 return d->iconName;
116}
117
122
127
132
133}
Class used to encapsulate a registered action.
QString vendorUrl() const
Gets the vendor URL for ActionDescription, if any.
QString message() const
Gets the message used for ActionDescription.
ActionDescription::ImplicitAuthorization implicitActive() const
Gets the implicit authorization for ActionDescription used for subjects in active session on a local ...
QString actionId() const
Gets the action id for ActionDescription.
QString vendorName() const
Gets the vendor name for ActionDescription, if any.
QString iconName() const
Gets the icon name for ActionDescription, if any.
ActionDescription::ImplicitAuthorization implicitAny() const
Gets the implicit authorization for ActionDescription used for any subject.
ActionDescription::ImplicitAuthorization implicitInactive() const
Gets the implicit authorization for ActionDescription used for subjects in inactive session on a loca...
QString description() const
Gets the description used for ActionDescription.
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.