Microblog Library
Microblog::StatusItem Class Reference
This class is a representation of one Dent or Tweet. More...
#include <statusitem.h>
Public Member Functions | |
QByteArray | data () const |
QDateTime | date () const |
qlonglong | id () const |
QStringList | keys () const |
StatusItem | operator= (const StatusItem &) |
void | setData (const QByteArray &) |
StatusItem (const StatusItem &) | |
StatusItem (const QByteArray &) | |
StatusItem () | |
QString | text () const |
QString | value (const QString &) const |
~StatusItem () |
Detailed Description
This class is a representation of one Dent or Tweet.It is filled with xml which the REST API from ident.ca or Teitter and parses it and gives back the values. Also include ares some convenience functions.
For example to get from an Akonadi::Item to the date of a tweet:
Akonadi::Item item = itemForIndex( index ); if ( item.hasPayload<Akonadi::StatusItem>() ) { Microblog::StatusItem msg = item.payload<Akonadi::StatusItem>(); return msg.date(); }
- Since:
- 4.3
Definition at line 50 of file statusitem.h.
Constructor & Destructor Documentation
StatusItem::StatusItem | ( | ) |
StatusItem::StatusItem | ( | const QByteArray & | data | ) | [explicit] |
Constructor which takes the XML as argument.
The data is parsed instantly, so the other methods of the class are instantly usable.
Definition at line 87 of file statusitem.cpp.
StatusItem::StatusItem | ( | const StatusItem & | other | ) |
StatusItem::~StatusItem | ( | ) |
Member Function Documentation
QByteArray StatusItem::data | ( | ) | const |
QDateTime StatusItem::date | ( | ) | const |
qlonglong StatusItem::id | ( | ) | const |
QStringList StatusItem::keys | ( | ) | const |
StatusItem StatusItem::operator= | ( | const StatusItem & | other | ) |
void StatusItem::setData | ( | const QByteArray & | data | ) |
The call to set the XML data.
After this, the data is parsed instantly, so the other methods of the class are instantly usable.
Definition at line 109 of file statusitem.cpp.
QString StatusItem::text | ( | ) | const |
Gives the text of the tweet or dent.
The result is HTML where links are hrefs and smileys are images.
Definition at line 136 of file statusitem.cpp.
QString StatusItem::value | ( | const QString & | value | ) | const |
Returns the value of a certain key.
The keys can be obtained via keys().
Definition at line 126 of file statusitem.cpp.
The documentation for this class was generated from the following files: