QXmpp: QXmppVCardManager.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
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
42 class 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
52 QXmppVCardManager();
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
73 Q_SIGNAL void vCardReceived(const QXmppVCardIq &);
74
77 Q_SIGNAL void clientVCardReceived();
78
79protected:
80 void onRegistered(QXmppClient *client) override;
81 void onUnregistered(QXmppClient *client) override;
82
83private:
84 const std::unique_ptr<QXmppVCardManagerPrivate> d;
85};
86
87#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