Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / wlm / wlmchatsession.h
blob2c6a81bdc5de5852c40b91c2666bd6624dc311ed
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();
78 QMap < QString, QString > emoticonsList;
80 private slots:
81 void slotMessageSent (Kopete::Message & message, Kopete::ChatSession * kmm);
82 void sendTypingMsg (bool istyping);
83 void sendNudge ();
84 void switchboardConnectionTimeout ();
85 void slotActionInviteAboutToShow ();
86 void slotInviteContact (Kopete::Contact * contact);
87 void slotSendFile ();
88 void sendKeepAlive ();
90 private:
91 MSN::Message parseMessage(Kopete::Message & msg);
93 MSN::SwitchboardServerConnection * m_chatService;
94 bool m_downloadDisplayPicture;
95 bool m_sendNudge;
96 int m_tries;
97 int m_oimid;
98 int m_sessionID;
99 QString m_lastMsnObj;
100 QLinkedList < Kopete::Message > m_messagesQueue;
101 QMap < unsigned int, Kopete::Message > m_messagesSentQueue;
102 QLinkedList < QString > m_pendingInvitations;
103 QLinkedList < QString > m_pendingFiles;
104 KAction * m_actionNudge;
105 KActionMenu * m_actionInvite;
106 QList < KAction* > m_inviteactions;
107 QTimer * m_keepalivetimer;
110 #endif
112 // vim: set noet ts=4 sts=4 tw=4: