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

kopete/libkopete

  • Kopete
  • ContactListElement
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
Kopete::ContactListElement Class Reference

#include <kopetecontactlistelement.h>

Inheritance diagram for Kopete::ContactListElement:
Inheritance graph
[legend]

Public Types

typedef QMap< QString, QString > ContactData
 
typedef QList< ContactData > ContactDataList
 
typedef QMap< IconState, QString > IconMap
 
enum  IconState {
  None, Open, Closed, Online,
  Away, Offline, Unknown
}
 
typedef QMap< QString, QMap
< QString, QString > > 
PluginDataMap
 

Signals

void iconAppearanceChanged ()
 
void iconChanged (Kopete::ContactListElement::IconState, const QString &)
 
void pluginDataChanged ()
 
void useCustomIconChanged (bool useCustomIcon)
 
- Signals inherited from Kopete::PropertyContainer
void propertyChanged (Kopete::PropertyContainer *container, const QString &key, const QVariant &oldValue, const QVariant &newValue)
 

Public Member Functions

void appendPluginContactData (const QString &pluginId, const ContactData &data)
 
void clearPluginContactData ()
 
QString icon (IconState state=None) const
 
const IconMap icons () const
 
bool loading () const
 
QMap< QString, ContactDataList > pluginContactData () const
 
ContactDataList pluginContactData (Plugin *plugin) const
 
QMap< QString, QString > pluginData (Plugin *plugin) const
 
QString pluginData (Plugin *plugin, const QString &key) const
 
const PluginDataMap pluginData () const
 
void setIcon (const QString &icon, IconState=None)
 
void setLoading (bool value)
 
void setPluginContactData (Plugin *plugin, const ContactDataList &dataList)
 
void setPluginData (Plugin *plugin, const QMap< QString, QString > &value)
 
void setPluginData (const QString &pluginId, const QMap< QString, QString > &pluginData)
 
void setPluginData (Plugin *plugin, const QString &key, const QString &value)
 
void setUseCustomIcon (bool useCustomIcon)
 
bool useCustomIcon () const
 
- Public Member Functions inherited from Kopete::PropertyContainer
 PropertyContainer (QObject *parent=0)
 
virtual ~PropertyContainer ()
 
void deserializeProperties (const QMap< QString, QString > &serializedData)
 
bool hasProperty (const QString &key) const
 
QStringList properties () const
 
const Kopete::Property & property (const QString &key) const
 
const Kopete::Property & property (const Kopete::PropertyTmpl &tmpl) const
 
void removeProperty (const Kopete::PropertyTmpl &tmpl)
 
void serializeProperties (QMap< QString, QString > &serializedData) const
 
void setProperty (const Kopete::PropertyTmpl &tmpl, const QVariant &value)
 

Protected Member Functions

 ContactListElement (QObject *parent=0L)
 
 ~ContactListElement ()
 

Detailed Description

Author
Olivier Goffart

This is the base class for base elements of the contact list. His purpose is to share the code between Group and MetaContact

It handle the saving and loading of plugin data from the contact list. Plugins may set custom data to metaocntacts or groups by calling setPluginData and may retrieve them with pluginData

It also allow to store an icon for this element.

Definition at line 46 of file kopetecontactlistelement.h.

Member Typedef Documentation

typedef QMap<QString, QString> Kopete::ContactListElement::ContactData

Definition at line 115 of file kopetecontactlistelement.h.

typedef QList<ContactData> Kopete::ContactListElement::ContactDataList

Definition at line 116 of file kopetecontactlistelement.h.

typedef QMap<IconState, QString> Kopete::ContactListElement::IconMap

Definition at line 159 of file kopetecontactlistelement.h.

typedef QMap<QString, QMap<QString, QString> > Kopete::ContactListElement::PluginDataMap

Definition at line 113 of file kopetecontactlistelement.h.

Member Enumeration Documentation

enum Kopete::ContactListElement::IconState

The various icon states.

Some state are reserved for Groups, other for metacontact. 'None' is the default icon.

Enumerator
None 
Open 
Closed 
Online 
Away 
Offline 
Unknown 

Definition at line 158 of file kopetecontactlistelement.h.

Constructor & Destructor Documentation

Kopete::ContactListElement::ContactListElement ( QObject *  parent = 0L)
protected

Definition at line 41 of file kopetecontactlistelement.cpp.

Kopete::ContactListElement::~ContactListElement ( )
protected

Definition at line 51 of file kopetecontactlistelement.cpp.

Member Function Documentation

void Kopete::ContactListElement::appendPluginContactData ( const QString &  pluginId,
const ContactData &  data 
)

Convenience method to append plugin specific data for single contact Note that plugins shouldn't use this method.

Definition at line 144 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::clearPluginContactData ( )

Clear all plugin specific data.

Note that plugins shouldn't use this method

Definition at line 125 of file kopetecontactlistelement.cpp.

QString Kopete::ContactListElement::icon ( ContactListElement::IconState  state = None) const

return the icon for this object, in the given state.

if there is no icon registered for this state, the None icon is used if available

Definition at line 162 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::iconAppearanceChanged ( )
signal

The visual appearance of some of our icons has changed.

void Kopete::ContactListElement::iconChanged ( Kopete::ContactListElement::IconState  ,
const QString &   
)
signal

The icon to use for some state has changed.

const ContactListElement::IconMap Kopete::ContactListElement::icons ( ) const

return all registered icons

Definition at line 157 of file kopetecontactlistelement.cpp.

bool Kopete::ContactListElement::loading ( ) const

Check if we are in loading stage.

Returns
true if we are in loading stage.

Definition at line 61 of file kopetecontactlistelement.cpp.

QMap< QString, ContactListElement::ContactDataList > Kopete::ContactListElement::pluginContactData ( ) const

Get the settings as stored previously by calls to setPluginContactData() Note that plugins shouldn't use this method.

Definition at line 112 of file kopetecontactlistelement.cpp.

ContactListElement::ContactDataList Kopete::ContactListElement::pluginContactData ( Plugin *  plugin) const

Get the settings as stored previously by calls to setPluginContactData() for a plugin Note that plugins shouldn't use this method.

Definition at line 117 of file kopetecontactlistelement.cpp.

QMap< QString, QString > Kopete::ContactListElement::pluginData ( Plugin *  plugin) const

Get the settings as stored previously by calls to setPluginData()

Note that calling this method for protocol plugins that use the Contact::serialize() API may yield unexpected results.

Definition at line 91 of file kopetecontactlistelement.cpp.

QString Kopete::ContactListElement::pluginData ( Plugin *  plugin,
const QString &  key 
) const

Convenience method to retrieve only a single field from the plugin data.

See setPluginData().

Note that plugin data is accessible only after it has been loaded from the XML file. Don't call this method before then (e.g. in constructors).

Definition at line 99 of file kopetecontactlistelement.cpp.

const ContactListElement::PluginDataMap Kopete::ContactListElement::pluginData ( ) const

return plugin-specific data for all plugins

Definition at line 107 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::pluginDataChanged ( )
signal

The plugin data was changed (by a plugin)

void Kopete::ContactListElement::setIcon ( const QString &  icon,
ContactListElement::IconState  state = None 
)

Set the icon in the given state To clear an entry, set a QString()

Definition at line 170 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::setLoading ( bool  value)

Set if we are in loading stage.

Definition at line 56 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::setPluginContactData ( Plugin *  plugin,
const ContactDataList &  dataList 
)

Set plugin specific data for each contact.

Note that plugins shouldn't use this method

Definition at line 130 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::setPluginData ( Plugin *  plugin,
const QMap< QString, QString > &  value 
)

Set the plugin-specific data.

The data in the provided QMap is a set of key/value pairs. Note that protocol plugins usually shouldn't use this method, but reimplement Contact::serialize() instead. This method is called by Protocol for those classes.

WARNING: This erases all old data stored for this object! You may want to consider the setPluginData() overload that takes a single field as parameter.

Definition at line 66 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::setPluginData ( const QString &  pluginId,
const QMap< QString, QString > &  pluginData 
)

Definition at line 71 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::setPluginData ( Plugin *  plugin,
const QString &  key,
const QString &  value 
)

Convenience method to store or change only a single field of the plugin data.

As with the other setPluginData() method, protocols are advised not to use this method and reimplement Contact::serialize() instead.

Note that you should save the file after adding data or it will get lost.

Definition at line 84 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::setUseCustomIcon ( bool  useCustomIcon)

set if the user want to show custom icon he set with setIcon this does not clear icons string if you set false

Definition at line 186 of file kopetecontactlistelement.cpp.

bool Kopete::ContactListElement::useCustomIcon ( ) const

return if yes or no the user wants to display some custom icon.

you can use icon() to know the icons to uses

Definition at line 181 of file kopetecontactlistelement.cpp.

void Kopete::ContactListElement::useCustomIconChanged ( bool  useCustomIcon)
signal

The useCustomIcon property has changed.


The documentation for this class was generated from the following files:
  • kopetecontactlistelement.h
  • kopetecontactlistelement.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal