kopete/libkopete
Kopete::StatusMessage Class Reference
#include <kopetestatusmessage.h>
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);
Definition at line 48 of file kopetestatusmessage.h.
Public Member Functions | |
| StatusMessage () | |
| StatusMessage (const QString &statusMessage) | |
| StatusMessage (const StatusMessage ©) | |
| ~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 | ( | ) |
| 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 | ( | ) |
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.
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.
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.
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:
KDE 4.0 API Reference