QXmppStanza Class

The QXmppStanza class is the base class for all XMPP stanzas. More...

Header: #include <QXmppStanza.h>
Inherits: QXmppNonza
Inherited By:

QXmppDialback, QXmppIq, QXmppMessage, and QXmppPresence

Public Types

class Error

Public Functions

QXmppStanza(const QString &from = QString(), const QString &to = QString())
QXmppStanza(const QXmppStanza &other)
QXmppStanza(QXmppStanza &&)
virtual ~QXmppStanza() override
(since QXmpp 1.5) std::optional<QXmppE2eeMetadata> e2eeMetadata() const
QXmppStanza::Error error() const
(since QXmpp 1.5) std::optional<QXmppStanza::Error> errorOptional() const
QList<QXmppExtendedAddress> extendedAddresses() const
QXmppElementList extensions() const
QString from() const
QString id() const
QString lang() const
(since QXmpp 1.5) void setE2eeMetadata(const std::optional<QXmppE2eeMetadata> &e2eeMetadata)
void setError(const QXmppStanza::Error &error)
(since QXmpp 1.5) void setError(const std::optional<QXmppStanza::Error> &error)
void setExtendedAddresses(const QList<QXmppExtendedAddress> &addresses)
void setExtensions(const QXmppElementList &extensions)
void setFrom(const QString &from)
void setId(const QString &id)
void setLang(const QString &lang)
void setTo(const QString &to)
QString to() const
QXmppStanza &operator=(QXmppStanza &&)
QXmppStanza &operator=(const QXmppStanza &other)

Detailed Description

Member Function Documentation

QXmppStanza::QXmppStanza(const QString &from = QString(), const QString &to = QString())

Constructs a QXmppStanza with the specified sender from and recipient to.

QXmppStanza::QXmppStanza(const QXmppStanza &other)

Constructs a copy of other.

QXmppStanza::QXmppStanza(QXmppStanza &&)

Move constructor.

[override virtual noexcept] QXmppStanza::~QXmppStanza()

Destroys a QXmppStanza.

[since QXmpp 1.5] std::optional<QXmppE2eeMetadata> QXmppStanza::e2eeMetadata() const

Returns additional data for end-to-end encryption purposes.

This function was introduced in QXmpp 1.5.

See also setE2eeMetadata().

QXmppStanza::Error QXmppStanza::error() const

Returns the stanza's error.

If the stanza has no error a default constructed QXmppStanza::Error is returned.

See also setError().

[since QXmpp 1.5] std::optional<QXmppStanza::Error> QXmppStanza::errorOptional() const

Returns the stanza's error.

This function was introduced in QXmpp 1.5.

QList<QXmppExtendedAddress> QXmppStanza::extendedAddresses() const

Returns the stanza's extended addresses as defined by XEP-0033: Extended Stanza Addressing.

See also setExtendedAddresses().

QXmppElementList QXmppStanza::extensions() const

Returns the stanza's "extensions".

Extensions are XML elements which are not handled internally by QXmpp.

See also setExtensions().

QString QXmppStanza::from() const

Returns the stanza's sender JID.

See also setFrom().

QString QXmppStanza::id() const

Returns the stanza's identifier.

See also setId().

QString QXmppStanza::lang() const

Returns the stanza's language.

See also setLang().

[since QXmpp 1.5] void QXmppStanza::setE2eeMetadata(const std::optional<QXmppE2eeMetadata> &e2eeMetadata)

Sets additional data for end-to-end encryption purposes.

e2eeMetadata.

This function was introduced in QXmpp 1.5.

See also e2eeMetadata().

void QXmppStanza::setError(const QXmppStanza::Error &error)

Sets the stanza's error.

See also error().

[since QXmpp 1.5] void QXmppStanza::setError(const std::optional<QXmppStanza::Error> &error)

Sets the stanza's error.

If you set an empty optional, this will remove the error.

This function was introduced in QXmpp 1.5.

void QXmppStanza::setExtendedAddresses(const QList<QXmppExtendedAddress> &addresses)

Sets the stanza's extended addresses as defined by XEP-0033: Extended Stanza Addressing.

addresses.

See also extendedAddresses().

void QXmppStanza::setExtensions(const QXmppElementList &extensions)

Sets the stanza's extensions.

See also extensions().

void QXmppStanza::setFrom(const QString &from)

Sets the stanza's sender JID to from.

See also from().

void QXmppStanza::setId(const QString &id)

Sets the stanza's identifier to id.

See also id().

void QXmppStanza::setLang(const QString &lang)

Sets the stanza's language to lang.

See also lang().

void QXmppStanza::setTo(const QString &to)

Sets the stanza's recipient JID to to.

See also to().

QString QXmppStanza::to() const

Returns the stanza's recipient JID.

See also setTo().

QXmppStanza &QXmppStanza::operator=(QXmppStanza &&)

Move-assignment operator.

QXmppStanza &QXmppStanza::operator=(const QXmppStanza &other)

Assigns other to this stanza.