blob: a807caad39c9bb89f056443527a294a87f5e5030 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// SPDX-FileCopyrightText: 2010 Manjeet Dahiya <manjeetdahiya@gmail.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPENTITYTIMEMANAGER_H
#define QXMPPENTITYTIMEMANAGER_H
#include "QXmppClientExtension.h"
#include <variant>
template<class T>
class QFuture;
class QXmppEntityTimeIq;
///
/// \brief The QXmppEntityTimeManager class provided the functionality to get
/// the local time of an entity as defined by \xep{0202}: Entity Time.
///
/// \ingroup Managers
///
class QXMPP_EXPORT QXmppEntityTimeManager : public QXmppClientExtension
{
Q_OBJECT
public:
QString requestTime(const QString &jid);
using EntityTimeResult = std::variant<QXmppEntityTimeIq, QXmppStanza::Error>;
QFuture<EntityTimeResult> requestEntityTime(const QString &jid);
/// \cond
QStringList discoveryFeatures() const override;
bool handleStanza(const QDomElement &element) override;
std::variant<QXmppEntityTimeIq, QXmppStanza::Error> handleIq(QXmppEntityTimeIq iq);
/// \endcond
Q_SIGNALS:
/// \brief This signal is emitted when a time response is received. It's not
/// emitted when the QFuture-based request is used.
void timeReceived(const QXmppEntityTimeIq &);
};
#endif // QXMPPENTITYTIMEMANAGER_H
|