gtk3/docs/reference/gtk/html/GtkLockButton.html
2022-11-23 15:09:27 +00:00

363 lines
18 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkLockButton: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="prev" href="GtkVolumeButton.html" title="GtkVolumeButton">
<link rel="next" href="GtkModelButton.html" title="GtkModelButton">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#GtkLockButton.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GtkLockButton.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
<a href="#GtkLockButton.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span> 
<a href="#GtkLockButton.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ButtonWidgets.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkVolumeButton.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkModelButton.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkLockButton"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkLockButton.top_of_page"></a>GtkLockButton</span></h2>
<p>GtkLockButton — A widget to unlock or lock privileged operations</p>
</td>
<td class="gallery_image" valign="top" align="right"><img src="lockbutton.png"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkLockButton.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkLockButton.html#gtk-lock-button-new" title="gtk_lock_button_new ()">gtk_lock_button_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GPermission</span> *
</td>
<td class="function_name">
<a class="link" href="GtkLockButton.html#gtk-lock-button-get-permission" title="gtk_lock_button_get_permission ()">gtk_lock_button_get_permission</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkLockButton.html#gtk-lock-button-set-permission" title="gtk_lock_button_set_permission ()">gtk_lock_button_set_permission</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkLockButton.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<span class="type">GPermission</span> *</td>
<td class="property_name"><a class="link" href="GtkLockButton.html#GtkLockButton--permission" title="The “permission” property">permission</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkLockButton.html#GtkLockButton--text-lock" title="The “text-lock” property">text-lock</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkLockButton.html#GtkLockButton--text-unlock" title="The “text-unlock” property">text-unlock</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkLockButton.html#GtkLockButton--tooltip-lock" title="The “tooltip-lock” property">tooltip-lock</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkLockButton.html#GtkLockButton--tooltip-not-authorized" title="The “tooltip-not-authorized” property">tooltip-not-authorized</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkLockButton.html#GtkLockButton--tooltip-unlock" title="The “tooltip-unlock” property">tooltip-unlock</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkLockButton.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkLockButton.html#GtkLockButton-struct" title="struct GtkLockButton">GtkLockButton</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkLockButton.html#GtkLockButtonClass" title="struct GtkLockButtonClass">GtkLockButtonClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkLockButton.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> GObject
<span class="lineart">╰──</span> GInitiallyUnowned
<span class="lineart">╰──</span> <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
<span class="lineart">╰──</span> <a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
<span class="lineart">╰──</span> <a class="link" href="GtkBin.html" title="GtkBin">GtkBin</a>
<span class="lineart">╰──</span> <a class="link" href="GtkButton.html" title="GtkButton">GtkButton</a>
<span class="lineart">╰──</span> GtkLockButton
</pre>
</div>
<div class="refsect1">
<a name="GtkLockButton.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkLockButton implements
AtkImplementorIface, <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>, <a class="link" href="GtkActionable.html" title="GtkActionable">GtkActionable</a> and <a class="link" href="GtkActivatable.html" title="GtkActivatable">GtkActivatable</a>.</p>
</div>
<div class="refsect1">
<a name="GtkLockButton.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkLockButton.description"></a><h2>Description</h2>
<p>GtkLockButton is a widget that can be used in control panels or
preference dialogs to allow users to obtain and revoke authorizations
needed to operate the controls. The required authorization is represented
by a <span class="type">GPermission</span> object. Concrete implementations of <span class="type">GPermission</span> may use
PolicyKit or some other authorization framework. To obtain a PolicyKit-based
<span class="type">GPermission</span>, use <a href="http://www.freedesktop.org/software/polkit/docs/latest/PolkitPermission.html#polkit-permission-new"><code class="function">polkit_permission_new()</code></a>.</p>
<p>If the user is not currently allowed to perform the action, but can obtain
the permission, the widget looks like this:</p>
<p><span class="inlinemediaobject"><img src="lockbutton-locked.png"></span></p>
<p>and the user can click the button to request the permission. Depending
on the platform, this may pop up an authentication dialog or ask the user
to authenticate in some other way. Once the user has obtained the permission,
the widget changes to this:</p>
<p><span class="inlinemediaobject"><img src="lockbutton-unlocked.png"></span></p>
<p>and the permission can be dropped again by clicking the button. If the user
is not able to obtain the permission at all, the widget looks like this:</p>
<p><span class="inlinemediaobject"><img src="lockbutton-sorry.png"></span></p>
<p>If the user has the permission and cannot drop it, the button is hidden.</p>
<p>The text (and tooltips) that are shown in the various cases can be adjusted
with the <a class="link" href="GtkLockButton.html#GtkLockButton--text-lock" title="The “text-lock” property"><span class="type">“text-lock”</span></a>, <a class="link" href="GtkLockButton.html#GtkLockButton--text-unlock" title="The “text-unlock” property"><span class="type">“text-unlock”</span></a>,
<a class="link" href="GtkLockButton.html#GtkLockButton--tooltip-lock" title="The “tooltip-lock” property"><span class="type">“tooltip-lock”</span></a>, <a class="link" href="GtkLockButton.html#GtkLockButton--tooltip-unlock" title="The “tooltip-unlock” property"><span class="type">“tooltip-unlock”</span></a> and
<a class="link" href="GtkLockButton.html#GtkLockButton--tooltip-not-authorized" title="The “tooltip-not-authorized” property"><span class="type">“tooltip-not-authorized”</span></a> properties.</p>
</div>
<div class="refsect1">
<a name="GtkLockButton.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-lock-button-new"></a><h3>gtk_lock_button_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_lock_button_new (<em class="parameter"><code><span class="type">GPermission</span> *permission</code></em>);</pre>
<p>Creates a new lock button which reflects the <em class="parameter"><code>permission</code></em>
.</p>
<div class="refsect3">
<a name="gtk-lock-button-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>permission</p></td>
<td class="parameter_description"><p>a <span class="type">GPermission</span>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-lock-button-new.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GtkLockButton.html" title="GtkLockButton"><span class="type">GtkLockButton</span></a></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-lock-button-get-permission"></a><h3>gtk_lock_button_get_permission ()</h3>
<pre class="programlisting"><span class="returnvalue">GPermission</span> *
gtk_lock_button_get_permission (<em class="parameter"><code><a class="link" href="GtkLockButton.html" title="GtkLockButton"><span class="type">GtkLockButton</span></a> *button</code></em>);</pre>
<p>Obtains the <span class="type">GPermission</span> object that controls <em class="parameter"><code>button</code></em>
.</p>
<div class="refsect3">
<a name="gtk-lock-button-get-permission.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkLockButton.html" title="GtkLockButton"><span class="type">GtkLockButton</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-lock-button-get-permission.returns"></a><h4>Returns</h4>
<p>the <span class="type">GPermission</span> of <em class="parameter"><code>button</code></em>
. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-lock-button-set-permission"></a><h3>gtk_lock_button_set_permission ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_lock_button_set_permission (<em class="parameter"><code><a class="link" href="GtkLockButton.html" title="GtkLockButton"><span class="type">GtkLockButton</span></a> *button</code></em>,
<em class="parameter"><code><span class="type">GPermission</span> *permission</code></em>);</pre>
<p>Sets the <span class="type">GPermission</span> object that controls <em class="parameter"><code>button</code></em>
.</p>
<div class="refsect3">
<a name="gtk-lock-button-set-permission.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkLockButton.html" title="GtkLockButton"><span class="type">GtkLockButton</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>permission</p></td>
<td class="parameter_description"><p>a <span class="type">GPermission</span> object, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
</div>
<div class="refsect1">
<a name="GtkLockButton.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkLockButton-struct"></a><h3>struct GtkLockButton</h3>
<pre class="programlisting">struct GtkLockButton;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkLockButtonClass"></a><h3>struct GtkLockButtonClass</h3>
<pre class="programlisting">struct GtkLockButtonClass {
GtkButtonClass parent_class;
};
</pre>
<div class="refsect3">
<a name="GtkLockButtonClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkLockButton.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkLockButton--permission"></a><h3>The <code class="literal">“permission”</code> property</h3>
<pre class="programlisting"> “permission” <span class="type">GPermission</span> *</pre>
<p>The GPermission object controlling this button.</p>
<p>Owner: GtkLockButton</p>
<p>Flags: Read / Write</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkLockButton--text-lock"></a><h3>The <code class="literal">“text-lock”</code> property</h3>
<pre class="programlisting"> “text-lock” <span class="type">char</span> *</pre>
<p>The text to display when prompting the user to lock.</p>
<p>Owner: GtkLockButton</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: "Lock"</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkLockButton--text-unlock"></a><h3>The <code class="literal">“text-unlock”</code> property</h3>
<pre class="programlisting"> “text-unlock” <span class="type">char</span> *</pre>
<p>The text to display when prompting the user to unlock.</p>
<p>Owner: GtkLockButton</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: "Unlock"</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkLockButton--tooltip-lock"></a><h3>The <code class="literal">“tooltip-lock”</code> property</h3>
<pre class="programlisting"> “tooltip-lock” <span class="type">char</span> *</pre>
<p>The tooltip to display when prompting the user to lock.</p>
<p>Owner: GtkLockButton</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: "Dialog is unlocked.\nClick to prevent further changes"</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkLockButton--tooltip-not-authorized"></a><h3>The <code class="literal">“tooltip-not-authorized”</code> property</h3>
<pre class="programlisting"> “tooltip-not-authorized” <span class="type">char</span> *</pre>
<p>The tooltip to display when prompting the user cannot obtain authorization.</p>
<p>Owner: GtkLockButton</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: "System policy prevents changes.\nContact your system administrator"</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkLockButton--tooltip-unlock"></a><h3>The <code class="literal">“tooltip-unlock”</code> property</h3>
<pre class="programlisting"> “tooltip-unlock” <span class="type">char</span> *</pre>
<p>The tooltip to display when prompting the user to unlock.</p>
<p>Owner: GtkLockButton</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: "Dialog is locked.\nClick to make changes"</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>