Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / telepathy / telepathycontact.h
blobbd949194eb398153d5fb3709443dbd7ec8b21f23
1 /*
2 * telepathycontact.h - Telepathy Kopete Contact.
4 * Copyright (c) 2006 by Michaƫl Larouche <larouche@kde.org>
5 *
6 * Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
9 * *
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. *
14 * *
15 *************************************************************************
17 #ifndef TELEPATHYCONTACT_H
18 #define TELEPATHYCONTACT_H
20 // Qt Includes
21 #include <QtCore/QMap>
22 #include <QtCore/QList>
24 // Kopete includes
25 #include <kopetecontact.h>
27 // QtTapioca includes
28 #include <QtTapioca/ContactBase>
30 class KAction;
32 namespace QtTapioca
34 class Contact;
35 class Avatar;
38 namespace Kopete
40 class ChatSession;
41 class MetaContact;
43 class TelepathyAccount;
45 class TelepathyContact : public Kopete::Contact
47 Q_OBJECT
48 public:
49 TelepathyContact(TelepathyAccount *account, const QString &contactId, Kopete::MetaContact *parent);
50 ~TelepathyContact();
52 virtual bool isReachable();
53 virtual void serialize(QMap< QString, QString >& serializedData, QMap< QString, QString >& addressBookData);
55 virtual QList<KAction *> *customContextMenuActions();
56 virtual Kopete::ChatSession *manager( CanCreateFlags canCreate = CannotCreate );
58 void setInternalContact(QtTapioca::Contact *internalContact);
60 /**
61 * @brief Reimplement Kopete::Contact::account() to cast to specific TelepathyAccount
62 * @return TelepathyAccount for this contact.
64 TelepathyAccount *account();
66 /**
67 * @brief Get the internal Tapioca contact.
68 * @return the internal Tapioca contact instance (a reference)
70 QtTapioca::Contact *internalContact();
72 public slots:
73 /**
74 * @brief Delete the contact on server and remove it from Kopete.
76 virtual void deleteContact();
78 private slots:
79 /**
80 * @brief Called when the contact has updated its presence information.
81 * @param contactBase Referring ContactBase
82 * @param presence New presence.
83 * @param presenceMessage New presenceMessage, if any.
85 void telepathyPresenceUpdated(QtTapioca::ContactBase *contactBase, QtTapioca::ContactBase::Presence presence, const QString &presenceMessage);
87 /**
88 * @brief Called when contact has changed its alias.
89 * @param contactBase Referring ContactBase
90 * @param alias New alias
92 void telepathyAliasChanged(QtTapioca::ContactBase *contactBase, const QString &alias);
94 /**
95 * @brief Called when contact has changed its avatar.
96 * @param contact Referring ContactBase
97 * @param newToken New token for the avatar update
99 void telepathyAvatarChanged(QtTapioca::ContactBase *contact, const QString &newToken);
102 * @brief Called when we got avatar from contact.
103 * @param contact Referring ContactBase
104 * @param avatar New avatar data
106 void telepathyAvatarReceived(QtTapioca::ContactBase *contact, QtTapioca::Avatar *avatar);
108 void actionAuthorize();
109 void actionSubscribe();
111 private:
112 class Private;
113 Private *d;
115 #endif