QXmpp Version: 1.10.0
QXmppVCardManager.h
1// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPVCARDMANAGER_H
6#define QXMPPVCARDMANAGER_H
7
8#include "QXmppClientExtension.h"
9
10#include <variant>
11
12template<typename T>
13class QXmppTask;
14class QXmppVCardIq;
15class QXmppVCardManagerPrivate;
16struct QXmppError;
17
42class QXMPP_EXPORT QXmppVCardManager : public QXmppClientExtension
43{
44 Q_OBJECT
45
46public:
48 using Result = std::variant<QXmpp::Success, QXmppError>;
50 using VCardIqResult = std::variant<QXmppVCardIq, QXmppError>;
51
53 ~QXmppVCardManager() override;
54
55 QXmppTask<VCardIqResult> fetchVCard(const QString &bareJid);
56 QXmppTask<Result> setVCard(const QXmppVCardIq &);
57
58 QString requestVCard(const QString &bareJid = QString());
59
60 const QXmppVCardIq &clientVCard() const;
61 void setClientVCard(const QXmppVCardIq &);
62
63 QString requestClientVCard();
64 bool isClientVCardReceived() const;
65
67 QStringList discoveryFeatures() const override;
68 bool handleStanza(const QDomElement &element) override;
70
71Q_SIGNALS:
75
79
80protected:
81 void onRegistered(QXmppClient *client) override;
82 void onUnregistered(QXmppClient *client) override;
83
84private:
85 const std::unique_ptr<QXmppVCardManagerPrivate> d;
86};
87
88#endif // QXMPPVCARDMANAGER_H
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:32
virtual QStringList discoveryFeatures() const
Definition: QXmppClientExtension.cpp:22
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition: client/compat/removed_api.cpp:26
Main class for starting and managing connections to XMPP servers.
Definition: QXmppClient.h:62
Definition: QXmppTask.h:62
Represents the XMPP vCard.
Definition: QXmppVCardIq.h:214
The QXmppVCardManager class gets/sets XMPP vCards. It is an implementation of XEP-0054: vcard-temp.
Definition: QXmppVCardManager.h:43
std::variant< QXmppVCardIq, QXmppError > VCardIqResult
QXmppVCardIq or QXmppError.
Definition: QXmppVCardManager.h:50
void vCardReceived(const QXmppVCardIq &)
void onUnregistered(QXmppClient *client) override
std::variant< QXmpp::Success, QXmppError > Result
Success or QXmppError.
Definition: QXmppVCardManager.h:48
void onRegistered(QXmppClient *client) override
void clientVCardReceived()
Definition: QXmppError.h:17