QXmpp: QXmppRegisterIq.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppRegisterIq.h
1// SPDX-FileCopyrightText: 2012 Jeremy Lainé <jeremy.laine@m4x.org>
2// SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPREGISTERIQ_H
7#define QXMPPREGISTERIQ_H
8
9#include "QXmppDataForm.h"
10#include "QXmppIq.h"
11
12class QXmppBitsOfBinaryDataList;
13class QXmppRegisterIqPrivate;
14
21
22 class QXMPP_EXPORT QXmppRegisterIq : public QXmppIq
23{
24public:
25 QXmppRegisterIq();
26 QXmppRegisterIq(const QXmppRegisterIq &other);
27 QXmppRegisterIq(QXmppRegisterIq &&);
28 ~QXmppRegisterIq() override;
29
30 QXmppRegisterIq &operator=(const QXmppRegisterIq &other);
31 QXmppRegisterIq &operator=(QXmppRegisterIq &&);
32
33 static QXmppRegisterIq createChangePasswordRequest(const QString &username, const QString &newPassword, const QString &to = {});
34 static QXmppRegisterIq createUnregistrationRequest(const QString &to = {});
35
36 QString email() const;
37 void setEmail(const QString &email);
38
39 QXmppDataForm form() const;
40 void setForm(const QXmppDataForm &form);
41
42 QString instructions() const;
43 void setInstructions(const QString &instructions);
44
45 QString password() const;
46 void setPassword(const QString &username);
47
48 QString username() const;
49 void setUsername(const QString &username);
50
51 bool isRegistered() const;
52 void setIsRegistered(bool isRegistered);
53
54 bool isRemove() const;
55 void setIsRemove(bool isRemove);
56
57 QXmppBitsOfBinaryDataList bitsOfBinaryData() const;
58 QXmppBitsOfBinaryDataList &bitsOfBinaryData();
59 void setBitsOfBinaryData(const QXmppBitsOfBinaryDataList &bitsOfBinaryData);
60
61 QString outOfBandUrl() const;
62 void setOutOfBandUrl(const QString &outOfBandUrl);
63
65 static constexpr std::tuple PayloadXmlTag = { u"query", QXmpp::Private::ns_register };
66 [[deprecated("Use QXmpp::isIqElement()")]]
67 static bool isRegisterIq(const QDomElement &element);
69
70protected:
72 void parseElementFromChild(const QDomElement &element) override;
73 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
75
76private:
77 QSharedDataPointer<QXmppRegisterIqPrivate> d;
78};
79
80#endif
QXmppBitsOfBinaryDataList
Definition QXmppBitsOfBinaryDataList.h:16
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppRegisterIq
The QXmppRegisterIq class represents a registration IQ as defined by XEP-0077: In-Band Registration.
Definition QXmppRegisterIq.h:23
QXmppRegisterIq::username
QString username() const
Returns the username for this registration IQ.
Definition QXmppRegisterIq.cpp:144
QXmppRegisterIq::operator=
QXmppRegisterIq & operator=(const QXmppRegisterIq &other)
Default assignment operator.
QXmppRegisterIq::createChangePasswordRequest
static QXmppRegisterIq createChangePasswordRequest(const QString &username, const QString &newPassword, const QString &to={})
Definition QXmppRegisterIq.cpp:68
QXmppRegisterIq::QXmppRegisterIq
QXmppRegisterIq(QXmppRegisterIq &&)
Default move-constructor.
QXmppRegisterIq::operator=
QXmppRegisterIq & operator=(QXmppRegisterIq &&)
Default move-assignment operator.
QXmppRegisterIq::QXmppRegisterIq
QXmppRegisterIq(const QXmppRegisterIq &other)
Default copy-constructor.
QXmppStanza::to
QString to() const
Definition QXmppStanza.cpp:714