QXmpp Version: 1.10.0
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
225{
226 Q_OBJECT
227
229 Q_PROPERTY(bool supportedByServer READ supportedByServer NOTIFY supportedByServerChanged)
230
231public:
234
235 QStringList discoveryFeatures() const override;
236
237 void changePassword(const QString &newPassword);
238 void deleteAccount();
239
240 // documentation needs to be here, see https://stackoverflow.com/questions/49192523/
252 bool supportedByServer() const;
253
254 void requestRegistrationForm(const QString &service = {});
255
256 void setRegistrationFormToSend(const QXmppRegisterIq &iq);
257 void setRegistrationFormToSend(const QXmppDataForm &dataForm);
258 void sendCachedRegistrationForm();
259
260 bool registerOnConnectEnabled() const;
261 void setRegisterOnConnectEnabled(bool enabled);
262
264 bool handleStanza(const QDomElement &stanza) override;
266
267Q_SIGNALS:
275
283 void passwordChanged(const QString &newPassword);
284
291
301
306
311
319
335
336protected:
337 void onRegistered(QXmppClient *client) override;
338 void onUnregistered(QXmppClient *client) override;
339
340private:
341 void handleDiscoInfo(const QXmppDiscoveryIq &iq);
342 void setSupportedByServer(bool supportedByServer);
343 void handleAccountDeleted();
344
345 const std::unique_ptr<QXmppRegistrationManagerPrivate> d;
346};
347
348#endif // QXMPPREGISTRATIONMANAGER_H
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:32
virtual QStringList discoveryFeatures() const
Definition: QXmppClientExtension.cpp:22
virtual void onUnregistered(QXmppClient *client)
Definition: QXmppClientExtension.cpp:95
virtual void onRegistered(QXmppClient *client)
Definition: QXmppClientExtension.cpp:85
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition: client/compat/removed_api.cpp:26
Main class for starting and managing connections to XMPP servers.
Definition: QXmppClient.h:62
Definition: QXmppDataForm.h:27
Definition: QXmppDiscoveryIq.h:18
The QXmppRegisterIq class represents a registration IQ as defined by XEP-0077: In-Band Registration.
Definition: QXmppRegisterIq.h:23
The QXmppRegistrationManager class manages in-band registration and account management tasks like cha...
Definition: QXmppRegistrationManager.h:225
void registrationFormReceived(const QXmppRegisterIq &iq)
void passwordChangeFailed(QXmppStanza::Error error)
void passwordChanged(const QString &newPassword)
void registrationFailed(const QXmppStanza::Error &error)
void accountDeletionFailed(QXmppStanza::Error error)
The Error class represents a stanza error.
Definition: QXmppStanza.h:94