2 msnchatsession.h - MSN Message Manager
4 Copyright (c) 2002-2005 by Olivier Goffart <ogoffart@kde.org>
6 Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 *************************************************************************
18 #ifndef MSNCHATSESSION_H
19 #define MSNCHATSESSION_H
21 #include "kopetechatsession.h"
26 class MSNSwitchBoardSocket
;
35 * @author Olivier Goffart
37 class KOPETE_MSN_SHARED_EXPORT MSNChatSession
: public Kopete::ChatSession
42 MSNChatSession( Kopete::Protocol
*protocol
, const Kopete::Contact
*user
, Kopete::ContactPtrList others
);
45 void createChat( const QString
&handle
, const QString
&address
, const QString
&auth
, const QString
&ID
= QString() );
47 MSNSwitchBoardSocket
*service() { return m_chatService
; }
49 void sendFile( const QString
&fileLocation
, const QString
&fileName
,
50 long unsigned int fileSize
);
53 * append an invitation in the invitation map, and send the first invitation message
55 void initInvitation(MSNInvitation
* invitation
);
57 virtual void inviteContact(const QString
& );
60 void slotCloseSession();
61 void slotInviteOtherContact();
63 void invitationDone( MSNInvitation
* );
65 void slotRequestPicture();
68 * this is a reimplementation of ChatSesstion slot.
69 * the original slot is not virtual, but that's not a problem because it's a slot.
71 virtual void receivedTypingMsg( const QString
&, bool );
73 void slotConnectionTimeout();
76 void slotMessageSent( Kopete::Message
&message
, Kopete::ChatSession
*kmm
);
77 void slotMessageReceived( Kopete::Message
&message
);
79 void slotUserJoined( const QString
&handle
, const QString
&publicName
, bool IRO
);
80 void slotUserLeft( const QString
&handle
, const QString
&reason
);
81 void slotSwitchBoardClosed();
82 void slotInviteContact( Kopete::Contact
*contact
);
83 void slotAcknowledgement( unsigned int id
, bool ack
);
84 void slotInvitation( const QString
&handle
, const QString
&msg
);
86 void slotActionInviteAboutToShow();
88 void slotDisplayPictureChanged();
93 void slotDebugRawCommand();
96 void slotWebcamReceive();
97 void slotWebcamSend();
100 void slotNudgeReceived(const QString
& handle
);
104 MSNSwitchBoardSocket
*m_chatService
;
106 KActionMenu
*m_actionInvite
;
107 QList
<KAction
*> m_inviteactions
;
108 KAction
*m_actionNudge
;
109 KAction
*m_actionWebcamReceive
;
110 KAction
*m_actionWebcamSend
;
112 //Messages sent before the ending of the connection are queued
113 QList
<Kopete::Message
> m_messagesQueue
;
114 void sendMessageQueue();
115 void cleanMessageQueue( const QString
&reason
);
116 void startChatSession();
118 QMap
<unsigned int, Kopete::Message
> m_messagesSent
;
120 QMap
<long unsigned int, MSNInvitation
*> m_invitations
;
124 * weither or not the "has opened a new chat" message need to be sent if the user is typing
129 QTimer
*m_timeoutTimer
;
130 uint m_connectionTry
;
135 * This signal is relayed to the protocol and after, to plugins
137 void invitation(MSNInvitation
*& invitation
, const QString
&bodyMSG
, unsigned long int cookie
, MSNChatSession
* msnMM
, MSNContact
* c
);
140 #endif // MSNCHATSESSION_H
142 // vim: set noet ts=4 sts=4 tw=4: