<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>KAuth.Action</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link rel="stylesheet" type="text/css" href="../common/doxygen.css" /> <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" /> </head> <body> <div id="container"> <div id="header"> <div id="header_top"> <div> <div> <img alt ="" src="../common/top-kde.jpg"/> KDE 4.9 PyKDE API Reference </div> </div> </div> <div id="header_bottom"> <div id="location"> <ul> <li>KDE's Python API</li> </ul> </div> <div id="menu"> <ul> <li><a href="../modules.html">Overview</a></li> <li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li> <li><a href="http://kde.org/family/">Sitemap</a></li> <li><a href="http://kde.org/contact/">Contact Us</a></li> </ul> </div> </div> </div> <div id="body_wrapper"> <div id="body"> <div id="right"> <div class="content"> <div id="main"> <div class="clearer"> </div> <h1>Action Class Reference</h1> <code>from PyKDE4.kdecore import *</code> <p> Namespace: <a href="../kdecore/KAuth.html">KAuth</a><br /> <h2>Detailed Description</h2> <p>Class to access, authorize and execute actions. </p> <p> This is the main class of the kauth API. It provides the interface to manipulate actions. Every action is identified by its name. Every instance of the Action class with the same name refers to the same action. </p> <p> Once you have an action object you can tell the helper to execute it (asking the user to authenticate if needed) with one of the execute*() methods. The simplest thing to do is to execute a single action synchronously blocking for the reply, using the execute() method. </p> <p> For asynchronous calls, use the executeAsync() method. It sends the request to the helper and returns immediately. You can optionally provide an object and a slot. This will be connected to the actionPerformed() signal of the action's ActionWatcher object. By calling the watcher() method, you obtain an object that emits some useful signals that you can receive while the action is in progress. Those signals are emitted also with the synchronous calls. To execute a bunch of actions with a single call, you can use the executeActions() static method. This is not the same as calling executeAsync() for each action, because the actions are execute with a single request to the helper. To use any of the execute*() methods you have to set the default helper's ID using the setHelperID() static method. Alternatively, you can specify the helperID using the overloaded version of the methods that takes it as a parameter. </p> <p> Each action object contains a QVariantMap object that is passed directly to the helper when the action is executed. You can access this map using the arguments() method. You can insert into it any kind of custom data you need to pass to the helper. </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.4 </dd></dl> </p> <table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#AuthStatus">AuthStatus</a> </td><td class="memItemRight" valign="bottom">{ Denied, Error, Invalid, Authorized, AuthRequired, UserCancelled }</td></tr> <tr><td colspan="2"><br><h2>Methods</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Action">__init__</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Action">__init__</a> (self, <a href="../kdecore/KAuth.Action.html">KAuth.Action</a> action)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Action">__init__</a> (self, QString name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Action">__init__</a> (self, QString name, QString details)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#addArgument">addArgument</a> (self, QString key, QVariant value)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">{QString:QVariant} </td><td class="memItemRight" valign="bottom"><a class="el" href="#arguments">arguments</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.Action.html#AuthStatus">KAuth.Action.AuthStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#authorize">authorize</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="#details">details</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.Action.html#AuthStatus">KAuth.Action.AuthStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#earlyAuthorize">earlyAuthorize</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.ActionReply.html">KAuth.ActionReply</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#execute">execute</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.ActionReply.html">KAuth.ActionReply</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#execute">execute</a> (self, QString helperID)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#executesAsync">executesAsync</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#hasHelper">hasHelper</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="#helperID">helperID</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isValid">isValid</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="#name">name</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#operator !=">operator !=</a> (self, <a href="../kdecore/KAuth.Action.html">KAuth.Action</a> action)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#operator ==">operator ==</a> (self, <a href="../kdecore/KAuth.Action.html">KAuth.Action</a> action)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">QWidget </td><td class="memItemRight" valign="bottom"><a class="el" href="#parentWidget">parentWidget</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setArguments">setArguments</a> (self, {QString:QVariant} arguments)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setDetails">setDetails</a> (self, QString details)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setExecutesAsync">setExecutesAsync</a> (self, bool async)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setHelperID">setHelperID</a> (self, QString id)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setName">setName</a> (self, QString name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setParentWidget">setParentWidget</a> (self, QWidget parent)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.Action.html#AuthStatus">KAuth.Action.AuthStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#status">status</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#stop">stop</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#stop">stop</a> (self, QString helperID)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KAuth.ActionWatcher.html">KAuth.ActionWatcher</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#watcher">watcher</a> (self)</td></tr> <tr><td colspan="2"><br><h2>Static Methods</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#executeActions">executeActions</a> ([<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] actions, [<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] deniedActions, QString helperId)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#executeActions">executeActions</a> ([<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] actions, [<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] deniedActions, QString helperId, QWidget parent)</td></tr> </table> <hr><h2>Method Documentation</h2><a class="anchor" name="Action"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Default constructor </p> <p> This constructor sets the name to the empty string. Such an action is invalid and cannot be authorized nor executed, so you need to call setName() before you can use the object. </p></div></div><a class="anchor" name="Action"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> </td> <td class="paramname"><em>action</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Copy constructor </p></div></div><a class="anchor" name="Action"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>This creates a new action object with this name </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>name</em> </td><td> The name of the new action </td></tr> </table></dl> <p> </p></div></div><a class="anchor" name="Action"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>details</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>This creates a new action object with this name and details </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>name</em> </td><td> The name of the new action <tr><td></td><td valign="top"><em>details</em> </td><td> The details of the action </td></tr> </table></dl> <p> <dl class="see" compact><dt><b>See also:</b></dt><dd> setDetails </dd></dl> </p></div></div><a class="anchor" name="addArgument"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> addArgument</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>key</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">QVariant </td> <td class="paramname"><em>value</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Convenience method to add an argument. </p> <p> This method adds the pair key/value to the QVariantMap used to send custom data to the helper. </p> <p> Use this method if you don't want to create a new QVariantMap only to add a new entry. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>key</em> </td><td> The new entry's key <tr><td></td><td valign="top"><em>value</em> </td><td> The value of the new entry </td></tr> </table></dl> <p> </p></div></div><a class="anchor" name="arguments"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">{QString:QVariant} arguments</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns map object used to pass arguments to the helper. </p> <p> This method returns the variant map that the application can use to pass arbitrary data to the helper when executing the action. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The arguments map that will be passed to the helper. </dd></dl> </p></div></div><a class="anchor" name="authorize"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../kdecore/KAuth.Action.html#AuthStatus">KAuth.Action.AuthStatus</a> authorize</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Acquires authorization for an action without excuting it. </p> <p> <dl class="note" compact><dt><b>Note:</b></dt><dd> Please use this method if you really know what you are doing. If you are implementing a GUI, you probably should look into earlyAuthorize instead. </dd></dl> </p> <p> <dl class="note" compact><dt><b>Note:</b></dt><dd> Please remember that calling this method is not required for a successful action execution: it is safe and advised to call execute() only, without a previous call to authorize or earlyAuthorize. </dd></dl> </p> <p> This method acquires the authorization rights for the action, asking the user to authenticate if needed. It tries very hard to resolve a possible challenge (AuthRequired); for this reason, it is meant only for advanced usages. If you are unsure, always use earlyAuthorize or execute the action directly. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The result of the authorization process </dd></dl> </p> <p> <dl class="see" compact><dt><b>See also:</b></dt><dd> earlyAuthorize </dd></dl> </p></div></div><a class="anchor" name="details"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">QString details</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Gets the action's details </p> <p> The details that will be shown in the authorization dialog, if the backend supports it. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The action's details </dd></dl> </p></div></div><a class="anchor" name="earlyAuthorize"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../kdecore/KAuth.Action.html#AuthStatus">KAuth.Action.AuthStatus</a> earlyAuthorize</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Tries to resolve authorization status in the best possible way without executing the action </p> <p> This method checks for the status of the action, and tries to acquire authorization (if needed) if the backend being used supports client-side authorization. </p> <p> This means this method is not reliable - its purpose is to provide user interfaces with an efficient means to acquire authorization as early as possible, without interrupting the user's workflow. If the backend's authentication phase happens in the helper and the action requires authentication, Authorized will be returned. </p> <p> The main difference with authorize is that this method does not try to acquire authorization if the backend's authentication phase happens in the helper: using authorize in such a case might lead to ask the user its password twice, as the helper might time out, or in the case of a one shot authorization, the scope of the authorization would end with the authorization check itself. For this reason, you should <b>always</b> use this method instead of authorize, which is meant only for very advanced usages. </p> <p> This method is always safe to be called and used before an execution, even if not needed. </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.5 </dd></dl> </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The result of the early authorization process, with the caveats described above. </dd></dl> </p></div></div><a class="anchor" name="execute"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../kdecore/KAuth.ActionReply.html">KAuth.ActionReply</a> execute</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Synchronously executes the action with a specific helperID </p> <p> This method does the exact same thing as execute(), but it takes a specific helperID, useful if you don't want to use the default one without changing it with setHelperID() </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>helperID</em> </td><td> The helper ID to use for the execution of this action </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The reply from the helper, or an error if something's wrong. </dd></dl> </p></div></div><a class="anchor" name="execute"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../kdecore/KAuth.ActionReply.html">KAuth.ActionReply</a> execute</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>helperID</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Synchronously executes the action with a specific helperID </p> <p> This method does the exact same thing as execute(), but it takes a specific helperID, useful if you don't want to use the default one without changing it with setHelperID() </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>helperID</em> </td><td> The helper ID to use for the execution of this action </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The reply from the helper, or an error if something's wrong. </dd></dl> </p></div></div><a class="anchor" name="executesAsync"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool executesAsync</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"></div></div><a class="anchor" name="hasHelper"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool hasHelper</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Checks if the action has an helper </p> <p> This function can be used to check if an helper will be called upon the execution of an action. Such an helper can be set through setHelperID. If this function returns false, upon execution the action will be just authorized. </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.5 </dd></dl> </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> Whether the action has an helper or not </dd></dl> </p> <p> <dl class="see" compact><dt><b>See also:</b></dt><dd> setHelperID </dd></dl> </p></div></div><a class="anchor" name="helperID"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">QString helperID</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Gets the default helper ID used for actions execution </p> <p> The helper ID is the string that uniquely identifies the helper in the system. It is the string passed to the KDE4_AUTH_HELPER() macro in the helper source. Because one could have different helpers, you need to specify an helper ID for each execution, or set a default ID by calling setHelperID(). This method returns the current default value. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The default helper ID. </dd></dl> </p></div></div><a class="anchor" name="isValid"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool isValid</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns if the object represents a valid action </p> <p> Action names have to respect a simple syntax. They have to be all in lowercase characters, separated by dots. Dots can't appear at the beginning and at the end of the name. </p> <p> In other words, the action name has to match this perl-like regular expression: @verbatim /^[a-z]+(\.[a-z]+)*$/ @endverbatim </p> <p> This method returns false if the action name doesn't match the valid syntax. </p> <p> If the backend supports it, this method also checks if the action is valid and recognized by the backend itself. </p> <p> Invalid actions cannot be authorized nor executed. The empty string is not a valid action name, so the default constructor returns an invalid action. </p></div></div><a class="anchor" name="name"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">QString name</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Gets the action's name. </p> <p> This is the unique attribute that identifies an action object. Two action objects with the same name always refer to the same action. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The action name </dd></dl> </p></div></div><a class="anchor" name="operator !="></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool operator !=</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> </td> <td class="paramname"><em>action</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Negated comparison operator </p> <p> Returns the negation of operator== </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the two actions are different and not both invalid </dd></dl> </p></div></div><a class="anchor" name="operator =="></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool operator ==</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../kdecore/KAuth.Action.html">KAuth.Action</a> </td> <td class="paramname"><em>action</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Comparison operator </p> <p> This comparison operator compares the <b>names</b> of two actions and returns whether they are the same. It does not care about the arguments stored in the actions. However, if two actions are invalid they'll match as equal, even if the invalid names are different. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the two actions are the same or both invalid </dd></dl> </p></div></div><a class="anchor" name="parentWidget"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">QWidget parentWidget</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns the parent widget for the authentication dialog for this action </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.6 </dd></dl> </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> A QWidget which will is being used as the dialog's parent </dd></dl> </p></div></div><a class="anchor" name="setArguments"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setArguments</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">{QString:QVariant} </td> <td class="paramname"><em>arguments</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets the map object used to pass arguments to the helper. </p> <p> This method sets the variant map that the application can use to pass arbitrary data to the helper when executing the action. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>arguments</em> </td><td> The new arguments map </td></tr> </table></dl> <p> </p></div></div><a class="anchor" name="setDetails"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setDetails</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>details</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets the action's details </p> <p> You can use this function to provide the user more details (if the backend supports it) on the action being authorized in the authorization dialog </p></div></div><a class="anchor" name="setExecutesAsync"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setExecutesAsync</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>async</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"></div></div><a class="anchor" name="setHelperID"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setHelperID</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>id</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets the default helper ID used for actions execution </p> <p> This method sets the helper ID which contains the body of this action. If the string is non-empty, the corresponding helper will be fired and the action executed inside the helper. Otherwise, the action will be just authorized. </p> <p> <dl class="note" compact><dt><b>Note:</b></dt><dd> To unset a previously set helper, just pass an empty string </dd></dl> </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>id</em> </td><td> The default helper ID. </td></tr> </table></dl> <p> <dl class="see" compact><dt><b>See also:</b></dt><dd> hasHelper </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> helperID </dd></dl> </p></div></div><a class="anchor" name="setName"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setName</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets the action's name. </p> <p> It's not common to change the action name after its creation. Usually you set the name with the constructor (and you have to, because there's no default constructor) </p></div></div><a class="anchor" name="setParentWidget"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setParentWidget</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QWidget </td> <td class="paramname"><em>parent</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets a parent widget for the authentication dialog </p> <p> This function is used for explicitly setting a parent window for an eventual authentication dialog required when authorization is triggered. Some backends, in fact, (like polkit-1) need to have a parent explicitly set for displaying the dialog correctly. </p> <p> <dl class="note" compact><dt><b>Note:</b></dt><dd> If you are using KAuth through one of KDE's GUI components (KPushButton, KCModule...) you do not need and should not call this function, as it is already done by the component itself. </dd></dl> </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.6 </dd></dl> </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>parent</em> </td><td> A QWidget which will be used as the dialog's parent </td></tr> </table></dl> <p> </p></div></div><a class="anchor" name="status"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../kdecore/KAuth.Action.html#AuthStatus">KAuth.Action.AuthStatus</a> status</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Gets information about the authorization status of an action </p> <p> This methods query the authorization backend to know if the user can try to acquire the authorization for this action. If the result is Action.AuthRequired, the user can try to acquire the authorization by authenticating. </p> <p> It should not be needed to call this method directly, because the execution methods already take care of all the authorization stuff. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> Action.Denied if the user doesn't have the authorization to execute the action, </dd></dl> Action.Authorized if the action can be executed, Action.AuthRequired if the user could acquire the authorization after authentication, Action.UserCancelled if the user cancels the authentication dialog. Not currently supported by the Polkit backend </p></div></div><a class="anchor" name="stop"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> stop</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Ask the helper to stop executing an action, using a specific helper ID </p> <p> This method works exactly as the stop() method, but it lets you specify an helper ID different from the default one. </p> <p> To stop an action you need to send the stop request to the helper that is executing that action. This of course means you have to use the same helperID used for the execution call (either passed as a parameter or set as default with setHelperID() ) </p></div></div><a class="anchor" name="stop"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> stop</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>helperID</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Ask the helper to stop executing an action, using a specific helper ID </p> <p> This method works exactly as the stop() method, but it lets you specify an helper ID different from the default one. </p> <p> To stop an action you need to send the stop request to the helper that is executing that action. This of course means you have to use the same helperID used for the execution call (either passed as a parameter or set as default with setHelperID() ) </p></div></div><a class="anchor" name="watcher"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../kdecore/KAuth.ActionWatcher.html">KAuth.ActionWatcher</a> watcher</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Gets the ActionWatcher object for this action </p> <p> ActionWatcher objects are used to get notifications about the action execution status. Every action watcher is tied to an action and every action has a watcher. This means that if you call this method on two different Action objects with the same name, you'll get the same watcher object. </p> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The action watcher for this action </dd></dl> </p></div></div><hr><h2>Static Method Documentation</h2><a class="anchor" name="executeActions"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool executeActions</td> <td>(</td> <td class="paramtype">[<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] </td> <td class="paramname"><em>actions</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">[<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] </td> <td class="paramname"><em>deniedActions</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>helperId</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Convenience overload. This overload lets you specify, in addition, a QWidget which will be used as the authentication dialog's parent. </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.6 </dd></dl> </p> <p> <dl class="see" compact><dt><b>See also:</b></dt><dd> executeActions </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> setParentWidget </dd></dl> </p></div></div><a class="anchor" name="executeActions"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool executeActions</td> <td>(</td> <td class="paramtype">[<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] </td> <td class="paramname"><em>actions</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">[<a href="../kdecore/KAuth.Action.html">KAuth.Action</a>] </td> <td class="paramname"><em>deniedActions</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"><em>helperId</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype">QWidget </td> <td class="paramname"><em>parent</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Convenience overload. This overload lets you specify, in addition, a QWidget which will be used as the authentication dialog's parent. </p> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.6 </dd></dl> </p> <p> <dl class="see" compact><dt><b>See also:</b></dt><dd> executeActions </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> setParentWidget </dd></dl> </p></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="AuthStatus"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr><td class="memname">AuthStatus</td> </tr> </table> </div> <div class="memdoc"><p>The three values returned by authorization methods </p><dl compact><dt><b>Enumerator: </b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>Denied</em> </td><td><tr><td valign="top"><em>Error</em> </td><td><tr><td valign="top"><em>Invalid</em> </td><td><tr><td valign="top"><em>Authorized</em> </td><td><tr><td valign="top"><em>AuthRequired</em> </td><td><tr><td valign="top"><em>UserCancelled</em> </td><td></table> </dl> </div></div><p> </div> </div> </div> <div id="left"> <div class="menu_box"> <div class="nav_list"> <ul> <li><a href="../allclasses.html">Full Index</a></li> </ul> </div> <a name="cp-menu" /><div class="menutitle"><div> <h2 id="cp-menu-project">Modules</h2> </div></div> <div class="nav_list"> <ul><li><a href="../akonadi/index.html">akonadi</a></li> <li><a href="../dnssd/index.html">dnssd</a></li> <li><a href="../kdecore/index.html">kdecore</a></li> <li><a href="../kdeui/index.html">kdeui</a></li> <li><a href="../khtml/index.html">khtml</a></li> <li><a href="../kio/index.html">kio</a></li> <li><a href="../knewstuff/index.html">knewstuff</a></li> <li><a href="../kparts/index.html">kparts</a></li> <li><a href="../kutils/index.html">kutils</a></li> <li><a href="../nepomuk/index.html">nepomuk</a></li> <li><a href="../phonon/index.html">phonon</a></li> <li><a href="../plasma/index.html">plasma</a></li> <li><a href="../polkitqt/index.html">polkitqt</a></li> <li><a href="../solid/index.html">solid</a></li> <li><a href="../soprano/index.html">soprano</a></li> </ul></div></div> </div> </div> <div class="clearer"/> </div> <div id="end_body"></div> </div> <div id="footer"><div id="footer_text"> This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br /> KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div></div> </body> </html>