Home · Modules · All Classes · All Namespaces
Public Member Functions | List of all members
Tp::PendingCaptchas Class Reference

The PendingCaptchas class represents an asynchronous operation for retrieving a captcha challenge from a connection manager. More...

#include <TelepathyQt/PendingCaptchas>

Inherits Tp::PendingOperation.

Public Member Functions

virtual ~PendingCaptchas ()
 
Captcha captcha () const
 
QList< CaptchacaptchaList () const
 
bool requiresMultipleCaptchas () const
 
- Public Member Functions inherited from Tp::PendingOperation
virtual ~PendingOperation ()
 
bool isFinished () const
 
bool isValid () const
 
bool isError () const
 
QString errorName () const
 
QString errorMessage () const
 

Additional Inherited Members

- Signals inherited from Tp::PendingOperation
void finished (Tp::PendingOperation *operation)
 
- Protected Slots inherited from Tp::PendingOperation
void setFinished ()
 
void setFinishedWithError (const QString &name, const QString &message)
 
void setFinishedWithError (const QDBusError &error)
 
- Protected Member Functions inherited from Tp::PendingOperation
 PendingOperation (const SharedPtr< RefCounted > &object)
 
SharedPtr< RefCountedobject () const
 

Detailed Description

The PendingCaptchas class represents an asynchronous operation for retrieving a captcha challenge from a connection manager.

See Asynchronous Object Model

Constructor & Destructor Documentation

◆ ~PendingCaptchas()

Tp::PendingCaptchas::~PendingCaptchas ( )
virtual

Class destructor.

Member Function Documentation

◆ captcha()

Captcha Tp::PendingCaptchas::captcha ( ) const

Return the main captcha of the request. This captcha is guaranteed to be compatible with any constraint specified in CaptchaAuthentication::requestCaptchas().

This is a convenience method which should be used when requiresMultipleCaptchas() is false - otherwise, you should use captchaList.

The returned Captcha can be answered through CaptchaAuthentication::answer() by using its id.

This method will return a meaningful value only if the operation was completed successfully.

Returns
The main captcha for the pending request.
See also
captchaList() CaptchaAuthentication::requestCaptchas() requiresMultipleCaptchas() CaptchaAuthentication::answer()

◆ captchaList()

QList< Captcha > Tp::PendingCaptchas::captchaList ( ) const

Return all the captchas of the request. These captchas are guaranteed to be compatible with any constraint specified in CaptchaAuthentication::requestCaptchas().

If requiresMultipleCaptchas() is false, you probably want to use the convenience method captcha() instead.

The returned Captchas can be answered through CaptchaAuthentication::answer() by using their ids.

This method will return a meaningful value only if the operation was completed successfully.

Returns
All the captchas for the pending request.
See also
captcha() CaptchaAuthentication::requestCaptchas() requiresMultipleCaptchas() CaptchaAuthentication::answer()

◆ requiresMultipleCaptchas()

bool Tp::PendingCaptchas::requiresMultipleCaptchas ( ) const

Return whether this request requires more than one captcha to be answered or not.

This method should always be checked before answering to find out what the connection manager expects. Depending on the result, you might want to use the result from captcha() if just a single answer is required, or from captchaList() otherwise.

This method will return a meaningful value only if the operation was completed successfully.

Returns
The main captcha for the pending request.
See also
captcha() captchaList()