From d6694d3db35a553c8930bba083fcc3f5ed4ff124 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Sat, 21 Jul 2012 12:57:00 +0200 Subject: add simpler accessors for QXmppPresence priority / statusText --- src/base/QXmppPresence.cpp | 30 ++++++++++++++++++++++++++++++ src/base/QXmppPresence.h | 6 ++++++ 2 files changed, 36 insertions(+) (limited to 'src/base') diff --git a/src/base/QXmppPresence.cpp b/src/base/QXmppPresence.cpp index 6351bac8..780ec532 100644 --- a/src/base/QXmppPresence.cpp +++ b/src/base/QXmppPresence.cpp @@ -51,6 +51,36 @@ QXmppPresence::~QXmppPresence() } +/// Returns the priority level of the resource. + +int QXmppPresence::priority() const +{ + return m_status.priority(); +} + +/// Sets the \a priority level of the resource. + +void QXmppPresence::setPriority(int priority) +{ + m_status.setPriority(priority); +} + +/// Returns the status text, a textual description of the user's status. + +QString QXmppPresence::statusText() const +{ + return m_status.statusText(); +} + +/// Sets the status text, a textual description of the user's status. +/// +/// \param str The status text, for example "Gone fishing". + +void QXmppPresence::setStatusText(const QString& statusText) +{ + m_status.setStatusText(statusText); +} + /// Returns the presence type. /// /// You can use this method to determine the action which needs to be diff --git a/src/base/QXmppPresence.h b/src/base/QXmppPresence.h index fe6710a9..e327a75b 100644 --- a/src/base/QXmppPresence.h +++ b/src/base/QXmppPresence.h @@ -109,6 +109,9 @@ public: const QXmppPresence::Status& status = QXmppPresence::Status()); ~QXmppPresence(); + int priority() const; + void setPriority(int priority); + QXmppPresence::Type type() const; void setType(QXmppPresence::Type); @@ -116,6 +119,9 @@ public: const QXmppPresence::Status& status() const; void setStatus(const QXmppPresence::Status&); + QString statusText() const; + void setStatusText(const QString& statusText); + /// \cond void parse(const QDomElement &element); void toXml(QXmlStreamWriter *writer) const; -- cgit v1.2.3