Logo Search packages:      
Sourcecode: kdenetwork version File versions

KopeteMetaContact Class Reference

#include <kopetemetacontact.h>

Inheritance diagram for KopeteMetaContact:

KopetePluginDataObject KopeteNotifyDataObject

List of all members.

Detailed Description

Will Stephenson <will@stevello.free-online.co.uk>

Martijn Klingens <klingens@kde.org>

Duncan Mac-Vicar Prett <duncan@kde.org>

Olivier Goffart <ogoffart@tiscalinet.be>

A metacontact represent a person. This is a kind of entry to the contactlist. All information of a contact is contained in the metacontact. Plugins can store data in it with all KopetePluginData methods

Definition at line 53 of file kopetemetacontact.h.

Public Types

enum  GroupSyncMode { SyncGroups, DontSyncGroups }
enum  IconState {
  None, Open, Closed, Online,
  Away, Offline, Unknown

Public Slots

void addToGroup (KopeteGroup *to, GroupSyncMode syncMode=SyncGroups)
 Add a contact to another group.
KopeteContactexecute ()
 Contact another user.
void moveToGroup (KopeteGroup *from, KopeteGroup *to, GroupSyncMode syncMode=SyncGroups)
 Move a contact from one group to another.
KopeteContactpreferredContact ()
void removeContact (KopeteContact *c, bool deleted=false)
 remove the contact from this metacontact
void removeFromGroup (KopeteGroup *from, GroupSyncMode syncMode=SyncGroups)
 Remove a contact from one group.
void removeKABC ()
 Remove any KABC data for this meta contact.
void sendFile (const KURL &sourceURL, const QString &altFileName=QString::null, unsigned long fileSize=0L)
 Send a file to this metacontact.
KopeteContactsendMessage ()
 Send a single message, classic ICQ style.
void setAddressBookField (KopetePlugin *p, const QString &app, const QString &key, const QString &value)
 set an address book field
void setTemporary (bool b=true, KopeteGroup *group=0L)
 Set if this is a temporary contact. (see isTemporary).
KopeteContactstartChat ()
 Start a chat in a persistent chat window.
bool syncWithKABC ()
void updateKABC ()
 Change the KABC data associated with this metacontact.


void aboutToSave (KopeteMetaContact *metaContact)
void addedToGroup (KopeteMetaContact *contact, KopeteGroup *to)
 The contact was added to another group.
void contactAdded (KopeteContact *c)
 a contact has been added into this metacontact
void contactIdleStateChanged (KopeteContact *contact)
void contactRemoved (KopeteContact *c)
 a contact has been removed from this metacontact
void contactStatusChanged (KopeteContact *contact, const KopeteOnlineStatus &status)
 A contact's online status changed.
void displayNameChanged (const QString &oldName, const QString &newName)
 The meta contact's display name changed.
void iconAppearanceChanged ()
void iconChanged (KopetePluginDataObject::IconState, const QString &)
void movedToGroup (KopeteMetaContact *contact, KopeteGroup *from, KopeteGroup *to)
 The contact was moved.
void onlineStatusChanged (KopeteMetaContact *contact, KopeteOnlineStatus::OnlineStatus status)
 The MetaContact online status changed.
void persistentDataChanged (KopeteMetaContact *metaContact)
void pluginDataChanged ()
void removedFromGroup (KopeteMetaContact *contact, KopeteGroup *group)
 The contact was removed from group.
void useCustomIconChanged (bool useCustomIcon)

Public Member Functions

void addContact (KopeteContact *c)
 Add a brand new contact to the meta contact. Updates KABC.
QString addressBookField (KopetePlugin *p, const QString &app, const QString &key) const
bool canAcceptFiles () const
QPtrList< KopeteContactcontacts () const
 Retrieve the list of contacts that are part of the meta contact.
QString displayName () const
KopeteContactfindContact (const QString &protocolId, const QString &accountId, const QString &contactId)
bool fromXML (const QDomElement &cnode)
KopeteGroupList groups () const
 The groups the contact is stored in.
QString icon (IconState state=None) const
unsigned long int idleTime () const
bool isOnline () const
bool isReachable () const
bool isTemporary () const
bool isTopLevel () const
 Return true if the contact is shown at toplevel. You may also check if groups() contains KopeteGroup::topLevel().
QString metaContactId () const
 Returns this metacontact's ID.
KopeteNotifyEvent * notifyEvent (const QString &event) const
QString pluginData (KopetePlugin *plugin, const QString &key) const
QMap< QString, QString > pluginData (KopetePlugin *plugin) const
bool removeNotifyEvent (const QString &event)
void setDisplayName (const QString &name)
 Set the displayName.
void setIcon (const QString &icon, IconState=None)
void setMetaContactId (const QString &newMetaContactId)
 Add or change the link to a KDE addressbook (KABC) Addressee. FIXME: Use with care. You could create 1 to many relationships with the current implementation.
void setNotifyEvent (const QString &event, KopeteNotifyEvent *notifyEvent)
void setPluginData (KopetePlugin *plugin, const QString &key, const QString &value)
void setPluginData (KopetePlugin *plugin, const QMap< QString, QString > &value)
void setTrackChildNameChanges (bool track)
 set if the metacontact displayname follow subcontacts displayname
void setUseCustomIcon (bool useCustomIcon)
KopeteOnlineStatus::OnlineStatus status () const
virtual QString statusIcon () const
 The name of the icon associated with the contact's status.
QString statusString () const
 The status string of the contact.
const QDomElement toXML ()
bool trackChildNameChanges () const
 get the tracking of contact names
bool useCustomIcon () const

Protected Member Functions

bool notifyDataFromXML (const QDomElement &element)
QDomElement notifyDataToXML ()
void writeConfig (const QString &configGroup) const


bool canAcceptFiles
QString displayName
bool isOnline
bool isReachable
bool isTopLevel
QString metaContactId
QString statusIcon
QString statusString
bool trackChildNameChanges

Private Slots

void emitPersistentDataChanged ()
void slotContactDestroyed (KopeteContact *)
void slotContactStatusChanged (KopeteContact *c, const KopeteOnlineStatus &status, const KopeteOnlineStatus &oldStatus)
void slotPluginLoaded (KopetePlugin *plugin)
void slotPropertyChanged (KopeteContact *contact, const QString &key, const QVariant &oldValue, const QVariant &newValue)
void slotWriteAddressBook ()
void updateOnlineStatus ()

Private Member Functions

void writeAddressBook ()

Static Private Member Functions

static KABC::AddressBook * addressBook ()
static void splitField (const QString &str, QString &app, QString &name, QString &value)

Private Attributes

KopeteMetaContactPrivate * d

Static Private Attributes

static KABC::AddressBook * m_addressBook = 0L

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index