Home · Modules · All Classes · All Namespaces
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface Class Reference

#include <TelepathyQt/Channel>

Inherits Tp::AbstractInterface.

Public Slots

QDBusPendingReply< Tp::CaptchaInfoList, uint, QString > GetCaptchas (int timeout=-1)
 
QDBusPendingReply< QByteArray > GetCaptchaData (uint ID, const QString &mimeType, int timeout=-1)
 
QDBusPendingReply AnswerCaptchas (const Tp::CaptchaAnswers &answers, int timeout=-1)
 
QDBusPendingReply CancelCaptcha (uint reason, const QString &debugMessage, int timeout=-1)
 

Public Member Functions

 ChannelInterfaceCaptchaAuthenticationInterface (const QString &busName, const QString &objectPath, QObject *parent=0)
 
 ChannelInterfaceCaptchaAuthenticationInterface (const QDBusConnection &connection, const QString &busName, const QString &objectPath, QObject *parent=0)
 
 ChannelInterfaceCaptchaAuthenticationInterface (Tp::DBusProxy *proxy)
 
 ChannelInterfaceCaptchaAuthenticationInterface (const Tp::Client::ChannelInterface &mainInterface)
 
 ChannelInterfaceCaptchaAuthenticationInterface (const Tp::Client::ChannelInterface &mainInterface, QObject *parent)
 
Tp::PendingVariantrequestPropertyCanRetryCaptcha () const
 
Tp::PendingVariantrequestPropertyCaptchaStatus () const
 
Tp::PendingVariantrequestPropertyCaptchaError () const
 
Tp::PendingVariantrequestPropertyCaptchaErrorDetails () const
 
Tp::PendingVariantMaprequestAllProperties () const
 
- Public Member Functions inherited from Tp::AbstractInterface
virtual ~AbstractInterface ()
 
bool isValid () const
 
QString invalidationReason () const
 
QString invalidationMessage () const
 
void setMonitorProperties (bool monitorProperties)
 
bool isMonitoringProperties () const
 

Static Public Member Functions

static QLatin1String staticInterfaceName ()
 

Protected Member Functions

virtual void invalidate (Tp::DBusProxy *, const QString &, const QString &)
 
- Protected Member Functions inherited from Tp::AbstractInterface
 AbstractInterface (DBusProxy *proxy, const QLatin1String &interface)
 
 AbstractInterface (const QString &busName, const QString &path, const QLatin1String &interface, const QDBusConnection &connection, QObject *parent)
 
PendingVariantinternalRequestProperty (const QString &name) const
 
PendingOperationinternalSetProperty (const QString &name, const QVariant &newValue)
 
PendingVariantMapinternalRequestAllProperties () const
 

Additional Inherited Members

- Signals inherited from Tp::AbstractInterface
void propertiesChanged (const QVariantMap &changedProperties, const QStringList &invalidatedProperties)
 
- Protected Slots inherited from Tp::AbstractInterface

Detailed Description

Proxy class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1".

Constructor & Destructor Documentation

◆ ChannelInterfaceCaptchaAuthenticationInterface() [1/5]

Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::ChannelInterfaceCaptchaAuthenticationInterface ( const QString &  busName,
const QString &  objectPath,
QObject *  parent = 0 
)

Creates a ChannelInterfaceCaptchaAuthenticationInterface associated with the given object on the session bus.

Parameters
busNameName of the service the object is on.
objectPathPath to the object on the service.
parentPassed to the parent class constructor.

◆ ChannelInterfaceCaptchaAuthenticationInterface() [2/5]

Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::ChannelInterfaceCaptchaAuthenticationInterface ( const QDBusConnection &  connection,
const QString &  busName,
const QString &  objectPath,
QObject *  parent = 0 
)

Creates a ChannelInterfaceCaptchaAuthenticationInterface associated with the given object on the given bus.

Parameters
connectionThe bus via which the object can be reached.
busNameName of the service the object is on.
objectPathPath to the object on the service.
parentPassed to the parent class constructor.

◆ ChannelInterfaceCaptchaAuthenticationInterface() [3/5]

Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::ChannelInterfaceCaptchaAuthenticationInterface ( Tp::DBusProxy proxy)

Creates a ChannelInterfaceCaptchaAuthenticationInterface associated with the same object as the given proxy.

Parameters
proxyThe proxy to use. It will also be the QObject::parent() for this object.

◆ ChannelInterfaceCaptchaAuthenticationInterface() [4/5]

Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::ChannelInterfaceCaptchaAuthenticationInterface ( const Tp::Client::ChannelInterface mainInterface)
explicit

Creates a ChannelInterfaceCaptchaAuthenticationInterface associated with the same object as the given proxy. Additionally, the created proxy will have the same parent as the given proxy.

Parameters
mainInterfaceThe proxy to use.

◆ ChannelInterfaceCaptchaAuthenticationInterface() [5/5]

Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::ChannelInterfaceCaptchaAuthenticationInterface ( const Tp::Client::ChannelInterface mainInterface,
QObject *  parent 
)

Creates a ChannelInterfaceCaptchaAuthenticationInterface associated with the same object as the given proxy. However, a different parent object can be specified.

Parameters
mainInterfaceThe proxy to use.
parentPassed to the parent class constructor.

Member Function Documentation

◆ staticInterfaceName()

static QLatin1String Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::staticInterfaceName ( )
inlinestatic

Returns the name of the interface "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1", which this class represents.

Returns
The D-Bus interface name.

◆ requestPropertyCanRetryCaptcha()

Tp::PendingVariant* Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::requestPropertyCanRetryCaptcha ( ) const
inline

Asynchronous getter for the remote object property CanRetryCaptcha of type bool.

If true, GetCaptchas() can be expected to return new captcha information when in the Local_Pending state. If false, GetCaptchas() will return NotAvailable on subsequent calls.

Refreshing the captcha isn't required to work, although some protocols and implementations allow it. This is usually done in case a given captcha is unintelligible.

Returns
A pending variant which will emit finished when the property has been retrieved.

◆ requestPropertyCaptchaStatus()

Tp::PendingVariant* Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::requestPropertyCaptchaStatus ( ) const
inline

Asynchronous getter for the remote object property CaptchaStatus of type uint.

The current status of this channel.

Because only the Handler should call methods on this interface, the Handler MAY reduce round-trips by not fetching the initial value of this property, and instead assume that is initially Local_Pending.

This assumption normally avoids the need to call GetAll(), since the values of CaptchaError and CaptchaErrorDetails are also implied by this assumption, and the only other property is CanRetryCaptcha , which is immutable.

Returns
A pending variant which will emit finished when the property has been retrieved.

◆ requestPropertyCaptchaError()

Tp::PendingVariant* Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::requestPropertyCaptchaError ( ) const
inline

Asynchronous getter for the remote object property CaptchaError of type QString.

The reason for the CaptchaStatus , or an empty string if the state is neither Try_Again nor Failed.

Typical values: "", Cancelled, AuthenticationFailed, CaptchaNotSupported

In particular, an ordinary authentication failure (as would be produced for an incorrect answer) SHOULD be represented by AuthenticationFailed, cancellation by the user's request SHOULD be represented by Cancelled, cancellation due to the inability to display the captcha to the user or otherwise answer it SHOULD be represented by CaptchaNotSupported, and cancellation by a local process due to inconsistent or invalid challenges from the server SHOULD be represented by ServiceConfused.

If this interface appears on a ChannelTypeServerAuthenticationInterface channel, and connection to the server fails with an authentication failure, this error code SHOULD be copied into the ConnectionInterface::ConnectionError() signal.

Returns
A pending variant which will emit finished when the property has been retrieved.

◆ requestPropertyCaptchaErrorDetails()

Tp::PendingVariant* Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::requestPropertyCaptchaErrorDetails ( ) const
inline

Asynchronous getter for the remote object property CaptchaErrorDetails of type QVariantMap.

If CaptchaError is non-empty, any additional information about the last disconnection; otherwise, the empty map. The keys and values are the same as for the second argument of ConnectionInterface::ConnectionError() .

If this interface appears on a ChannelTypeServerAuthenticationInterface channel, and connection to the server fails with an authentication failure, these details SHOULD be copied into the ConnectionInterface::ConnectionError() signal.

