| Home · All Classes · All Namespaces · Modules · Functions · Files

Public Member Functions
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.

List of all members.

## Public Member Functions

- virtual ~PendingCaptchas ()
- Captcha captcha () const
- QList< Captcha > captchaList () const
- bool requiresMultipleCaptchas () 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

Tp::PendingCaptchas::~PendingCaptchas | ( |  | ) | `[virtual]`

Class destructor.

## Member Function Documentation

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()

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()

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()