• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/libkopete

Kopete::ContactList

Kopete::ContactList Class Reference

#include <kopetecontactlist.h>

Inheritance diagram for Kopete::ContactList:

Inheritance graph
[legend]

List of all members.


Detailed Description

manage contacts and metacontact

The contactList is a singleton you can uses with ContactList::self()

it let you get a list of metacontact with metaContacts() Only metacontact which are on the contact list are returned.

Author:
Martijn Klingens <klingens@kde.org>

Olivier Goffart <ogoffart@tiscalinet.be>

Definition at line 48 of file kopetecontactlist.h.


Public Slots

void addGroup (Kopete::Group *)
void addGroups (QList< Group * > groups)
void addMetaContact (Kopete::MetaContact *c)
void addMetaContacts (QList< MetaContact * > metaContacts)
void load ()
void removeGroup (Kopete::Group *)
void removeMetaContact (Kopete::MetaContact *contact)
void save ()
void setSelectedItems (QList< MetaContact * > metaContacts, QList< Group * > groups)

Signals

void groupAdded (Kopete::Group *)
void groupRemoved (Kopete::Group *)
void groupRenamed (Kopete::Group *, const QString &oldname)
void metaContactAdded (Kopete::MetaContact *mc)
void metaContactAddedToGroup (Kopete::MetaContact *mc, Kopete::Group *to)
void metaContactRemoved (Kopete::MetaContact *mc)
void metaContactRemovedFromGroup (Kopete::MetaContact *mc, Kopete::Group *from)
void metaContactSelected (bool)
void selectionChanged ()

Public Member Functions

Contact * findContact (const QString &protocolId, const QString &accountId, const QString &contactId) const
Group * findGroup (const QString &displayName, int type=0)
MetaContact * findMetaContactByContactId (const QString &contactId) const
MetaContact * findMetaContactByDisplayName (const QString &displayName) const
Group * group (unsigned int groupId) const
QList< Group * > groups () const
MetaContact * metaContact (const QString &metaContactId) const
QList< MetaContact * > metaContacts () const
MetaContact * myself ()
QList< Group * > selectedGroups () const
QList< MetaContact * > selectedMetaContacts () const
 ~ContactList ()

Static Public Member Functions

static ContactList * self ()

Constructor & Destructor Documentation

Kopete::ContactList::~ContactList (  ) 

Definition at line 104 of file kopetecontactlist.cpp.


Member Function Documentation

void Kopete::ContactList::addGroup ( Kopete::Group *  g  )  [slot]

Add a group each group must be added on the list after his creation.

Definition at line 277 of file kopetecontactlist.cpp.

void Kopete::ContactList::addGroups ( QList< Group * >  groups  )  [slot]

Add groups each group must be added on the list after his creation.

Definition at line 271 of file kopetecontactlist.cpp.

void Kopete::ContactList::addMetaContact ( Kopete::MetaContact *  c  )  [slot]

Add the metacontact into the contact list When calling this method, the contact has to be already placed in the correct group.

If the contact is not in a group, it will be added to the top-level group. It is also better if the MetaContact could also be completely created, i.e: all contacts already in it

Definition at line 229 of file kopetecontactlist.cpp.

void Kopete::ContactList::addMetaContacts ( QList< MetaContact * >  metaContacts  )  [slot]

Add metacontacts into the contact list When calling this method, contacts have to be already placed in the correct group.

If contacts are not in a group, they will be added to the top-level group. It is also better if the MetaContacts could also be completely created, i.e: all contacts already in it

Definition at line 223 of file kopetecontactlist.cpp.

Contact * Kopete::ContactList::findContact ( const QString &  protocolId,
const QString &  accountId,
const QString &  contactId 
) const

find a contact in the contact list.

Browse in each metacontact of the list to find the contact with the given ID.

Parameters:
protocolId the Plugin::pluginId() of the protocol ("MSNProtocol")
accountId the Account::accountId()
contactId the Contact::contactId()
Returns:
the contact with the parameters, or 0L if not found.

Definition at line 151 of file kopetecontactlist.cpp.

Group * Kopete::ContactList::findGroup ( const QString &  displayName,
int  type = 0 
)

find a group with his displayName If a group already exists with the given name and the given type, the existing group will be returned.

Otherwise, a new group will be created.

Parameters:
displayName is the display name to search
type is the Group::GroupType to search, the default value is group::Normal
Returns:
always a valid Group

Definition at line 191 of file kopetecontactlist.cpp.

MetaContact * Kopete::ContactList::findMetaContactByContactId ( const QString &  contactId  )  const

Find a meta contact by its contact id.

Returns the first match.

Definition at line 177 of file kopetecontactlist.cpp.

MetaContact * Kopete::ContactList::findMetaContactByDisplayName ( const QString &  displayName  )  const

