Polkit-Qt-1  0.95.0
Signals | Public Member Functions
PolkitQt1::Agent::Session Class Reference

#include <Session>

Inherits QObject.

Signals

void completed (bool gainedAuthorization)
 
void request (const QString &request, bool echo)
 
void showError (const QString &text)
 
void showInfo (const QString &text)
 

Public Member Functions

 Session (const PolkitQt1::Identity &identity, const QString &cookie, AsyncResult *result=0, QObject *parent=0)
 
 Session (PolkitAgentSession *pkAgentSession, QObject *parent=0)
 
 ~Session ()
 
void initiate ()
 
void setResponse (const QString &response)
 
void cancel ()
 
AsyncResult * result ()
 

Detailed Description

Author
Radek Novacek rnova.nosp@m.cek@.nosp@m.redha.nosp@m.t.co.nosp@m.m

This class is interface for interacting with native authentication system for obtaining authorizations.

Constructor & Destructor Documentation

◆ Session() [1/2]

Session::Session ( const PolkitQt1::Identity identity,
const QString &  cookie,
AsyncResult *  result = 0,
QObject *  parent = 0 
)

Create a new authentication session.

Parameters
identityThe identity to authenticate
cookieThe cookie obtained from the PolicyKit daemon
resultResult of the authentication action. Must be finished using complete() method.
parent

◆ Session() [2/2]

Session::Session ( PolkitAgentSession *  pkAgentSession,
QObject *  parent = 0 
)
explicit

Create a new authentication session from PolkitAgentSession object

Warning
Use this only if you are completely aware of what are you doing!
Parameters
pkAgentSessionPolkitAgentSession object
parent

◆ ~Session()

Session::~Session ( )

Destroy authentication session.

Member Function Documentation

◆ cancel()

void Session::cancel ( )

Cancel the authentication session. This will emit the completed() signal.

◆ completed

void PolkitQt1::Agent::Session::completed ( bool  gainedAuthorization)
signal

This signal will be emitted when the authentication polkitqt1-agent-session.has been completed or cancelled.

Parameters
gainedAuthorizationTrue if authorization was successfully obtained.

◆ initiate()

void Session::initiate ( )

Initiate the authentication session.

Use cancel() to cancel the session.

◆ request

void PolkitQt1::Agent::Session::request ( const QString &  request,
bool  echo 
)
signal

This signal will be emitted when user is requested to answer a question.

Parameters
requestThe request to show the user, e.g. "name: " or "password: ".
echoTrue if the response to the request SHOULD be echoed on the screen, False if the response MUST NOT be echoed to the screen.

◆ result()

AsyncResult * Session::result ( )

Get AsyncResult that can be used to finish authentication operation

Returns
AsyncResult object or NULL if it is not set

◆ setResponse()

void Session::setResponse ( const QString &  response)

Method for providing response to requests received via request signal.

Parameters
responseResponse from the user, typically a password

◆ showError

void PolkitQt1::Agent::Session::showError ( const QString &  text)
signal

This signal will be emitted when there is information related to an error condition to be displayed to the user.

Parameters
textAn error string to display to the user.

◆ showInfo

void PolkitQt1::Agent::Session::showInfo ( const QString &  text)
signal

This signal will be emitted when there is information to be displayed to the user.

Parameters
textA string to be displayed to the user.

The documentation for this class was generated from the following files: