2
* This file is part of the Polkit-qt project
3
* Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public License
16
* along with this library; see the file COPYING.LIB. If not, write to
17
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
21
#include "actiondescription.h"
23
#include <QtCore/QString>
25
#include <polkit/polkit.h>
27
using namespace PolkitQt;
29
class ActionDescription::Private
41
ActionDescription::ImplicitAuthorization implicitAny;
42
ActionDescription::ImplicitAuthorization implicitInactive;
43
ActionDescription::ImplicitAuthorization implicitActive;
46
ActionDescription::ActionDescription(PolkitActionDescription *polkitActionDescription)
51
d->actionId = QString::fromUtf8(polkit_action_description_get_action_id(polkitActionDescription));
52
d->description = QString::fromUtf8(polkit_action_description_get_description(polkitActionDescription));
53
d->message = QString::fromUtf8(polkit_action_description_get_message(polkitActionDescription));
54
d->vendorName = QString::fromUtf8(polkit_action_description_get_vendor_name(polkitActionDescription));
55
d->vendorUrl = QString::fromUtf8(polkit_action_description_get_vendor_url(polkitActionDescription));
56
d->iconName = QString::fromUtf8(polkit_action_description_get_icon_name(polkitActionDescription));
58
d->implicitAny = static_cast<ActionDescription::ImplicitAuthorization>(polkit_action_description_get_implicit_any(
59
polkitActionDescription));
60
d->implicitInactive = static_cast<ActionDescription::ImplicitAuthorization>(polkit_action_description_get_implicit_inactive(
61
polkitActionDescription));
62
d->implicitActive = static_cast<ActionDescription::ImplicitAuthorization>(polkit_action_description_get_implicit_active(
63
polkitActionDescription));
66
ActionDescription::~ActionDescription()
71
QString ActionDescription::actionId() const
76
QString ActionDescription::description() const
78
return d->description;
81
QString ActionDescription::message() const
86
QString ActionDescription::vendorName() const
91
QString ActionDescription::vendorUrl() const
96
QString ActionDescription::iconName() const
101
ActionDescription::ImplicitAuthorization ActionDescription::implicitAny() const
103
return d->implicitAny;
106
ActionDescription::ImplicitAuthorization ActionDescription::implicitInactive() const
108
return d->implicitInactive;
111
ActionDescription::ImplicitAuthorization ActionDescription::implicitActive() const
113
return d->implicitActive;