2 * jabbercontact.h - Base class for the Kopete Jabber protocol contact
4 * Copyright (c) 2002-2004 by Till Gerken <till@tantalo.net>
5 * Copyright (c) 2002 by Daniel Stone <dstone@kde.org>
7 * Kopete (c) by the Kopete developers <kopete-devel@kde.org>
9 * *************************************************************************
11 * * This program is free software; you can redistribute it and/or modify *
12 * * it under the terms of the GNU General Public License as published by *
13 * * the Free Software Foundation; either version 2 of the License, or *
14 * * (at your option) any later version. *
16 * *************************************************************************
19 #ifndef JABBERBASECONTACT_H
20 #define JABBERBASECONTACT_H
22 #include "kopetecontact.h"
32 namespace Kopete
{ class MetaContact
; }
34 class JabberBaseContact
: public Kopete::Contact
38 friend class JabberAccount
; /* Friends can touch each other's private parts. */
42 JabberBaseContact (const XMPP::RosterItem
&rosterItem
,
43 JabberAccount
*account
, Kopete::MetaContact
* mc
);
45 /********************************************************************
47 * Kopete::Contact reimplementation start
49 ********************************************************************/
52 * Return the protocol instance associated with this contact
54 JabberProtocol
*protocol ();
57 * Return the account instance associated with this contact
59 JabberAccount
*account ();
62 * Return if the contact is reachable (this is true if the account
65 virtual bool isReachable ();
68 * Create custom context menu items for the contact
69 * FIXME: implement manager version here?
71 virtual QList
<KAction
*> *customContextMenuActions () = 0;
76 virtual void serialize (QMap
< QString
, QString
> &serializedData
, QMap
< QString
, QString
> &addressBookData
);
79 * Update contact if a roster item has been
80 * received for it. (used during login)
82 void updateContact ( const XMPP::RosterItem
&item
);
85 * Deal with an incoming message for this contact.
87 virtual void handleIncomingMessage ( const XMPP::Message
&message
) = 0;
90 * Update the resource property of the
91 * contact, listing all available resources.
93 void updateResourceList ();
96 * Re-evaluate online status. Gets called
97 * whenever a resource is added, removed, or
98 * changed in the resource pool.
100 void reevaluateStatus ();
103 * Return current full address.
104 * Uses bestResource() if no presubscribed
107 QString
fullAddress ();
110 * Set the dontSync flag for this contact.
111 * If this flag is set, calls to @ref sync will
112 * be ignored. This is required if the contact
113 * has been moved between groups on the server
114 * after we logged in and we try to update our
115 * local contact list. Since libkopete can only
116 * handle one group update at a time, moving
117 * between groups requires to operations which
118 * each in turn would cause a call to sync(),
119 * overwriting the change that is being carried
120 * out. (besides causing unnecessary traffic)
121 * This is avoided by setting the dontSync flag
122 * while synchronizing the local copy.
124 void setDontSync ( bool flag
);
127 * Return the status of the dontSync flag.
128 * See @ref setDontSync for a full description.
135 * Retrieve a vCard for the contact
137 virtual void slotUserInfo () = 0;
141 * Construct best address out of
142 * eventually preselected resource
143 * (due to subscription) and best
144 * available resource.
146 XMPP::Jid
bestAddress ();
149 * This will simply cache all
150 * relevant data for this contact.
152 XMPP::RosterItem mRosterItem
;
161 // vim: set noet ts=4 sts=4 sw=4: