• Skip to content
  • Skip to link menu
KDE 4.2 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

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

Constructor & Destructor Documentation

Kopete::StatusMessage::StatusMessage (  ) 

Create a empty status message.

Definition at line 35 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 39 of file kopetestatusmessage.cpp.

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

Create a new status message with the specified status message and title.

Parameters:
statusTitle the status title.
statusMessage the status message.

Definition at line 45 of file kopetestatusmessage.cpp.

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

StatusMessage copy constructor.

Very cheap because the class is implicit shared.

Definition at line 55 of file kopetestatusmessage.cpp.

Kopete::StatusMessage::~StatusMessage (  ) 

StatusMessage destructor.

Definition at line 52 of file kopetestatusmessage.cpp.


Member Function Documentation

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 85 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 80 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 94 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 65 of file kopetestatusmessage.cpp.

QString Kopete::StatusMessage::message (  )  const

Return the current status message.

Returns:
The current status message.

Definition at line 75 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 99 of file kopetestatusmessage.cpp.

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

StatusMessage copy-assignment operator.

Very cheap because the class is implicit shared.

Definition at line 59 of file kopetestatusmessage.cpp.

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

Set a new status message.

Parameters:
message New status message.

Definition at line 70 of file kopetestatusmessage.cpp.

void Kopete::StatusMessage::setTitle ( const QString &  title  ) 

Set a new status title.

Parameters:
title New status title.

Definition at line 104 of file kopetestatusmessage.cpp.

QString Kopete::StatusMessage::title (  )  const

Return the current status title.

Returns:
The current status title.

Definition at line 109 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