PolkitQt-1

polkitqt1-actiondescription.cpp
1 /*
2  This file is part of the Polkit-qt project
3  SPDX-FileCopyrightText: 2009 Jaroslav Reznik <[email protected]>
4  SPDX-FileCopyrightText: 2010 Dario Freddi <[email protected]>
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 
15 namespace PolkitQt1
16 {
17 
18 class Q_DECL_HIDDEN ActionDescription::Data : public QSharedData
19 {
20 public:
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;
40  QString vendorName;
41  QString vendorUrl;
42  QString iconName;
43 
47 };
48 
49 ActionDescription::ActionDescription()
50  : d(new Data)
51 {
52 
53 }
54 
55 ActionDescription::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 
73 ActionDescription::ActionDescription(const PolkitQt1::ActionDescription& other)
74  : d(other.d)
75 {
76 }
77 
78 ActionDescription& ActionDescription::operator=(const PolkitQt1::ActionDescription& other)
79 {
80  d = other.d;
81  return *this;
82 }
83 
84 ActionDescription::~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 
119 {
120  return d->implicitAny;
121 }
122 
124 {
125  return d->implicitInactive;
126 }
127 
129 {
130  return d->implicitActive;
131 }
132 
133 }
QString fromUtf8(const char *str, int size)
ActionDescription::ImplicitAuthorization implicitActive() const
Gets the implicit authorization for ActionDescription used for subjects in active session on a local ...
Class used to encapsulate a registered action.
QString message() const
Gets the message used for ActionDescription.
ActionDescription::ImplicitAuthorization implicitInactive() const
Gets the implicit authorization for ActionDescription used for subjects in inactive session on a loca...
QString actionId() const
Gets the action id for ActionDescription.
QString description() const
Gets the description used for ActionDescription.
QString vendorName() const
Gets the vendor name for ActionDescription, if any.
ActionDescription::ImplicitAuthorization implicitAny() const
Gets the implicit authorization for ActionDescription used for any subject.
QString iconName() const
Gets the icon name for ActionDescription, if any.
Namespace wrapping Polkit-Qt classes.
QString vendorUrl() const
Gets the vendor URL for ActionDescription, if any.
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 04:06:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.