QXmpp: QXmppEntityTimeManager.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppEntityTimeManager.h
1// SPDX-FileCopyrightText: 2010 Manjeet Dahiya <manjeetdahiya@gmail.com>
2// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPENTITYTIMEMANAGER_H
7#define QXMPPENTITYTIMEMANAGER_H
8
9#include "QXmppClientExtension.h"
10
11#include <variant>
12
13template<class T>
14class QXmppTask;
15class QXmppEntityTimeIq;
16struct QXmppError;
17
24 class QXMPP_EXPORT QXmppEntityTimeManager : public QXmppClientExtension
25{
26 Q_OBJECT
27
28public:
29 QString requestTime(const QString &jid);
30
31 using EntityTimeResult = std::variant<QXmppEntityTimeIq, QXmppError>;
32 QXmppTask<EntityTimeResult> requestEntityTime(const QString &jid);
33
35 QStringList discoveryFeatures() const override;
36 bool handleStanza(const QDomElement &element) override;
37 std::variant<QXmppEntityTimeIq, QXmppStanza::Error> handleIq(QXmppEntityTimeIq iq);
39
42 Q_SIGNAL void timeReceived(const QXmppEntityTimeIq &);
43};
44
45#endif // QXMPPENTITYTIMEMANAGER_H
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
QXmppClientExtension::handleStanza
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition client/compat/removed_api.cpp:44
QXmppEntityTimeIq
QXmppEntityTimeIq represents an entity time request/response as defined in XEP-0202: Entity Time.
Definition QXmppEntityTimeIq.h:19
QXmppEntityTimeManager
The QXmppEntityTimeManager class provided the functionality to get the local time of an entity as def...
Definition QXmppEntityTimeManager.h:25
QXmppEntityTimeManager::EntityTimeResult
std::variant< QXmppEntityTimeIq, QXmppError > EntityTimeResult
Definition QXmppEntityTimeManager.h:31
QXmppEntityTimeManager::requestEntityTime
QXmppTask< EntityTimeResult > requestEntityTime(const QString &jid)
Definition QXmppEntityTimeManager.cpp:54
QXmppEntityTimeManager::requestTime
QString requestTime(const QString &jid)
Definition QXmppEntityTimeManager.cpp:39
QXmppEntityTimeManager::timeReceived
Q_SIGNAL void timeReceived(const QXmppEntityTimeIq &)
This signal is emitted when a time response is received. It's not emitted when the QFuture-based requ...
QXmppTask
Definition QXmppTask.h:46
QXmppError
Definition QXmppError.h:17