aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppRosterManager.h
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2011-05-18 08:15:45 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2011-05-18 08:15:45 +0000
commit6bee004d52df797e402e9a0c6feb21179f9389e6 (patch)
tree8ae35f3fe5fbf5b26a8aa820c1c106ed11bca198 /src/QXmppRosterManager.h
parentc8d0fcaa4d9887a74acc5174728d927af6c90717 (diff)
downloadqxmpp-6bee004d52df797e402e9a0c6feb21179f9389e6.tar.gz
add signals and slots for managing subscriptions (Closes: #92)
Diffstat (limited to 'src/QXmppRosterManager.h')
-rw-r--r--src/QXmppRosterManager.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/QXmppRosterManager.h b/src/QXmppRosterManager.h
index 2ddf6445..92655bc3 100644
--- a/src/QXmppRosterManager.h
+++ b/src/QXmppRosterManager.h
@@ -22,20 +22,17 @@
*
*/
-#ifndef QXMPPROSTER_H
-#define QXMPPROSTER_H
+#ifndef QXMPPROSTERMANAGER_H
+#define QXMPPROSTERMANAGER_H
#include <QObject>
#include <QMap>
-#include <QSet>
#include <QStringList>
#include "QXmppClientExtension.h"
#include "QXmppPresence.h"
#include "QXmppRosterIq.h"
-class QXmppRosterIq;
-
/// \brief The QXmppRosterManager class provides access to a connected client's roster.
///
/// \note It's object should not be created using it's constructor. Instead
@@ -72,7 +69,6 @@ public:
bool isRosterReceived();
QStringList getRosterBareJids() const;
QXmppRosterIq::Item getRosterEntry(const QString& bareJid) const;
- void removeRosterEntry(const QString &bareJid);
QStringList getResources(const QString& bareJid) const;
QMap<QString, QXmppPresence> getAllPresencesForBareJid(
@@ -84,12 +80,18 @@ public:
bool handleStanza(const QDomElement &element);
/// \endcond
- // deprecated in release 0.2.0
+ // deprecated in release 0.4.0
/// \cond
- QMap<QString, QXmppRosterIq::Item> Q_DECL_DEPRECATED getRosterEntries() const;
- QMap<QString, QMap<QString, QXmppPresence> > Q_DECL_DEPRECATED getAllPresences() const;
+ void Q_DECL_DEPRECATED removeRosterEntry(const QString &bareJid);
/// \endcond
+public slots:
+ bool acceptSubscription(const QString &bareJid);
+ bool refuseSubscription(const QString &bareJid);
+ bool removeItem(const QString &bareJid);
+ bool subscribe(const QString &bareJid);
+ bool unsubscribe(const QString &bareJid);
+
signals:
/// This signal is emitted when the Roster IQ is received after a successful
/// connection. That is the roster entries are empty before this signal is emitted.
@@ -105,6 +107,15 @@ signals:
void rosterChanged(const QString& bareJid);
/// \endcond
+ /// This signal is emitted when a contact asks to subscribe to your presence.
+ ///
+ /// You can either accept the request by calling acceptSubscription() or refuse it
+ /// by calling refuseSubscription().
+ ///
+ /// \note If you set QXmppConfiguration::autoAcceptSubscriptions() to true, this
+ /// signal will not be emitted.
+ void subscriptionReceived(const QString& bareJid);
+
/// This signal is emitted when the roster entry of a particular bareJid is
/// added as a result of roster push.
void itemAdded(const QString& bareJid);