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

kopete/libkopete

  • Kopete
  • StatusMessage
Public Member Functions | List of all members
Kopete::StatusMessage Class Reference

#include <kopetestatusmessage.h>

Public Member Functions

 StatusMessage ()
 
 StatusMessage (const QString &statusMessage)
 
 StatusMessage (const QString &statusTitle, const QString &statusMessage)
 
 StatusMessage (const StatusMessage &copy)
 
 ~StatusMessage ()
 
void addMetaData (const QString &key, const QVariant &value)
 
void addMetaData (const QHash< QString, QVariant > &otherHash)
 
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)
 
QString title () const
 

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.

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
statusMessagethe 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
statusTitlethe status title.
statusMessagethe 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 QString &  key,
const QVariant &  value 
)

Add a metadata to the status message.

Parameters
keyKey to identity the metadata.
valueValue for the metadata.

Definition at line 80 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
otherHashThe hash to add.

Definition at line 85 of file kopetestatusmessage.cpp.

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

Check if the status message has the specified metadata.

Parameters
keyKey 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
keyKey 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
messageNew status message.

Definition at line 70 of file kopetestatusmessage.cpp.

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

Set a new status title.

Parameters
titleNew 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:20 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