kopete/protocols/messenger/libpapillon
logintask.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PAPILLONLOGINTASK_H
00016 #define PAPILLONLOGINTASK_H
00017
00018 #include <Papillon/Task>
00019 #include <Papillon/Macros>
00020
00021 namespace Papillon
00022 {
00023
00024 class NetworkMessage;
00025 class TweenerHandler;
00043 class PAPILLON_EXPORT LoginTask : public Papillon::Task
00044 {
00045 Q_OBJECT
00046 public:
00050 enum LoginState
00051 {
00055 StateVersion,
00059 StateCVR,
00063 StateTweenerInvite,
00067 StateTweenerConfirmed,
00071 StateFinish,
00075 StateError,
00079 StateBadPassword,
00083 StateRedirection
00084 };
00085
00090 explicit LoginTask(Papillon::Task *parent);
00094 virtual ~LoginTask();
00095
00103 virtual bool take(Papillon::NetworkMessage *networkMessage);
00104
00109 LoginState loginState() const;
00110
00111 protected:
00118 virtual bool forMe(Papillon::NetworkMessage *networkMessage) const;
00123 virtual void onGo();
00124
00125 signals:
00130 void redirection(const QString &server, quint16 port);
00131
00132 private slots:
00133 void sendVersionCommand();
00134 void sendCvrCommand();
00135 void sendTweenerInviteCommand();
00136 void sendTweenerConfirmation();
00137 void ticketReceived(TweenerHandler *tweenerHandler);
00138
00139 private:
00144 QString passportId() const;
00149 QString password() const;
00150
00151 private:
00152 class Private;
00153 Private *d;
00154 };
00155
00156 }
00157
00158 #endif