Loading...
Searching...
No Matches
QXmppVCardManager.h
// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPVCARDMANAGER_H
#define QXMPPVCARDMANAGER_H
#include "QXmppClientExtension.h"
#include <variant>
template<typename T>
class QXmppTask;
class QXmppVCardIq;
class QXmppVCardManagerPrivate;
struct QXmppError;
class QXMPP_EXPORT QXmppVCardManager : public QXmppClientExtension
{
Q_OBJECT
public:
using Result = std::variant<QXmpp::Success, QXmppError>;
using VCardIqResult = std::variant<QXmppVCardIq, QXmppError>;
QXmppVCardManager();
~QXmppVCardManager() override;
QXmppTask<VCardIqResult> fetchVCard(const QString &bareJid);
QXmppTask<Result> setVCard(const QXmppVCardIq &);
QString requestVCard(const QString &bareJid = QString());
const QXmppVCardIq &clientVCard() const;
void setClientVCard(const QXmppVCardIq &);
QString requestClientVCard();
bool isClientVCardReceived() const;
QStringList discoveryFeatures() const override;
bool handleStanza(const QDomElement &element) override;
Q_SIGNALS:
void vCardReceived(const QXmppVCardIq &);
void clientVCardReceived();
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
const std::unique_ptr<QXmppVCardManagerPrivate> d;
};
#endif // QXMPPVCARDMANAGER_H
QXmppClientExtension
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:32
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 client/compat/removed_api.cpp:26
QXmppClient
Main class for starting and managing connections to XMPP servers.
Definition QXmppClient.h:62
QXmppTask
Definition QXmppTask.h:62
QXmppVCardIq
Represents the XMPP vCard.
Definition QXmppVCardIq.h:214
QXmppVCardManager
The QXmppVCardManager class gets/sets XMPP vCards. It is an implementation of XEP-0054: vcard-temp.
Definition QXmppVCardManager.h:43
QXmppVCardManager::VCardIqResult
std::variant< QXmppVCardIq, QXmppError > VCardIqResult
QXmppVCardIq or QXmppError.
Definition QXmppVCardManager.h:50
QXmppVCardManager::vCardReceived
void vCardReceived(const QXmppVCardIq &)
QXmppVCardManager::onUnregistered
void onUnregistered(QXmppClient *client) override
QXmppVCardManager::Result
std::variant< QXmpp::Success, QXmppError > Result
Success or QXmppError.
Definition QXmppVCardManager.h:48
QXmppVCardManager::onRegistered
void onRegistered(QXmppClient *client) override
QXmppVCardManager::clientVCardReceived
void clientVCardReceived()
QXmppError
Definition QXmppError.h:17