diff options
| author | Niels Ole Salscheider <niels_ole@salscheider-online.de> | 2016-11-20 12:48:26 +0100 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2017-04-29 16:09:30 +0200 |
| commit | 81691141d4ac136744f2520ca41f45e281902114 (patch) | |
| tree | d750c853694312913c6b5e23c9373c99585cdc85 /src/client/QXmppMamManager.h | |
| parent | 084eb01fb395488a0a3aee799be2b72ce11aa220 (diff) | |
| download | qxmpp-81691141d4ac136744f2520ca41f45e281902114.tar.gz | |
Add QXmppMamManager (XEP-0313)
Diffstat (limited to 'src/client/QXmppMamManager.h')
| -rw-r--r-- | src/client/QXmppMamManager.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/client/QXmppMamManager.h b/src/client/QXmppMamManager.h new file mode 100644 index 00000000..d2c8e315 --- /dev/null +++ b/src/client/QXmppMamManager.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2016-2017 The QXmpp developers + * + * Author: + * Niels Ole Salscheider + * + * Source: + * https://github.com/qxmpp-project/qxmpp + * + * This file is a part of QXmpp library. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + */ + +#ifndef QXMPPMAMMANAGER_H +#define QXMPPMAMMANAGER_H + +#include <QDateTime> + +#include "QXmppClientExtension.h" +#include "QXmppResultSet.h" + +class QXmppMessage; + +/// \brief The QXmppMamManager class makes it possible to access message +/// archives as defined by XEP-0313: Message Archive Management. +/// +/// To make use of this manager, you need to instantiate it and load it into +/// the QXmppClient instance as follows: +/// +/// \code +/// QXmppMamManager *manager = new QXmppMamManager; +/// client->addExtension(manager); +/// \endcode +/// +/// \ingroup Managers + +class QXMPP_EXPORT QXmppMamManager : public QXmppClientExtension +{ + Q_OBJECT + +public: + QString retrieveArchivedMessages(const QString &to = QString(), + const QString &node = QString(), + const QString &jid = QString(), + const QDateTime &start = QDateTime(), + const QDateTime &end = QDateTime(), + const QXmppResultSetQuery &resultSetQuery = QXmppResultSetQuery()); + + /// \cond + QStringList discoveryFeatures() const; + bool handleStanza(const QDomElement &element); + /// \endcond + +signals: + /// This signal is emitted when an archived message is received + void archivedMessageReceived(const QString &queryId, + const QXmppMessage &message); + + /// This signal is emitted when all results for a request have been received + void resultsRecieved(const QString &queryId, + const QXmppResultSetReply &resultSetReply, + bool complete); +}; + +#endif |
