Polkit-Qt-1
0.95.0
|
Listener is abstract class used for implementing authentication agents. More...
#include <Listener>
Inherits QObject.
Public Slots | |
virtual void | initiateAuthentication (const QString &actionId, const QString &message, const QString &iconName, const PolkitQt1::Details &details, const QString &cookie, const PolkitQt1::Identity::List &identities, AsyncResult *result)=0 |
Initiate authentication for the action. More... | |
virtual bool | initiateAuthenticationFinish ()=0 |
Finishes an authentication request from the polkit daemon. More... | |
virtual void | cancelAuthentication ()=0 |
Cancels an authentication request from the polkit daemon. More... | |
Public Member Functions | |
Listener (QObject *parent=0) | |
Constructor of Listener class. | |
Listener (PolkitAgentListener *listener, QObject *parent=0) | |
Constructor of Listener class from PolkitAgentListener. More... | |
bool | registerListener (const PolkitQt1::Subject &subject, const QString &objectPath) |
Registers listener with polkit daemon as an authentication agent for subject . More... | |
const PolkitAgentListener * | listener () |
Returns pointer to the PolkitAgentListener. More... | |
Listener is abstract class used for implementing authentication agents.
To implement an authentication agent, just subclass this class and implement virtual functions initiateAuthentication, initiateAuthenticationFinish and cancelAuthentication.
You can also use Session class to authenticate users however it isn't required.
|
explicit |
Constructor of Listener class from PolkitAgentListener.
listener | Pointer to the PolkitAgentListener |
parent |
|
pure virtualslot |
Cancels an authentication request from the polkit daemon.
TODO: Is this method really required ?
|
pure virtualslot |
Initiate authentication for the action.
This method will be called on a registered authentication agent when the user owning the session needs to prove he is one of the identities listed in identities
.
actionId | The action to authenticate for |
message | The message to present to the user |
iconName | The name of the icon which is representing the action |
details | Details describing the action |
cookie | The cookie for the authentization request |
identities | A list of Identity object that the user can choose to authenticate as |
result | This AsyncResult MUST be completed by using complete() method when the authentication is done. You can pass it to the constructor of the Session class and then call session->result()->complete() to mark the action as done. |
|
pure virtualslot |
Finishes an authentication request from the polkit daemon.
TODO: Is this method really required ?
const PolkitAgentListener * PolkitQt1::Agent::Listener::listener | ( | ) |
Returns pointer to the PolkitAgentListener.
bool PolkitQt1::Agent::Listener::registerListener | ( | const PolkitQt1::Subject & | subject, |
const QString & | objectPath | ||
) |
Registers listener with polkit daemon as an authentication agent for subject
.
This is implemented by registering a DBus object at objectPath
on the unique name assigned by the system message bus.
Whenever the polkit daemon needs to authenticate a processes that is related to subject
, the methods initiateAuthentication and initiateAuthenticationFinish will be evoked.
subject | Subject that listener will be registered for |
objectPath | DBus object path |
True
if the polkitqt1-agent-listener.has been registered, False
otherwise