Home · All Classes · All Namespaces · Modules · Functions · Files
captcha-authentication.h
1 
23 #ifndef _TelepathyQt_captcha_authentication_h_HEADER_GUARD_
24 #define _TelepathyQt_captcha_authentication_h_HEADER_GUARD_
25 
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29 
30 #include <TelepathyQt/Channel>
31 #include <TelepathyQt/Connection>
32 
33 #include <TelepathyQt/Global>
34 #include <TelepathyQt/SharedPtr>
35 
36 namespace Tp
37 {
38 
39 class PendingCaptchaAnswer;
40 class PendingCaptchaCancel;
41 class PendingCaptchas;
42 
43 class TP_QT_EXPORT CaptchaAuthentication : public Tp::Object
44 {
45  Q_OBJECT
46  Q_DISABLE_COPY(CaptchaAuthentication)
47 
48 public:
50  NoChallenge = 0,
51  OCRChallenge = 1,
52  AudioRecognitionChallenge = 2,
53  PictureQuestionChallenge = 4,
54  PictureRecognitionChallenge = 8,
55  TextQuestionChallenge = 16,
56  SpeechQuestionChallenge = 32,
57  SpeechRecognitionChallenge = 64,
58  VideoQuestionChallenge = 128,
59  VideoRecognitionChallenge = 256,
60  UnknownChallenge = 32768
61  };
62  Q_DECLARE_FLAGS(ChallengeTypes, ChallengeType)
63 
64  virtual ~CaptchaAuthentication();
65 
66  ChannelPtr channel() const;
67 
68  bool canRetry() const;
69  Tp::CaptchaStatus status() const;
70 
71  QString error() const;
72  Connection::ErrorDetails errorDetails() const;
73 
74  Tp::PendingCaptchas *requestCaptchas(const QStringList &preferredMimeTypes = QStringList(),
75  ChallengeTypes preferredTypes = ~ChallengeTypes(NoChallenge));
76  Tp::PendingOperation *answer(uint id, const QString &answer);
77  Tp::PendingOperation *answer(const Tp::CaptchaAnswers &response);
78 
79 Q_SIGNALS:
80  void statusChanged(Tp::CaptchaStatus status);
81 
82 public Q_SLOTS:
83  Tp::PendingOperation *cancel(Tp::CaptchaCancelReason reason,
84  const QString &message = QString());
85 
86 private Q_SLOTS:
87  TP_QT_NO_EXPORT void onPropertiesChanged(const QVariantMap &changedProperties,
88  const QStringList &invalidatedProperties);
89 
90 private:
91  TP_QT_NO_EXPORT CaptchaAuthentication(const ChannelPtr &parent);
92 
94 
95  struct Private;
96  friend struct Private;
97  Private *mPriv;
98 };
99 
100 } // namespace Tp
101 
102 Q_DECLARE_OPERATORS_FOR_FLAGS(Tp::CaptchaAuthentication::ChallengeTypes)
103 
104 #endif
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
CaptchaCancelReason
Definition: build/TelepathyQt/_gen/constants.h:2985
CaptchaStatus
Definition: build/TelepathyQt/_gen/constants.h:3025
The ServerAuthenticationChannel class is a base class for all ServerAuthentication types...
Definition: server-authentication-channel.h:35
The PendingCaptchas class represents an asynchronous operation for retrieving a captcha challenge fro...
Definition: pending-captchas.h:41
The CaptchaAuthentication class exposes CaptchaAuthentication&#39;s features for channels implementing it...
Definition: captcha-authentication.h:43
ChallengeType
Definition: captcha-authentication.h:49
The Connection class represents a Telepathy connection.
Definition: connection.h:61
Definition: build/TelepathyQt/_gen/types.h:577
Definition: abstract-adaptor.cpp:31
The Object class provides an object with property notification.
Definition: object.h:39


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.7