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 SKYPECONTACT_H
21
#define SKYPECONTACT_H
23
#include <kopetecontact.h>
28
class SkypeContactPrivate;
34
class SkypeChatSession;
37
* @author Michal Vaner (VORNER) <michal.vaner@kdemail.net>
39
* @short Skype contact
41
class SkypeContact : public Kopete::Contact
45
///some internal things
46
SkypeContactPrivate *d;
47
///This examines all factors of users online status and sets the status acordingly
50
///This will note that the session was destroyed and therefore can't be used again. As well used when the chat becomes multi-user so it no longer belongs to this contact
52
///Enables or disables the call action depending on if it can be called or not.
53
void enableActions(bool value);
54
///The status changed, so there should be update of the availiblity of some things
59
* @param account Account to which it belongs
60
* @param id ID of the new contact
61
* @param parent Metacontact to put it inside
63
SkypeContact(SkypeAccount *account, const QString &id, Kopete::MetaContact *parent, bool user = true);
69
* Creates a chat session.
70
* @param flags Can I create it?
71
* @return Pointer to that session
73
virtual Kopete::ChatSession *manager( CanCreateFlags canCreate = CannotCreate );
75
* Save this contact (resp. set what should be saved and it will be written automatically by kopete)
77
virtual void serialize(QMap<QString, QString> &serializedData, QMap<QString, QString> &addressBookData);
78
///Returns full name for the contact
79
virtual QString formattedName() const;
80
///Is it reachable now?
81
virtual bool isReachable();
82
///Does this contact has opened chat session?
84
///Tell kopete which actions to show in the contact pop-up menu
85
virtual QList<KAction*> *customContextMenuActions();
86
///Give me actually existing chat session
87
SkypeChatSession *getChatSession();
88
///Can this contact be called now?
92
* Authorize the user to see if I'm online
96
* Remove authorization from that user
100
* Block this user, no more messages
105
* Please ask for the contact information (emit infoReques with your name)
109
* Chnages something in the contact.
110
* @param change What change was it? It looks like [property] [value]
112
void setInfo(const QString &change);
114
* This one showes message in the chat session.
115
* @param message The message to show
116
* @param chat The chat ID of the chat the message belongs to
117
* @param timeStamp time when message was send
119
void receiveIm(const QString &message, const QString &chat, const QDateTime &timeStamp);
121
* connection status changed
122
* @param connected Are we connected now?
124
void connectionStatus(bool connected);
125
///This slot calls a contact
128
* This slot should show the user info
129
* TODO: Implement this
130
* Now it only shows a messagebox
132
virtual void slotUserInfo();
134
* Remove the contact from skype server
136
virtual void deleteContact();
138
* Save me to the Skype
140
virtual void sync(unsigned int changed);
144
virtual void sendFile(const KUrl &url, const QString &, uint);
147
* There is a request to get/refresh the contact info from skype
148
* @param contact Which contact wants it?
150
void infoRequest(const QString &contact);
152
* The possibility to call this contact has changed, so GUI should enable/disable some buttons.
153
* @param value Is it possible to call it now?
155
void setActionsPossible(bool value);