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

kopete/libkopete

Kopete::ContactListElement

Kopete::ContactListElement Class Reference

#include <kopetecontactlistelement.h>

Inheritance diagram for Kopete::ContactListElement:

Inheritance graph
[legend]

List of all members.


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 45 of file kopetecontactlistelement.h.


Public Types

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)

Public Member Functions

QString icon (IconState state=None) const
const IconMap icons () const
bool loading () const
const PluginDataMap pluginData () const
QString pluginData (Plugin *plugin, const QString &key) const
QMap< QString, QString > pluginData (Plugin *plugin) const
void setIcon (const QString &icon, IconState=None)
void setLoading (bool value)
void setPluginData (Plugin *plugin, const QString &key, const QString &value)
void setPluginData (const QString &pluginId, const QMap< QString, QString > &pluginData)
void setPluginData (Plugin *plugin, const QMap< QString, QString > &value)
void setUseCustomIcon (bool useCustomIcon)
bool useCustomIcon () const

Protected Member Functions

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

Member Typedef Documentation

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

Definition at line 125 of file kopetecontactlistelement.h.

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

Definition at line 112 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 124 of file kopetecontactlistelement.h.


Constructor & Destructor Documentation

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

Definition at line 39 of file kopetecontactlistelement.cpp.

Kopete::ContactListElement::~ContactListElement (  )  [protected]

Definition at line 51 of file kopetecontactlistelement.cpp.


Member Function Documentation

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 117 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 112 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.

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

return plugin-specific data for all plugins

Definition at line 107 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.

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.

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 125 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::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::setPluginData ( const QString &  pluginId,
const QMap< QString, QString > &  pluginData 
)

Definition at line 71 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::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 141 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 136 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

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