diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/protocols/oscar/liboscar/logintask.h | |
download | tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/oscar/liboscar/logintask.h')
-rw-r--r-- | kopete/protocols/oscar/liboscar/logintask.h | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/kopete/protocols/oscar/liboscar/logintask.h b/kopete/protocols/oscar/liboscar/logintask.h new file mode 100644 index 00000000..12061821 --- /dev/null +++ b/kopete/protocols/oscar/liboscar/logintask.h @@ -0,0 +1,144 @@ +/* + Kopete Oscar Protocol + logintask.h - Handles logging into to the AIM or ICQ service + + Copyright (c) 2004 Matt Rogers <[email protected]> + + Kopete (c) 2002-2004 by the Kopete developers <[email protected]> + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#ifndef _OSCAR_LOGINTASK_H_ +#define _OSCAR_LOGINTASK_H_ + +#include <qcstring.h> +#include "oscartypes.h" +#include "task.h" + +#include "aimlogintask.h" +#include "icqlogintask.h" +#include "closeconnectiontask.h" + +using namespace Oscar; + +class QString; +class Transfer; + + +/** + * \short Handle OSCAR login - stage 1 + * + * OSCAR login is divided into two stages. The first stage handles the connection negotiation + * so that we can get a BOS server to connect to and start stage two of the login process + * This class handles the first stage of the OSCAR login process + * For more info about the OSCAR login process, visit http://iserverd1.khstu.ru/oscar + */ +class StageOneLoginTask : public Task +{ +Q_OBJECT +public: + StageOneLoginTask( Task* parent ); + ~StageOneLoginTask(); + bool take( Transfer* transfer ); + + //Protocol specific stuff + + //! Get the BOS cookie + const QByteArray& loginCookie() const; + + //! Get the BOS server + const QString& bosServer() const; + + //! Get the BOS port + const QString& bosPort() const; + + //! Get the error code, if there is one + int errorCode() const; + + //! Get the error reason so it can be displayed + const QString& errorReason() const; + + +public slots: + void closeTaskFinished(); + void aimTaskFinished(); + +protected: + bool forMe( Transfer* transfer ) const; + +private: + + //Tasks we want to control + AimLoginTask* m_aimTask; + IcqLoginTask* m_icqTask; + CloseConnectionTask* m_closeTask; + + //Private data we get from the tasks + QByteArray m_cookie; + QString m_bosServer; + QString m_bosPort; + +}; + +/** + * \short Handle OSCAR Login - stage 2 + * + * Oscar login is divided into two stages. The first stage handles the connection negotiation + * so that we can get a BOS server to connect to for the second stage. This class handles the + * second stage of Oscar login that establishes various things like rate limits, contact lists, + * and SNAC family versions + */ + +class ServerVersionsTask; +class RateInfoTask; + +class StageTwoLoginTask : public Task +{ +Q_OBJECT +public: + StageTwoLoginTask( Task* parent ); + ~StageTwoLoginTask(); + bool take( Transfer* transfer ); + void onGo(); + + //protocol specifics + //! Set the cookie to send to the server + void setCookie( const QByteArray& newCookie ); + + //! Get the cookie to send to the server + const QByteArray& cookie(); + + QString host() const; + QString port() const; + +public slots: + + //! Start the rate info task + void versionTaskFinished(); + + //! The rate info task is finished. Start the other ones + void rateTaskFinished(); + +protected: + bool forMe( Transfer* transfer ) const; + +private: + QByteArray m_cookie; + QString m_host, m_port; + + //tasks + ServerVersionsTask* m_versionTask; + RateInfoTask* m_rateTask; +}; + +#endif + +//kate: tab-width 4; indent-mode csands; |