Loading...
Searching...
No Matches
QXmppEntityTimeManager.h
// SPDX-FileCopyrightText: 2010 Manjeet Dahiya <manjeetdahiya@gmail.com>
// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPENTITYTIMEMANAGER_H
#define QXMPPENTITYTIMEMANAGER_H
#include "QXmppClientExtension.h"
#include <variant>
template<class T>
class QXmppTask;
class QXmppEntityTimeIq;
struct QXmppError;
class QXMPP_EXPORT QXmppEntityTimeManager : public QXmppClientExtension
{
Q_OBJECT
public:
QString requestTime(const QString &jid);
using EntityTimeResult = std::variant<QXmppEntityTimeIq, QXmppError>;
QXmppTask<EntityTimeResult> requestEntityTime(const QString &jid);
QStringList discoveryFeatures() const override;
bool handleStanza(const QDomElement &element) override;
std::variant<QXmppEntityTimeIq, QXmppStanza::Error> handleIq(QXmppEntityTimeIq iq);
Q_SIGNALS:
void timeReceived(const QXmppEntityTimeIq &);
};
#endif // QXMPPENTITYTIMEMANAGER_H
QXmppClientExtension
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:33
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::handleStanza
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition QXmppClientExtension.cpp:51
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::timeReceived
void timeReceived(const QXmppEntityTimeIq &)
This signal is emitted when a time response is received. It's not emitted when the QFuture-based requ...
QXmppEntityTimeManager::EntityTimeResult
std::variant< QXmppEntityTimeIq, QXmppError > EntityTimeResult
Definition QXmppEntityTimeManager.h:31
QXmppTask
Definition QXmppTask.h:62
QXmppError
Definition QXmppError.h:18