diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-05 17:53:16 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-05 17:53:16 +0000 |
commit | 6f82532777a35e0e60bbd2b290b2e93e646f349b (patch) | |
tree | c6fb1bacc747fc79e3655ce41063b1854da8a053 /kopete/protocols/yahoo/libkyahoo/yahoochattask.h | |
parent | 5527e01e0675fbb06b632ccdae423756fbff622b (diff) | |
download | tdenetwork-6f82532777a35e0e60bbd2b290b2e93e646f349b.tar.gz tdenetwork-6f82532777a35e0e60bbd2b290b2e93e646f349b.zip |
Added missing files from prior Yahoo protocol patch
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1146319 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/yahoo/libkyahoo/yahoochattask.h')
-rw-r--r-- | kopete/protocols/yahoo/libkyahoo/yahoochattask.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/kopete/protocols/yahoo/libkyahoo/yahoochattask.h b/kopete/protocols/yahoo/libkyahoo/yahoochattask.h new file mode 100644 index 00000000..310b174d --- /dev/null +++ b/kopete/protocols/yahoo/libkyahoo/yahoochattask.h @@ -0,0 +1,87 @@ +/* + Kopete Yahoo Protocol + yahoochattask.h - Handle Yahoo Chat + + Copyright (c) 2006 André Duffeck <duffeck@kde.org> + Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org> + + ************************************************************************* + * * + * 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 YAHOOCHATTASK_H +#define YAHOOCHATTASK_H + +#include "task.h" +#include "yahootypes.h" +#include <qmap.h> +#include <qvaluelist.h> +#include <qpair.h> + +class QDomDocument; +class YMSGTransfer; +namespace KIO { + class Job; +} + +struct YahooChatJob { + QByteArray data; + Yahoo::ChatCategory category; +}; + +/** +@author André Duffeck +*/ +class YahooChatTask : public Task +{ +Q_OBJECT +public: + YahooChatTask(Task *parent); + virtual ~YahooChatTask(); + + virtual void onGo(); + virtual bool forMe( const Transfer *transfer ) const; + bool take(Transfer *transfer); + + void getYahooChatCategories(); + void getYahooChatRooms( const Yahoo::ChatCategory &category ); + + void joinRoom( const Yahoo::ChatRoom &room ); + + void sendYahooChatMessage( const QString &msg, const QString &handle ); + + void logout(); + +signals: + void gotYahooChatCategories( const QDomDocument & ); + void gotYahooChatRooms( const Yahoo::ChatCategory &, const QDomDocument & ); + + void chatRoomJoined( int roomId, int categoryId, const QString &comment, const QString &handle ); + void chatBuddyHasJoined( const QString &nick, const QString &handle, bool suppressNotification ); + void chatBuddyHasLeft( const QString &nick, const QString &handle ); + void chatMessageReceived( const QString &nick, const QString &message, const QString &handle ); +private: + void login(); + void parseLoginResponse( YMSGTransfer *t ); + void parseJoin( YMSGTransfer *t ); + void parseChatMessage( YMSGTransfer * ); + void parseChatExit( YMSGTransfer * ); + void parseLogout( YMSGTransfer * ); + +private slots: + void slotData( KIO::Job *, const QByteArray & ); + void slotCategoriesComplete( KIO::Job * ); + void slotChatRoomsComplete( KIO::Job * ); +private: + QMap< KIO::Job *, YahooChatJob > m_jobs; + QValueList< Yahoo::ChatRoom > m_pendingJoins; + bool m_loggedIn; +}; + +#endif |