Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / wlm / wlmchatsession.h
blobe4b91776c7ef6420dbcb56d2dfed167d2aa9a799
1 /*
2 wlmchatsession.h - Wlm Message Manager
4 Copyright (c) 2008 by Tiago Salem Herrmann <tiagosh@gmail.com>
5 Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 *************************************************************************
17 #ifndef WLMCHATSESSION_H
18 #define WLMCHATSESSION_H
20 #include <QLinkedList>
21 #include <QMap>
22 #include <QTimer>
24 #include <kaction.h>
25 #include <kactionmenu.h>
26 #include <KMenu>
28 #include "kopetechatsession.h"
29 #include <msn/msn.h>
31 class WlmContact;
33 class WlmChatSession: public Kopete::ChatSession
35 Q_OBJECT
36 public:
37 WlmChatSession (Kopete::Protocol * protocol, const Kopete::Contact * user,
38 Kopete::ContactPtrList others,
39 MSN::SwitchboardServerConnection * conn = NULL);
40 ~WlmChatSession ();
41 void setReady (bool value);
42 bool isReady ();
43 void setChatService (MSN::SwitchboardServerConnection * conn);
44 bool isConnecting();
45 MSN::SwitchboardServerConnection * getChatService ()
47 return m_chatService;
49 void messageSentACK (unsigned int trID);
50 bool requestChatService ();
51 void requestDisplayPicture ();
52 void
53 setDownloadDisplayPicture (bool a)
55 m_downloadDisplayPicture = a;
57 bool
58 isDownloadDisplayPicture ()
60 return m_downloadDisplayPicture;
62 void
63 setSendNudge (bool a)
65 m_sendNudge = a;
67 bool
68 isSendNudge ()
70 return m_sendNudge;
72 void receivedNudge (QString passport);
73 void sendFile (const QString & fileLocation, long unsigned int fileSize);
74 virtual void inviteContact (const QString &);
75 void startSendKeepAlive();
76 void stopSendKeepAlive();
77 unsigned int generateSessionID();
79 private slots:
80 void slotMessageSent (Kopete::Message & message, Kopete::ChatSession * kmm);
81 void sendTypingMsg (bool istyping);
82 void sendNudge ();
83 void switchboardConnectionTimeout ();
84 void slotActionInviteAboutToShow ();
85 void slotInviteContact (Kopete::Contact * contact);
86 void slotSendFile ();
87 void sendKeepAlive ();
89 private:
91 MSN::SwitchboardServerConnection * m_chatService;
92 bool m_downloadDisplayPicture;
93 bool m_sendNudge;
94 int m_tries;
95 int m_oimid;
96 int m_sessionID;
97 QString m_lastMsnObj;
98 QLinkedList < Kopete::Message > m_messagesQueue;
99 QMap < unsigned int, Kopete::Message > m_messagesSentQueue;
100 QLinkedList < QString > m_pendingInvitations;
101 QLinkedList < QString > m_pendingFiles;
102 KAction * m_actionNudge;
103 KActionMenu * m_actionInvite;
104 QList < KAction* > m_inviteactions;
105 QTimer * m_keepalivetimer;
108 #endif
110 // vim: set noet ts=4 sts=4 tw=4: