diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-07-19 11:18:58 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-07-19 11:18:58 +0000 |
| commit | d2584fb73d640221090b041eab5ae947513e7d12 (patch) | |
| tree | 7d04e3feff36780345ed27bc4bc80e535c4bc274 /source | |
| parent | 479ca0e6664125505350512da57c7188c7fa0d55 (diff) | |
| download | qxmpp-d2584fb73d640221090b041eab5ae947513e7d12.tar.gz | |
rename QXmppRoster to QXmppRosterManager
Diffstat (limited to 'source')
| -rw-r--r-- | source/QXmppClient.cpp | 16 | ||||
| -rw-r--r-- | source/QXmppClient.h | 14 | ||||
| -rw-r--r-- | source/QXmppRoster.cpp | 40 | ||||
| -rw-r--r-- | source/QXmppRoster.h | 20 |
4 files changed, 46 insertions, 44 deletions
diff --git a/source/QXmppClient.cpp b/source/QXmppClient.cpp index 518bd0e7..fa4836d9 100644 --- a/source/QXmppClient.cpp +++ b/source/QXmppClient.cpp @@ -25,7 +25,6 @@ #include "QXmppClient.h" #include "QXmppLogger.h" #include "QXmppStream.h" -#include "QXmppRoster.h" #include "QXmppMessage.h" #include "QXmppArchiveManager.h" @@ -35,6 +34,7 @@ #include "QXmppReconnectionManager.h" #include "QXmppRpcIq.h" #include "QXmppRemoteMethod.h" +#include "QXmppRoster.h" #include "QXmppUtils.h" #include "QXmppTransferManager.h" #include "QXmppVCardManager.h" @@ -49,7 +49,7 @@ /// establishment of the XMPP connection and provide a number of high-level /// "managers" to perform specific tasks: /// -/// \sa QXmppRoster +/// \sa QXmppRosterManager /// \sa QXmppVCardManager /// \sa QXmppTransferManager /// @@ -121,7 +121,7 @@ QXmppClient::QXmppClient(QObject *parent) Q_ASSERT(check); // create managers - m_roster = new QXmppRoster(m_stream, this); + m_rosterManager = new QXmppRosterManager(m_stream, this); m_archiveManager = new QXmppArchiveManager(m_stream, this); m_callManager = new QXmppCallManager(m_stream, this); m_mucManager = new QXmppMucManager(m_stream, this); @@ -294,14 +294,14 @@ bool QXmppClient::isConnected() const return m_stream && m_stream->isConnected(); } -/// Returns the reference to QXmppRoster object of the client. +/// Returns the reference to QXmppRosterManager object of the client. /// \return Reference to the roster object of the connected client. Use this to /// get the list of friends in the roster and their presence information. /// -QXmppRoster& QXmppClient::rosterManager() +QXmppRosterManager& QXmppClient::rosterManager() { - return *m_roster; + return *m_rosterManager; } /// Utility function to send message to all the resources associated with the @@ -617,9 +617,9 @@ void QXmppClient::xmppConnected() // obsolete -QXmppRoster& QXmppClient::getRoster() +QXmppRosterManager& QXmppClient::getRoster() { - return *m_roster; + return *m_rosterManager; } QAbstractSocket::SocketError QXmppClient::getSocketError() diff --git a/source/QXmppClient.h b/source/QXmppClient.h index 3752f6fa..c491921a 100644 --- a/source/QXmppClient.h +++ b/source/QXmppClient.h @@ -49,7 +49,7 @@ class QXmppCallManager; class QXmppDiscoveryIq; class QXmppMucManager; class QXmppReconnectionManager; -class QXmppRoster; +class QXmppRosterManager; class QXmppTransferManager; class QXmppVCardManager; @@ -62,7 +62,7 @@ class QXmppVCardManager; /// It provides the user all the required functionality to connect to the server /// and perform operations afterwards. /// -/// This class will provide the handle/reference to QXmppRoster (roster management), +/// This class will provide the handle/reference to QXmppRosterManager (roster management), /// QXmppVCardManager (vCard manager), QXmppReconnectionManager (reconnection /// mechanism) and QXmppTransferManager (file transfers). /// @@ -119,7 +119,7 @@ public: QXmppArchiveManager& archiveManager(); QXmppCallManager& callManager(); QXmppMucManager& mucManager(); - QXmppRoster& rosterManager(); + QXmppRosterManager& rosterManager(); QXmppTransferManager& transferManager(); QXmppVCardManager& vCardManager(); @@ -149,7 +149,7 @@ public: const QVariant &arg10 = QVariant() ); // deprecated accessors, use the form without "get" instead - QXmppRoster Q_DECL_DEPRECATED & getRoster(); + QXmppRosterManager Q_DECL_DEPRECATED & getRoster(); QXmppVCardManager Q_DECL_DEPRECATED & getVCardManager(); QAbstractSocket::SocketError Q_DECL_DEPRECATED getSocketError(); QXmppStanza::Error::Condition Q_DECL_DEPRECATED getXmppStreamError(); @@ -173,8 +173,8 @@ signals: /// /// After the connected() signal is emitted QXmpp will send the roster request /// to the server. On receiving the roster, QXmpp will emit - /// QXmppRoster::rosterReceived(). After this signal, QXmppRoster object gets - /// populated and you can use rosterManager() to get the handle of QXmppRoster object. + /// QXmppRosterManager::rosterReceived(). After this signal, QXmppRosterManager object gets + /// populated and you can use rosterManager() to get the handle of QXmppRosterManager object. /// void connected(); @@ -247,7 +247,7 @@ private: QXmppCallManager *m_callManager; ///< Pointer to the call manager QXmppMucManager* m_mucManager; ///< Pointer to the multi-user chat manager QXmppReconnectionManager* m_reconnectionManager; ///< Pointer to the reconnection manager - QXmppRoster *m_roster; ///< Pointer to the roster manager + QXmppRosterManager *m_rosterManager; ///< Pointer to the roster manager QXmppTransferManager *m_transferManager;///< Pointer to the transfer manager QXmppVCardManager *m_vCardManager; ///< Pointer to the vCard manager QHash<QString,QXmppInvokable *> m_interfaces; diff --git a/source/QXmppRoster.cpp b/source/QXmppRoster.cpp index 16b1bf89..244f9fb0 100644 --- a/source/QXmppRoster.cpp +++ b/source/QXmppRoster.cpp @@ -29,7 +29,7 @@ #include "QXmppPresence.h" #include "QXmppStream.h" -QXmppRoster::QXmppRoster(QXmppStream* stream, QObject *parent) +QXmppRosterManager::QXmppRosterManager(QXmppStream* stream, QObject *parent) : QObject(parent), m_stream(stream), m_isRosterReceived(false) @@ -51,14 +51,14 @@ QXmppRoster::QXmppRoster(QXmppStream* stream, QObject *parent) Q_ASSERT(check); } -QXmppRoster::~QXmppRoster() +QXmppRosterManager::~QXmppRosterManager() { } /// Upon XMPP connection, request the roster. /// -void QXmppRoster::connected() +void QXmppRosterManager::connected() { QXmppRosterIq roster; roster.setType(QXmppIq::Get); @@ -67,14 +67,14 @@ void QXmppRoster::connected() m_stream->sendPacket(roster); } -void QXmppRoster::disconnected() +void QXmppRosterManager::disconnected() { - m_entries = QMap<QString, QXmppRoster::QXmppRosterEntry>(); + m_entries = QMap<QString, QXmppRosterManager::QXmppRosterEntry>(); m_presences = QMap<QString, QMap<QString, QXmppPresence> >(); m_isRosterReceived = false; } -void QXmppRoster::presenceReceived(const QXmppPresence& presence) +void QXmppRosterManager::presenceReceived(const QXmppPresence& presence) { QString jid = presence.from(); QString bareJid = jidToBareJid(jid); @@ -102,7 +102,7 @@ void QXmppRoster::presenceReceived(const QXmppPresence& presence) } } -void QXmppRoster::rosterIqReceived(const QXmppRosterIq& rosterIq) +void QXmppRosterManager::rosterIqReceived(const QXmppRosterIq& rosterIq) { bool isInitial = (m_rosterReqId == rosterIq.id()); @@ -161,38 +161,38 @@ void QXmppRoster::rosterIqReceived(const QXmppRosterIq& rosterIq) /// \return QStringList list of all the bareJids /// -QStringList QXmppRoster::getRosterBareJids() const +QStringList QXmppRosterManager::getRosterBareJids() const { return m_entries.keys(); } /// Returns the roster entry of the given bareJid. If the bareJid is not in the -/// database and empty QXmppRoster::QXmppRosterEntry will be returned. +/// database and empty QXmppRosterManager::QXmppRosterEntry will be returned. /// /// \param bareJid as a QString -/// \return QXmppRoster::QXmppRosterEntry +/// \return QXmppRosterManager::QXmppRosterEntry /// -QXmppRoster::QXmppRosterEntry QXmppRoster::getRosterEntry( +QXmppRosterManager::QXmppRosterEntry QXmppRosterManager::getRosterEntry( const QString& bareJid) const { // will return blank entry if bareJid does'nt exist if(m_entries.contains(bareJid)) return m_entries.value(bareJid); else - return QXmppRoster::QXmppRosterEntry(); + return QXmppRosterManager::QXmppRosterEntry(); } /// [OBSOLETE] Returns all the roster entries in the database. /// -/// \return Map of bareJid and its respective QXmppRoster::QXmppRosterEntry +/// \return Map of bareJid and its respective QXmppRosterManager::QXmppRosterEntry /// /// \note This function is obsolete, use getRosterBareJids() and /// getRosterEntry() to get all the roster entries. /// -QMap<QString, QXmppRoster::QXmppRosterEntry> - QXmppRoster::getRosterEntries() const +QMap<QString, QXmppRosterManager::QXmppRosterEntry> + QXmppRosterManager::getRosterEntries() const { return m_entries; } @@ -203,7 +203,7 @@ QMap<QString, QXmppRoster::QXmppRosterEntry> /// \return list of associated resources as a QStringList /// -QStringList QXmppRoster::getResources(const QString& bareJid) const +QStringList QXmppRosterManager::getResources(const QString& bareJid) const { if(m_presences.contains(bareJid)) return m_presences[bareJid].keys(); @@ -219,7 +219,7 @@ QStringList QXmppRoster::getResources(const QString& bareJid) const /// \return Map of resource and its respective presence QMap<QString, QXmppPresence> /// -QMap<QString, QXmppPresence> QXmppRoster::getAllPresencesForBareJid( +QMap<QString, QXmppPresence> QXmppRosterManager::getAllPresencesForBareJid( const QString& bareJid) const { if(m_presences.contains(bareJid)) @@ -235,7 +235,7 @@ QMap<QString, QXmppPresence> QXmppRoster::getAllPresencesForBareJid( /// \return QXmppPresence /// -QXmppPresence QXmppRoster::getPresence(const QString& bareJid, +QXmppPresence QXmppRosterManager::getPresence(const QString& bareJid, const QString& resource) const { if(m_presences.contains(bareJid) && m_presences[bareJid].contains(resource)) @@ -253,7 +253,7 @@ QXmppPresence QXmppRoster::getPresence(const QString& bareJid, /// and getPresence() or getAllPresencesForBareJid() /// to get all the presence entries. -QMap<QString, QMap<QString, QXmppPresence> > QXmppRoster::getAllPresences() const +QMap<QString, QMap<QString, QXmppPresence> > QXmppRosterManager::getAllPresences() const { return m_presences; } @@ -262,7 +262,7 @@ QMap<QString, QMap<QString, QXmppPresence> > QXmppRoster::getAllPresences() cons /// /// \return true if roster received else false -bool QXmppRoster::isRosterReceived() +bool QXmppRosterManager::isRosterReceived() { return m_isRosterReceived; } diff --git a/source/QXmppRoster.h b/source/QXmppRoster.h index 60167340..26f9daa2 100644 --- a/source/QXmppRoster.h +++ b/source/QXmppRoster.h @@ -36,7 +36,7 @@ class QXmppRosterIq; class QXmppPresence; class QXmppStream; -/// \brief The QXmppRoster class provides access to a connected client's roster. +/// \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 /// QXmppClient::rosterManager() should be used to get the reference of instantiated @@ -49,10 +49,10 @@ class QXmppStream; /// /// After the sucessfull xmpp connection that after the signal QXmppClient::connected() /// is emitted QXmpp requests for getting the roster. Once QXmpp receives the roster -/// the signal QXmppRoster::rosterReceived() is emitted and after that user can +/// the signal QXmppRosterManager::rosterReceived() is emitted and after that user can /// use the functions of this class to get roster entries. /// -/// Function QXmppRoster::isRosterReceived() tells whether the roster has been +/// Function QXmppRosterManager::isRosterReceived() tells whether the roster has been /// received or not. /// /// Signals presenceChanged() or rosterChanged() are emitted whenever presence @@ -60,7 +60,7 @@ class QXmppStream; /// /// \ingroup Managers -class QXmppRoster : public QObject +class QXmppRosterManager : public QObject { Q_OBJECT @@ -68,12 +68,12 @@ public: // FIXME : is this class really necessary? typedef QXmppRosterIq::Item QXmppRosterEntry; - QXmppRoster(QXmppStream* stream, QObject *parent = 0); - ~QXmppRoster(); + QXmppRosterManager(QXmppStream* stream, QObject *parent = 0); + ~QXmppRosterManager(); bool isRosterReceived(); QStringList getRosterBareJids() const; - QXmppRoster::QXmppRosterEntry getRosterEntry(const QString& bareJid) const; + QXmppRosterManager::QXmppRosterEntry getRosterEntry(const QString& bareJid) const; QStringList getResources(const QString& bareJid) const; QMap<QString, QXmppPresence> getAllPresencesForBareJid( @@ -83,7 +83,7 @@ public: /// \cond - QMap<QString, QXmppRoster::QXmppRosterEntry> Q_DECL_DEPRECATED getRosterEntries() const; + QMap<QString, QXmppRosterManager::QXmppRosterEntry> Q_DECL_DEPRECATED getRosterEntries() const; QMap<QString, QMap<QString, QXmppPresence> > Q_DECL_DEPRECATED getAllPresences() const; /// \endcond @@ -102,7 +102,7 @@ private: //reverse pointer to stream QXmppStream* m_stream; //map of bareJid and its rosterEntry - QMap<QString, QXmppRoster::QXmppRosterEntry> m_entries; + QMap<QString, QXmppRosterManager::QXmppRosterEntry> m_entries; // map of resources of the jid and map of resouces and presences QMap<QString, QMap<QString, QXmppPresence> > m_presences; // flag to store that QXmppRoster has been populated @@ -117,4 +117,6 @@ private slots: void rosterIqReceived(const QXmppRosterIq&); }; +// FIXME : remove this after next release +#define QXmppRoster QXmppRosterManager #endif // QXMPPROSTER_H |
