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_SIGNAL void vCardReceived(const QXmppVCardIq &);
Q_SIGNAL void clientVCardReceived();
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
const std::unique_ptr<QXmppVCardManagerPrivate> d;
};
#endif // QXMPPVCARDMANAGER_H
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
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
QXmppTask
Definition QXmppTask.h:46
QXmppVCardIq
Represents the XMPP vCard.
Definition QXmppVCardIq.h:217
QXmppVCardManager::vCardReceived
Q_SIGNAL void vCardReceived(const QXmppVCardIq &)
QXmppVCardManager::clientVCardReceived
Q_SIGNAL void clientVCardReceived()
QXmppVCardManager::setVCard
QXmppTask< Result > setVCard(const QXmppVCardIq &)
Definition QXmppVCardManager.cpp:87
QXmppVCardManager::clientVCard
const QXmppVCardIq & clientVCard() const
Returns the vCard of the connected client.
Definition QXmppVCardManager.cpp:108
QXmppVCardManager::requestClientVCard
QString requestClientVCard()
Definition QXmppVCardManager.cpp:129
QXmppVCardManager::VCardIqResult
std::variant< QXmppVCardIq, QXmppError > VCardIqResult
QXmppVCardIq or QXmppError.
Definition QXmppVCardManager.h:50
QXmppVCardManager::setClientVCard
void setClientVCard(const QXmppVCardIq &)
Sets the vCard of the connected client.
Definition QXmppVCardManager.cpp:114
QXmppVCardManager::onUnregistered
void onUnregistered(QXmppClient *client) override
QXmppVCardManager::fetchVCard
QXmppTask< VCardIqResult > fetchVCard(const QString &bareJid)
Definition QXmppVCardManager.cpp:77
QXmppVCardManager::requestVCard
QString requestVCard(const QString &bareJid=QString())
Definition QXmppVCardManager.cpp:102
QXmppVCardManager::Result
std::variant< QXmpp::Success, QXmppError > Result
Success or QXmppError.
Definition QXmppVCardManager.h:48
QXmppVCardManager::onRegistered
void onRegistered(QXmppClient *client) override
QXmppVCardManager::isClientVCardReceived
bool isClientVCardReceived() const
Returns true if vCard of the connected client has been received else false.
Definition QXmppVCardManager.cpp:135
QXmppError
Definition QXmppError.h:17