Returns
A pending variant which will emit finished when the property has been retrieved.

◆ requestAllProperties()

Tp::PendingVariantMap* Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::requestAllProperties ( ) const
inline

Request all of the DBus properties on the interface.

Returns
A pending variant map which will emit finished when the properties have been retrieved.

◆ GetCaptchas

QDBusPendingReply<Tp::CaptchaInfoList, uint, QString> Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::GetCaptchas ( int  timeout = -1)
inlineslot

Begins a call to the D-Bus method GetCaptchas on the remote object.

Gets information regarding each of the captcha methods available and which and how many need to be successfully answered

To call this method successfully, the state must be Local_Pending or Try_Again. If it is Local_Pending, it remains Local_Pending. If called more than once while in Local_Pending state, or if the state is Try_Again, this method fetches a new set of captcha challenges, if possible, and the state returns to Local_Pending.

For instance, you could call GetCaptchas again from Local_Pending state if the user indicates that they can't understand the initially-offered captcha.

This is a method, not a property, so that it can be used to fetch more than one set of captcha challenges, and so that change notification is not required. Only the Handler should call this method and calling GetAll would not reduce round-trips, so the usual reasons to prefer a property do not apply here.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters
timeoutThe timeout in milliseconds.
Returns

Information about each of the available captcha methods.

Returns

The number of captcha methods required to be answered in order to successfully complete this captcha challenge (most frequently 1, but XMPP allows servers to demand that more than one captcha is answered).

Returns

The language of each Label in Captcha_Info if available, for instance en_US, or "" if unknown.

◆ GetCaptchaData

QDBusPendingReply<QByteArray> Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::GetCaptchaData ( uint  ID,
const QString &  mimeType,
int  timeout = -1 
)
inlineslot

Begins a call to the D-Bus method GetCaptchaData on the remote object.

Fetch and return the captcha data. In protocols where captchas are downloaded out-of-band (for instance via HTTP), the connection manager is expected to do so.

Returns an empty array if the type was "qa"

If audio-based and image-based captchas are both available, we don't want to waste time downloading the audio until/unless the user asks to hear it. The extra D-Bus round-trips are not a problem, since they are expected to be quick compared with the time taken for the user to solve the captcha.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters
ID
The ID of the captcha of which to retrieve data.
mimeType
MIME type picked by the Handler, chosen from the list of MIME types 
received in GetCaptchas. XEP-0158 allows the same captcha to be 
made available in multiple formats, for instance the same spoken 
question as audio/x-wav, application/ogg and audio/speex.
timeoutThe timeout in milliseconds.
Returns
Captcha data as requested.

◆ AnswerCaptchas

QDBusPendingReply Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::AnswerCaptchas ( const Tp::CaptchaAnswers answers,
int  timeout = -1 
)
inlineslot

Begins a call to the D-Bus method AnswerCaptchas on the remote object.

Answer as many captchas as desired and/or required.

Callable in state Local_Pending only. State changes to Remote_Pending.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters
answers
The mapping of captcha IDs to answer strings.
timeoutThe timeout in milliseconds.

◆ CancelCaptcha

QDBusPendingReply Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::CancelCaptcha ( uint  reason,
const QString &  debugMessage,
int  timeout = -1 
)
inlineslot

Begins a call to the D-Bus method CancelCaptcha on the remote object.

Cancel. State changes to Failed with error NotAvailable or Cancelled if it isn't already Failed. All you can do now is to close the channel.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters
reason
Reason for cancelling. This MAY be used to choose an error response 
to the remote server, and SHOULD also be reflected in the 
CaptchaError.
debugMessage
A textual description of the reason for cancelling, supplied by the 
Handler. This message SHOULD NOT be sent to the remote server, but 
SHOULD be copied into the &apos;debug-message&apos; field of the 
CaptchaErrorDetails and ConnectionError.
timeoutThe timeout in milliseconds.

◆ invalidate()

void Tp::Client::ChannelInterfaceCaptchaAuthenticationInterface::invalidate ( Tp::DBusProxy proxy,
const QString &  error,
const QString &  message 
)
protectedvirtual

Reimplemented from Tp::AbstractInterface.