2 * telepathycontact.h - Telepathy Kopete Contact.
4 * Copyright (c) 2006 by Michaƫl Larouche <larouche@kde.org>
6 * Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
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. *
15 *************************************************************************
17 #ifndef TELEPATHYCONTACT_H
18 #define TELEPATHYCONTACT_H
21 #include <QtCore/QMap>
22 #include <QtCore/QList>
25 #include <kopetecontact.h>
28 #include <QtTapioca/ContactBase>
43 class TelepathyAccount
;
45 class TelepathyContact
: public Kopete::Contact
49 TelepathyContact(TelepathyAccount
*account
, const QString
&contactId
, Kopete::MetaContact
*parent
);
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
);
61 * @brief Reimplement Kopete::Contact::account() to cast to specific TelepathyAccount
62 * @return TelepathyAccount for this contact.
64 TelepathyAccount
*account();
67 * @brief Get the internal Tapioca contact.
68 * @return the internal Tapioca contact instance (a reference)
70 QtTapioca::Contact
*internalContact();
74 * @brief Delete the contact on server and remove it from Kopete.
76 virtual void deleteContact();
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
);
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
);
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();