Find a contact by display name.

Returns the first match.

Definition at line 165 of file kopetecontactlist.cpp.

Group * Kopete::ContactList::group ( unsigned int  groupId  )  const

return the group with the given unique id.

if none is found return 0L

Definition at line 137 of file kopetecontactlist.cpp.

void Kopete::ContactList::groupAdded ( Kopete::Group *   )  [signal]

A group has just been added.

void Kopete::ContactList::groupRemoved ( Kopete::Group *   )  [signal]

A group has just been removed.

void Kopete::ContactList::groupRenamed ( Kopete::Group *  ,
const QString &  oldname 
) [signal]

A group has just been renamed.

QList< Group * > Kopete::ContactList::groups (  )  const

Returns:
all groups

Definition at line 116 of file kopetecontactlist.cpp.

void Kopete::ContactList::load (  )  [slot]

For internal use only.

Load the contact list

Definition at line 319 of file kopetecontactlist.cpp.

MetaContact * Kopete::ContactList::metaContact ( const QString &  metaContactId  )  const

Return the metacontact referenced by the given id.

is none is found, return 0L

See also:
MetaContact::metaContactId()

Definition at line 122 of file kopetecontactlist.cpp.

void Kopete::ContactList::metaContactAdded ( Kopete::MetaContact *  mc  )  [signal]

A meta contact was added to the contact list.

Interested classes ( like the listview widgets ) can connect to this signal to receive the newly added contacts.

void Kopete::ContactList::metaContactAddedToGroup ( Kopete::MetaContact *  mc,
Kopete::Group *  to 
) [signal]

A contact has been added to a group.

void Kopete::ContactList::metaContactRemoved ( Kopete::MetaContact *  mc  )  [signal]

A metacontact has just been removed.

and will be soon deleted

void Kopete::ContactList::metaContactRemovedFromGroup ( Kopete::MetaContact *  mc,
Kopete::Group *  from 
) [signal]

A contact has been removed from a group.

QList< MetaContact * > Kopete::ContactList::metaContacts (  )  const

return a list of all metacontact of the contact list Retrieve the list of all available meta contacts.

The returned QPtrList is not the internally used variable, so changes to it won't propagate into the actual contact list. This can be useful if you need a subset of the contact list, because you can simply filter the result set as you wish without worrying about side effects. The contained MetaContacts are obviously _not_ duplicates, so changing those *will* have the expected result :-)

Definition at line 110 of file kopetecontactlist.cpp.

void Kopete::ContactList::metaContactSelected ( bool   )  [signal]

This signal is emitted each time the selection has changed.

the bool is set to true if only one meta contact has been selected, and set to false if none, or several contacts are selected you can connect this signal to KAction::setEnabled if you have an action which is applied to only one contact

MetaContact * Kopete::ContactList::myself (  ) 

return the metacontact that represent the user itself.

This metacontact should be the parent of every Kopete::Account::myself() contacts.

This metacontact is not in the contact list.

Definition at line 311 of file kopetecontactlist.cpp.

void Kopete::ContactList::removeGroup ( Kopete::Group *  g  )  [slot]

Remove a group this method delete the group.

Definition at line 287 of file kopetecontactlist.cpp.

void Kopete::ContactList::removeMetaContact ( Kopete::MetaContact *  contact  )  [slot]

Remove a metacontact from the contact list.

This method delete itself the metacontact.

Definition at line 243 of file kopetecontactlist.cpp.

void Kopete::ContactList::save (  )  [slot]

Definition at line 341 of file kopetecontactlist.cpp.

QList< Group * > Kopete::ContactList::selectedGroups (  )  const

return the list of groups actualy selected in the contact list UI

Definition at line 218 of file kopetecontactlist.cpp.

QList< MetaContact * > Kopete::ContactList::selectedMetaContacts (  )  const

return the list of metacontact actually selected in the contact list UI

Definition at line 213 of file kopetecontactlist.cpp.

void Kopete::ContactList::selectionChanged (  )  [signal]

This signal is emit when the selection has changed, it is emitted after the following slot Warning: Do not delete any contacts in slots connected to this signal.

(it is the warning in the QListView::selectionChanged() doc)

ContactList * Kopete::ContactList::self (  )  [static]

The contact list is a singleton object.

Use this method to retrieve the instance.

Definition at line 70 of file kopetecontactlist.cpp.

void Kopete::ContactList::setSelectedItems ( QList< MetaContact * >  metaContacts,
QList< Group * >  groups 
) [slot]

Set which items are selected in the ContactList GUI.

This method has to be called by the contact list UI side. it stores the selected items, and emits signals

Definition at line 301 of file kopetecontactlist.cpp.


The documentation for this class was generated from the following files:
  • kopetecontactlist.h
  • kopetecontactlist.cpp

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal