QXmpp Version: 1.10.0
QXmppConfiguration.h
1// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPCONFIGURATION_H
6#define QXMPPCONFIGURATION_H
7
8#include "QXmppGlobal.h"
9
10#include <optional>
11
12#include <QSharedDataPointer>
13#include <QString>
14
15class QNetworkProxy;
16class QSslCertificate;
17class QXmppConfigurationPrivate;
19class QXmppSasl2UserAgent;
20
21namespace QXmpp::Private {
22struct Credentials;
23}
24
36class QXMPP_EXPORT QXmppConfiguration
37{
38public:
43 TLSEnabled = 0,
45 TLSRequired,
49 LegacySSL
50 };
51
56 NonSASLPlain = 0,
57 NonSASLDigest
58 };
59
64
65 QString host() const;
66 void setHost(const QString &);
67
68 QString domain() const;
69 void setDomain(const QString &);
70
71 int port() const;
72 quint16 port16() const;
73 void setPort(int);
74
75 QString user() const;
76 void setUser(const QString &);
77
78 QString password() const;
79 void setPassword(const QString &);
80
81 QString resource() const;
82 void setResource(const QString &);
83
84 QString resourcePrefix() const;
85 void setResourcePrefix(const QString &);
86
87 QString jid() const;
88 void setJid(const QString &jid);
89
90 QString jidBare() const;
91
92 QXmppCredentials credentials() const;
93 void setCredentials(const QXmppCredentials &);
94
95 QString facebookAccessToken() const;
96 void setFacebookAccessToken(const QString &);
97
98 QString facebookAppId() const;
99 void setFacebookAppId(const QString &);
100
101 QString googleAccessToken() const;
102 void setGoogleAccessToken(const QString &accessToken);
103
104 QString windowsLiveAccessToken() const;
105 void setWindowsLiveAccessToken(const QString &accessToken);
106
107 bool autoAcceptSubscriptions() const;
108 void setAutoAcceptSubscriptions(bool);
109
110 bool autoReconnectionEnabled() const;
111 void setAutoReconnectionEnabled(bool);
112
113 bool useSasl2Authentication() const;
114 void setUseSasl2Authentication(bool);
115
116 bool useFastTokenAuthentication() const;
117 void setUseFastTokenAuthentication(bool);
118
119 bool useSASLAuthentication() const;
120 void setUseSASLAuthentication(bool);
121
122 bool useNonSASLAuthentication() const;
123 void setUseNonSASLAuthentication(bool);
124
125 bool ignoreSslErrors() const;
126 void setIgnoreSslErrors(bool);
127
128 QXmppConfiguration::StreamSecurityMode streamSecurityMode() const;
129 void setStreamSecurityMode(QXmppConfiguration::StreamSecurityMode mode);
130
131 QXmppConfiguration::NonSASLAuthMechanism nonSASLAuthMechanism() const;
132 void setNonSASLAuthMechanism(QXmppConfiguration::NonSASLAuthMechanism);
133
134 QString saslAuthMechanism() const;
135 void setSaslAuthMechanism(const QString &mechanism);
136
137 QList<QString> disabledSaslMechanisms() const;
138 void addDisabledSaslMechanism(const QString &);
139 void setDisabledSaslMechanisms(const QList<QString> &);
140
141 std::optional<QXmppSasl2UserAgent> sasl2UserAgent() const;
142 void setSasl2UserAgent(const std::optional<QXmppSasl2UserAgent> &);
143
144 QNetworkProxy networkProxy() const;
145 void setNetworkProxy(const QNetworkProxy &proxy);
146
147 int keepAliveInterval() const;
148 void setKeepAliveInterval(int secs);
149
150 int keepAliveTimeout() const;
151 void setKeepAliveTimeout(int secs);
152
153 QList<QSslCertificate> caCertificates() const;
154 void setCaCertificates(const QList<QSslCertificate> &);
155
157 const QXmpp::Private::Credentials &credentialData() const;
158 QXmpp::Private::Credentials &credentialData();
160
161private:
162 QSharedDataPointer<QXmppConfigurationPrivate> d;
163};
164
165#endif // QXMPPCONFIGURATION_H
The QXmppConfiguration class holds configuration options.
Definition: QXmppConfiguration.h:37
StreamSecurityMode
Definition: QXmppConfiguration.h:42
@ TLSDisabled
No encryption even if the server offers it.
Definition: QXmppConfiguration.h:44
QXmppConfiguration & operator=(const QXmppConfiguration &other)
Assigns other to this QXmppConfiguration.
QXmppConfiguration(const QXmppConfiguration &other)
Creates a copy of other.
NonSASLAuthMechanism
Definition: QXmppConfiguration.h:55
Stores different kinds of credentials used for authentication.
Definition: QXmppCredentials.h:19