Loading...
Searching...
No Matches
QXmppRegistrationManager.h
// SPDX-FileCopyrightText: 2019 Melvin Keskin <melvo@olomono.de>
// SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPREGISTRATIONMANAGER_H
#define QXMPPREGISTRATIONMANAGER_H
#include "QXmppClientExtension.h"
#include "QXmppRegisterIq.h"
class QXmppRegistrationManagerPrivate;
class QXMPP_EXPORT QXmppRegistrationManager : public QXmppClientExtension
{
Q_OBJECT
Q_PROPERTY(bool supportedByServer READ supportedByServer NOTIFY supportedByServerChanged)
public:
QXmppRegistrationManager();
~QXmppRegistrationManager();
QStringList discoveryFeatures() const override;
void changePassword(const QString &newPassword);
void deleteAccount();
// documentation needs to be here, see https://stackoverflow.com/questions/49192523/
bool supportedByServer() const;
void requestRegistrationForm(const QString &service = {});
void setRegistrationFormToSend(const QXmppRegisterIq &iq);
void setRegistrationFormToSend(const QXmppDataForm &dataForm);
void sendCachedRegistrationForm();
bool registerOnConnectEnabled() const;
void setRegisterOnConnectEnabled(bool enabled);
bool handleStanza(const QDomElement &stanza) override;
Q_SIGNALS:
void supportedByServerChanged();
void passwordChanged(const QString &newPassword);
void passwordChangeFailed(QXmppStanza::Error error);
void registrationFormReceived(const QXmppRegisterIq &iq);
void accountDeleted();
void accountDeletionFailed(QXmppStanza::Error error);
void registrationSucceeded();
void registrationFailed(const QXmppStanza::Error &error);
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
void handleDiscoInfo(const QXmppDiscoveryIq &iq);
void setSupportedByServer(bool supportedByServer);
void handleAccountDeleted();
const std::unique_ptr<QXmppRegistrationManagerPrivate> d;
};
#endif // QXMPPREGISTRATIONMANAGER_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::onUnregistered
virtual void onUnregistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:95
QXmppClientExtension::onRegistered
virtual void onRegistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:85
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
QXmppDataForm
Definition QXmppDataForm.h:27
QXmppDiscoveryIq
Definition QXmppDiscoveryIq.h:18
QXmppRegisterIq
The QXmppRegisterIq class represents a registration IQ as defined by XEP-0077: In-Band Registration.
Definition QXmppRegisterIq.h:23
QXmppRegistrationManager
The QXmppRegistrationManager class manages in-band registration and account management tasks like cha...
Definition QXmppRegistrationManager.h:225
QXmppRegistrationManager::accountDeleted
void accountDeleted()
QXmppRegistrationManager::registrationFormReceived
void registrationFormReceived(const QXmppRegisterIq &iq)
QXmppRegistrationManager::passwordChangeFailed
void passwordChangeFailed(QXmppStanza::Error error)
QXmppRegistrationManager::passwordChanged
void passwordChanged(const QString &newPassword)
QXmppRegistrationManager::registrationFailed
void registrationFailed(const QXmppStanza::Error &error)
QXmppRegistrationManager::accountDeletionFailed
void accountDeletionFailed(QXmppStanza::Error error)
QXmppRegistrationManager::registrationSucceeded
void registrationSucceeded()
QXmppRegistrationManager::supportedByServerChanged
void supportedByServerChanged()
QXmppStanza::Error
The Error class represents a stanza error.
Definition QXmppStanza.h:94