Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / skype / skypechatsession.h
bloba09195cbcdab5d3af747488b0726c67222e3b70e
1 /* This file is part of the KDE project
2 Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
3 Copyright (C) 2008-2009 Pali Rohár <pali.rohar@gmail.com>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
20 #ifndef SKYPECHATSESSION_H
21 #define SKYPECHATSESSION_H
23 #include <kopetechatsession.h>
25 class SkypeAccount;
26 class SkypeContact;
27 class SkypeChatSessionPrivate;
29 /**
30 * @author Michal Vaner (VORNER) <michal.vaner@kdemail.net>
31 * @author Pali Rohár
32 * The chat session for the Skype protocol
34 class SkypeChatSession : public Kopete::ChatSession
36 Q_OBJECT
37 private:
38 ///The insides of the chat session
39 SkypeChatSessionPrivate *d;
40 private slots:
41 ///sends message to the skype user who this chat belongs to
42 void message(Kopete::Message&);
43 /**This disables permanently the call button when the chat becomes a multi-user chat
44 * @todo make this unneeded and allow multiple-user calls
46 void disallowCall();
47 ///Do a call to all participants of the chat (in future, now it allows only one at onece)
48 void callChatSession();
49 ///Slot to show invite menu for other user to chat
50 void showInviteMenu();
51 ///Slot to hide invite menu
52 void hideInviteMenu();
53 /**
54 * Invites a contact to the chat
55 * @param contact What contact
57 void inviteContact(Kopete::Contact* contact);
58 public:
59 /**
60 * Constructor. The chat session will be created with first message coming out.
61 * @param account The account it belongs to
62 * @param other The other side. There it no way user could create chat with more than one user at once. If user is invited to chat by someone, the other constructor should be used. It is automatically registered in the manager.
64 SkypeChatSession(SkypeAccount *account, SkypeContact *other);
65 /**
66 * Constructor from chat session.
67 * Use this one if user is invited to an existing chat or if the first message in that chat was incoming message. The list of users will be loaded at startup. It is automatically registered in the manager.
68 * @param account The account this belongs to.
69 * @param session Identificator of the chat session in skype. The list of users will be loaded in startup and therefore they are not needed to be specified.
71 SkypeChatSession(SkypeAccount *account, const QString &session, const Kopete::ContactPtrList &contacts);
72 ///Destructor
73 ~SkypeChatSession();
74 /**
75 * Invites a contact to the chat
76 * @param contactId What contact
78 virtual void inviteContact(const QString &contactId);
79 public slots:
80 /**
81 * Update the chat topic
82 * @param chat What chat is it about? Maybe me?
83 * @param topic What to set as topic
85 void setTopic(const QString &chat, const QString &topic);
86 /**
87 * Set this chat's ID
88 * @param chatId The new ID
90 void setChatId(const QString &chatId);
91 /**
92 * Add new user to chat
93 * @param chat To know if he joined this chat
94 * @param userId ID of that user
96 void joinUser(const QString &chat, const QString &userId);
97 /**
98 * Some user left the chat
99 * @param chat Is it this chat?
100 * @param userId ID of that user
101 * @param reason Why he left
103 void leftUser(const QString &chat, const QString &userId, const QString &reason);
105 * This will add message that has been sent out by this user
106 * @param recv List of receivers. If there are more than one, replaced by an dummy contact of that chat, because it does crash kopete otherwise
107 * @param body Text to show
109 void sentMessage(const QList<Kopete::Contact*> *recv, const QString &body);
110 signals:
112 * This is emited when it become a multi-user chat. It should be removed from the contact so when user clicks on the contact, new one with only that one should be created
113 * @param chatSession Identificator of the chat
114 * @param previousUser Id of the other user before it became a multichat or empty string if no such user ever was
115 * @param sender Pointer to the chat session that emited this
117 void becameMultiChat(const QString &chatSession, SkypeChatSession *sender);
119 * This is emited when there is an request to get a frindly name of a chat
120 * @param chat Id of that chat
122 void wantTopic(const QString &chat);
124 * This chat's ID has changed
125 * @param oldId What was before? If it is the first set of the ID, it is empty
126 * @param newId The new ID. If it is empty, it means that this chat is being deleted right now and should be removed from all lists
127 * @param sender Pointer to that chat
129 void updateChatId(const QString &oldId, const QString &newId, SkypeChatSession *sender);
131 * Request inviting user to a chat
132 * @param chatId What chat
133 * @param userId What user
135 void inviteUserToChat(const QString &chatId, const QString &userId);
137 * Request leaving the chat
138 * @param chatId What chat
140 void leaveChat(const QString &chatId);
143 #endif