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_SIGNAL void supportedByServerChanged();
Q_SIGNAL void passwordChanged(const QString &newPassword);
Q_SIGNAL void passwordChangeFailed(QXmppStanza::Error error);
Q_SIGNAL void registrationFormReceived(const QXmppRegisterIq &iq);
Q_SIGNAL void accountDeleted();
Q_SIGNAL void accountDeletionFailed(QXmppStanza::Error error);
Q_SIGNAL void registrationSucceeded();
Q_SIGNAL void registrationFailed(const QXmppStanza::Error &error);
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
void onConnected();
void setSupportedByServer(bool supportedByServer);
void handleAccountDeleted();
const std::unique_ptr<QXmppRegistrationManagerPrivate> d;
};
#endif // QXMPPREGISTRATIONMANAGER_H
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::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
QXmppDataForm
Definition QXmppDataForm.h:28
QXmppRegisterIq
The QXmppRegisterIq class represents a registration IQ as defined by XEP-0077: In-Band Registration.
Definition QXmppRegisterIq.h:23
QXmppRegistrationManager::supportedByServer
bool supportedByServer
Whether support of XEP-0077: In-band Registration has been discovered on the server.
Definition QXmppRegistrationManager.h:217
QXmppRegistrationManager::registrationFailed
Q_SIGNAL void registrationFailed(const QXmppStanza::Error &error)
QXmppRegistrationManager::deleteAccount
void deleteAccount()
Definition QXmppRegistrationManager.cpp:91
QXmppRegistrationManager::registrationFormReceived
Q_SIGNAL void registrationFormReceived(const QXmppRegisterIq &iq)
QXmppRegistrationManager::changePassword
void changePassword(const QString &newPassword)
Definition QXmppRegistrationManager.cpp:75
QXmppRegistrationManager::registrationSucceeded
Q_SIGNAL void registrationSucceeded()
QXmppRegistrationManager::passwordChangeFailed
Q_SIGNAL void passwordChangeFailed(QXmppStanza::Error error)
QXmppRegistrationManager::supportedByServerChanged
Q_SIGNAL void supportedByServerChanged()
QXmppRegistrationManager::QXmppRegistrationManager
QXmppRegistrationManager()
Default constructor.
Definition QXmppRegistrationManager.cpp:51
QXmppRegistrationManager::passwordChanged
Q_SIGNAL void passwordChanged(const QString &newPassword)
QXmppRegistrationManager::accountDeletionFailed
Q_SIGNAL void accountDeletionFailed(QXmppStanza::Error error)
QXmppRegistrationManager::requestRegistrationForm
void requestRegistrationForm(const QString &service={})
Definition QXmppRegistrationManager.cpp:111
QXmppRegistrationManager::accountDeleted
Q_SIGNAL void accountDeleted()
QXmppStanza::Error
The Error class represents a stanza error.
Definition QXmppStanza.h:112