Logo Search packages:      
Sourcecode: kmess version File versions  Download package

Public Types | Public Member Functions | Private Member Functions | Private Attributes

ContactListModelItem Class Reference

#include <contactlistmodelitem.h>

Collaboration diagram for ContactListModelItem:
Collaboration graph

List of all members.

Public Types

enum  DataRoles { DataRole = Qt::DisplayRole, SortRole = Qt::UserRole + 1, SearchRole = Qt::UserRole + 2 }
enum  ItemType { ItemRoot = -1, ItemGroup = 1, ItemContact = 2 }

Public Member Functions

ContactListModelItemchild (int row)
ContactListModelItemchildContact (const QString &handle)
ModelItemList childContacts (const QString &handle)
int childCount () const
ContactListModelItemchildGroup (const QString &id)
ModelItemList childGroups ()
int columnCount () const
 ContactListModelItem ()
 ContactListModelItem (Contact *contact, ContactListModelItem *parent=0)
 ContactListModelItem (Group *group, ContactListModelItem *parent=0)
const QVariant data (int role) const
ItemType getType () const
void moveTo (ContactListModelItem *newParent)
void * object () const
ContactListModelItemparent () const
int row () const
 ~ContactListModelItem ()

Private Member Functions

void appendChild (ContactListModelItem *child)
int removeChild (ContactListModelItem *child)

Private Attributes

ModelItemList childItems_
ItemType itemType_
void * object_

Detailed Description

This class represent a Contact List node or leaf in the Model/View paradigm.

The Model is a way to universally represent data which could be reused later by different views: for example, the contact list, or a list of contacts available to be invited in a chat. The data is organized in form of a tree, with a root element containing the user's groups, and the contacts within the groups. The Model Item is an element of the tree. It can assume the role of a root element, of a node (a group) or of a contact (a leaf). The data output by the model items can be easily expanded for future uses.

Valerio Pilo <valerio@kmess.org>

Definition at line 56 of file contactlistmodelitem.h.

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

Generated by  Doxygen 1.6.0   Back to index