QXmpp Version: 1.10.0
QXmppStreamFeatures.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPSTREAMFEATURES_H
6#define QXMPPSTREAMFEATURES_H
7
8#include "QXmppStanza.h"
9
10#include <QSharedDataPointer>
11
12class QXmppStreamFeaturesPrivate;
13
14namespace QXmpp::Private::Sasl2 {
15struct StreamFeature;
16}
17
22class QXMPP_EXPORT QXmppStreamFeatures : public QXmppNonza
23{
24public:
28 ~QXmppStreamFeatures() override;
29
32
34 enum Mode {
35 Disabled = 0,
36 Enabled,
37 Required
38 };
39
40 Mode bindMode() const;
41 void setBindMode(Mode mode);
42
43 Mode sessionMode() const;
44 void setSessionMode(Mode mode);
45
46 Mode nonSaslAuthMode() const;
47 void setNonSaslAuthMode(Mode mode);
48
49 QStringList authMechanisms() const;
50 void setAuthMechanisms(const QStringList &mechanisms);
51
52 const std::optional<QXmpp::Private::Sasl2::StreamFeature> &sasl2Feature() const;
53 void setSasl2Feature(const std::optional<QXmpp::Private::Sasl2::StreamFeature> &);
54
55 QStringList compressionMethods() const;
56 void setCompressionMethods(const QStringList &methods);
57
58 Mode tlsMode() const;
59 void setTlsMode(Mode mode);
60
61 Mode streamManagementMode() const;
62 void setStreamManagementMode(Mode mode);
63
64 Mode clientStateIndicationMode() const;
65 void setClientStateIndicationMode(Mode mode);
66
67 Mode registerMode() const;
68 void setRegisterMode(const Mode &mode);
69
70 bool preApprovedSubscriptionsSupported() const;
71 void setPreApprovedSubscriptionsSupported(bool);
72
73 bool rosterVersioningSupported() const;
74 void setRosterVersioningSupported(bool);
75
77 void parse(const QDomElement &element) override;
78 void toXml(QXmlStreamWriter *writer) const override;
79
80 static bool isStreamFeatures(const QDomElement &element);
82
83private:
84 QSharedDataPointer<QXmppStreamFeaturesPrivate> d;
85};
86
87#endif
Definition: QXmppNonza.h:14
virtual void parse(const QDomElement &)=0
virtual void toXml(QXmlStreamWriter *writer) const =0
The QXmppStreamFeatures class represents the features returned by an XMPP server or client.
Definition: QXmppStreamFeatures.h:23
QXmppStreamFeatures(const QXmppStreamFeatures &)
Default copy-constructor.
Mode
Mode of a feature.
Definition: QXmppStreamFeatures.h:34
QXmppStreamFeatures(QXmppStreamFeatures &&)
Default move-constructor.
QXmppStreamFeatures & operator=(const QXmppStreamFeatures &)
Default assignment operator.
QXmppStreamFeatures & operator=(QXmppStreamFeatures &&)
Default move-assignment operator.