aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-04-15 08:44:29 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-04-15 08:44:29 +0000
commit6596b6d0f23e85c0dbd3c593ccbcb1b90b5855cc (patch)
treeb74b94e5f5a47c702e58f55b6d65a9ae26a9bda3 /source
parentb04c25917bf5954df0e67855fe5e5bdd657daf9a (diff)
downloadqxmpp-6596b6d0f23e85c0dbd3c593ccbcb1b90b5855cc.tar.gz
make QXmppRosterEntry inherit QXmppRosterIq::Item
Diffstat (limited to 'source')
-rw-r--r--source/QXmppRoster.cpp132
-rw-r--r--source/QXmppRoster.h46
2 files changed, 3 insertions, 175 deletions
diff --git a/source/QXmppRoster.cpp b/source/QXmppRoster.cpp
index 06f79430..3020a282 100644
--- a/source/QXmppRoster.cpp
+++ b/source/QXmppRoster.cpp
@@ -130,113 +130,6 @@ void QXmppRoster::rosterRequestIqReceived(const QXmppRosterIq& rosterIq)
}
}
-/// Returns the bareJid of the roster entry.
-///
-/// \return bareJid as a QString
-///
-
-QString QXmppRoster::QXmppRosterEntry::bareJid() const
-{
- return m_bareJid;
-}
-
-/// Returns the name of the roster entry.
-///
-/// \return name as a QString
-///
-
-QString QXmppRoster::QXmppRosterEntry::name() const
-{
- return m_name;
-}
-
-/// Returns the subscription type of the roster entry.
-///
-/// \return QXmppRosterEntry::SubscriptionType
-///
-
-QXmppRoster::QXmppRosterEntry::SubscriptionType
- QXmppRoster::QXmppRosterEntry::subscriptionType() const
-{
- return m_type;
-}
-
-/// Sets the subscription status of the roster entry. It is the "ask"
-/// attribute in the Roster IQ stanza. Its value can be "subscribe" or "unsubscribe"
-/// or empty.
-///
-/// \return subscription status as a QString
-///
-///
-
-QString QXmppRoster::QXmppRosterEntry::subscriptionStatus() const
-{
- return m_subscriptionStatus;
-}
-
-/// Returns the groups of the roster entry.
-///
-/// \return QSet<QString> list of all the groups
-///
-
-QSet<QString> QXmppRoster::QXmppRosterEntry::groups() const
-{
- return m_groups;
-}
-
-/// Sets the bareJid of the roster entry.
-///
-/// \param bareJid as a QString
-///
-
-void QXmppRoster::QXmppRosterEntry::setBareJid(const QString& bareJid )
-{
- m_bareJid = bareJid ;
-}
-
-/// Sets the name of the roster entry.
-///
-/// \param name as a QString
-///
-
-void QXmppRoster::QXmppRosterEntry::setName(const QString& name)
-{
- m_name = name;
-}
-
-/// Sets the subscription type of the roster entry.
-///
-/// \param type as a QXmppRosterEntry::SubscriptionType
-///
-
-void QXmppRoster::QXmppRosterEntry::setSubscriptionType(
- QXmppRosterEntry::SubscriptionType type)
-{
- m_type = type;
-}
-
-/// Sets the subscription status of the roster entry. It is the "ask"
-/// attribute in the Roster IQ stanza. Its value can be "subscribe" or "unsubscribe"
-/// or empty.
-///
-/// \param status as a QString
-///
-
-void QXmppRoster::QXmppRosterEntry::setSubscriptionStatus(const QString& status)
-{
- m_subscriptionStatus = status;
-}
-
-/// Sets the groups of the roster entry.
-///
-/// \param groups list of all the groups as a QSet<QString>
-///
-
-void QXmppRoster::QXmppRosterEntry::setGroups(const QSet<QString>& groups)
-{
- m_groups = groups;
-}
-
/// Function to get all the bareJids present in the roster.
///
/// \return QStringList list of all the bareJids
@@ -354,28 +247,3 @@ bool QXmppRoster::isRosterReceived()
return m_isRosterReceived;
}
-QString QXmppRoster::QXmppRosterEntry::getBareJid() const
-{
- return m_bareJid;
-}
-
-QString QXmppRoster::QXmppRosterEntry::getName() const
-{
- return m_name;
-}
-
-QXmppRoster::QXmppRosterEntry::SubscriptionType
- QXmppRoster::QXmppRosterEntry::getSubscriptionType() const
-{
- return m_type;
-}
-
-QString QXmppRoster::QXmppRosterEntry::getSubscriptionStatus() const
-{
- return m_subscriptionStatus;
-}
-
-QSet<QString> QXmppRoster::QXmppRosterEntry::getGroups() const
-{
- return m_groups;
-}
diff --git a/source/QXmppRoster.h b/source/QXmppRoster.h
index 3dccd056..e4342fbd 100644
--- a/source/QXmppRoster.h
+++ b/source/QXmppRoster.h
@@ -30,6 +30,7 @@
#include <QStringList>
#include "QXmppClient.h"
+#include "QXmppRosterIq.h"
class QXmppRosterIq;
class QXmppPresence;
@@ -62,50 +63,9 @@ class QXmppRoster : public QObject
Q_OBJECT
public:
- class QXmppRosterEntry
+ // FIXME : is this class really necessary?
+ class QXmppRosterEntry : public QXmppRosterIq::Item
{
- public:
- /// An enumeration for type of subscription with the bareJid in the roster.
- enum SubscriptionType
- {
- None = 1, ///< the user does not have a subscription to the
- ///< contact's presence information, and the contact does
- ///< not have a subscription to the user's presence information
- Both, ///< both the user and the contact have subscriptions to each
- ///< other's presence information
- From, ///< the contact has a subscription to the user's presence information,
- ///< but the user does not have a subscription to the contact's presence information
- To, ///< the user has a subscription to the contact's presence information,
- ///< but the contact does not have a subscription to the user's presence information
- Remove ///< to delete a roster item
- };
-
- QString bareJid() const;
- QString name() const;
- QXmppRosterEntry::SubscriptionType subscriptionType() const;
- QString subscriptionStatus() const;
- QSet<QString> groups() const;
-
- void setBareJid(const QString&);
- void setName(const QString&);
- void setSubscriptionType(QXmppRosterEntry::SubscriptionType);
- void setSubscriptionStatus(const QString&);
- void setGroups(const QSet<QString>&);
-
-// deprecated accessors, use the form without "get" instead
- QString Q_DECL_DEPRECATED getBareJid() const;
- QString Q_DECL_DEPRECATED getName() const;
- QXmppRosterEntry::SubscriptionType Q_DECL_DEPRECATED getSubscriptionType() const;
- QString Q_DECL_DEPRECATED getSubscriptionStatus() const;
- QSet<QString> Q_DECL_DEPRECATED getGroups() const;
-
- private:
- QString m_bareJid;
- SubscriptionType m_type;
- QString m_name;
- // can be subscribe/unsubscribe (attribute "ask")
- QString m_subscriptionStatus;
- QSet<QString> m_groups;
};
QXmppRoster(QXmppStream* stream);