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

kopete/libkopete

Kopete::StatusMessage

Kopete::StatusMessage Class Reference

#include <kopetestatusmessage.h>

List of all members.


Detailed Description

This class encapsulate a status message.

A status message to today(as 2006) standards is more than a simple text. It can be used to show the current listening song, current playing game, show our mood etc.. So this class allows to add metadata to the status message where protocols will be able to use properly.

 // Create a new status message.
 Kopete::StatusMessage message;
 message.setMessage( QString("Writing APIDOX") );
 message.addMetaData( "musicPlayer", "amaroK" );
 message.addMetaData( "artist", "Liquid Tension Experiment" );
 message.addMetaData( "title", "Acid Rain" );
 message.addMetaData( "album", "Liquid Tension Experiment 2" );
 
 account->setStatusMessage(message);
This class is implicit shared.
Author:
Michaƫl Larouche

Definition at line 48 of file kopetestatusmessage.h.


Public Member Functions

 StatusMessage ()
 StatusMessage (const QString &statusMessage)
 StatusMessage (const StatusMessage &copy)
 ~StatusMessage ()
StatusMessage & operator= (const StatusMessage &other)
bool isEmpty () const
void addMetaData (const QString &key, const QVariant &value)
void addMetaData (const QHash< QString, QVariant > &otherHash)
bool hasMetaData (const QString &key) const
QVariant metaData (const QString &key) const
void setMessage (const QString &message)
QString message () const

Constructor & Destructor Documentation

Kopete::StatusMessage::StatusMessage (  ) 

Create a empty status message.

Definition at line 34 of file kopetestatusmessage.cpp.

Kopete::StatusMessage::StatusMessage ( const QString &  statusMessage  ) 

Create a new status message with the specified status message.

This constructor is not explicit so it's allow implicit QString conversation to this class.

Parameters:
statusMessage the status message.

Definition at line 38 of file kopetestatusmessage.cpp.

Kopete::StatusMessage::StatusMessage ( const StatusMessage &  copy  ) 

StatusMessage copy constructor.

Very cheap because the class is implicit shared.

Definition at line 47 of file kopetestatusmessage.cpp.

Kopete::StatusMessage::~StatusMessage (  ) 

StatusMessage destructor.

Definition at line 44 of file kopetestatusmessage.cpp.


Member Function Documentation

StatusMessage & Kopete::StatusMessage::operator= ( const StatusMessage &  other  ) 

StatusMessage copy-assignment operator.

Very cheap because the class is implicit shared.

Definition at line 51 of file kopetestatusmessage.cpp.

bool Kopete::StatusMessage::isEmpty (  )  const

Verify if the status message is empty.

Returns:
true if the status message is empty.

Definition at line 57 of file kopetestatusmessage.cpp.

void Kopete::StatusMessage::addMetaData ( const QString &  key,
const QVariant &  value 
)

Add a metadata to the status message.

Parameters:
key Key to identity the metadata.
value Value for the metadata.

Definition at line 72 of file kopetestatusmessage.cpp.

void Kopete::StatusMessage::addMetaData ( const QHash< QString, QVariant > &  otherHash  ) 

Add a hash of metadata to the status message.

If a key already exists, it gets replaced (it doesn't use QHash::unite).;

Parameters:
otherHash The hash to add.

Definition at line 77 of file kopetestatusmessage.cpp.

bool Kopete::StatusMessage::hasMetaData ( const QString &  key  )  const

Check if the status message has the specified metadata.

Parameters:
key Key of the metadata.
Returns:
true if the metadata is present.

Definition at line 86 of file kopetestatusmessage.cpp.

QVariant Kopete::StatusMessage::metaData ( const QString &  key  )  const

Retrieve the specified metadata.

Parameters:
key Key of the metadata
Returns:
The medata value

Definition at line 91 of file kopetestatusmessage.cpp.

void Kopete::StatusMessage::setMessage ( const QString &  message  ) 

Set a new status message.

Parameters:
message New status message.

Definition at line 62 of file kopetestatusmessage.cpp.

QString Kopete::StatusMessage::message (  )  const

Return the current status message.

Returns:
The current status message.

Definition at line 67 of file kopetestatusmessage.cpp.


The documentation for this class was generated from the following files:
  • kopetestatusmessage.h
  • kopetestatusmessage.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