QXmpp: QXmppRegistrationManager.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppRegistrationManager.h
1// SPDX-FileCopyrightText: 2019 Melvin Keskin <melvo@olomono.de>
2// SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPREGISTRATIONMANAGER_H
7#define QXMPPREGISTRATIONMANAGER_H
8
9#include "QXmppClientExtension.h"
10#include "QXmppRegisterIq.h"
11
12class QXmppRegistrationManagerPrivate;
13
212 class QXMPP_EXPORT QXmppRegistrationManager : public QXmppClientExtension
213{
214 Q_OBJECT
215
217 Q_PROPERTY(bool supportedByServer READ supportedByServer NOTIFY supportedByServerChanged)
218
219public:
220 QXmppRegistrationManager();
221 ~QXmppRegistrationManager();
222
223 QStringList discoveryFeatures() const override;
224
225 void changePassword(const QString &newPassword);
226 void deleteAccount();
227
228 // documentation needs to be here, see https://stackoverflow.com/questions/49192523/
240 bool supportedByServer() const;
241
242 void requestRegistrationForm(const QString &service = {});
243
244 void setRegistrationFormToSend(const QXmppRegisterIq &iq);
245 void setRegistrationFormToSend(const QXmppDataForm &dataForm);
246 void sendCachedRegistrationForm();
247
248 bool registerOnConnectEnabled() const;
249 void setRegisterOnConnectEnabled(bool enabled);
250
252 bool handleStanza(const QDomElement &stanza) override;
254
261 Q_SIGNAL void supportedByServerChanged();
262
270 Q_SIGNAL void passwordChanged(const QString &newPassword);
271
277 Q_SIGNAL void passwordChangeFailed(QXmppStanza::Error error);
278
287 Q_SIGNAL void registrationFormReceived(const QXmppRegisterIq &iq);
288
292 Q_SIGNAL void accountDeleted();
293
297 Q_SIGNAL void accountDeletionFailed(QXmppStanza::Error error);
298
305 Q_SIGNAL void registrationSucceeded();
306
321 Q_SIGNAL void registrationFailed(const QXmppStanza::Error &error);
322
323protected:
324 void onRegistered(QXmppClient *client) override;
325 void onUnregistered(QXmppClient *client) override;
326
327private:
328 void onConnected();
329 void setSupportedByServer(bool supportedByServer);
330 void handleAccountDeleted();
331
332 const std::unique_ptr<QXmppRegistrationManagerPrivate> d;
333};
334
335#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