QXmppRegistrationManager.h
/*
* Copyright (C) 2008-2021 The QXmpp developers
*
* Author:
* Melvin Keskin
* Linus Jahn
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#ifndef QXMPPREGISTRATIONMANAGER_H
#define QXMPPREGISTRATIONMANAGER_H
#include "QXmppClientExtension.h"
#include "QXmppRegisterIq.h"
#include <QScopedPointer>
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 setClient(QXmppClient *client) override;
private Q_SLOTS:
void handleDiscoInfo(const QXmppDiscoveryIq &iq);
private:
void setSupportedByServer(bool supportedByServer);
QScopedPointer<QXmppRegistrationManagerPrivate> d;
};
#endif // QXMPPREGISTRATIONMANAGER_H
QXmppClientExtension
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:47
QXmppClientExtension::setClient
virtual void setClient(QXmppClient *client)
Definition: QXmppClientExtension.cpp:79
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition: QXmppClientExtension.cpp:54
QXmppClientExtension::handleStanza
virtual bool handleStanza(const QDomElement &stanza)=0
You need to implement this method to process incoming XMPP stanzas.
QXmppClient
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:94
QXmppDataForm
The QXmppDataForm class represents a data form as defined by XEP-0004: Data Forms.
Definition: QXmppDataForm.h:49
QXmppDiscoveryIq
QXmppDiscoveryIq represents a discovery IQ request or result containing a list of features and other ...
Definition: QXmppDiscoveryIq.h:44
QXmppRegisterIq
The QXmppRegisterIq class represents a registration IQ as defined by XEP-0077: In-Band Registration.
Definition: QXmppRegisterIq.h:42
QXmppRegistrationManager
The QXmppRegistrationManager class manages in-band registration and account management tasks like cha...
Definition: QXmppRegistrationManager.h:243
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:106