QXmpp: QXmppConfiguration.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
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;
18class QXmppCredentials;
19class QXmppSasl2UserAgent;
20
21namespace QXmpp::Private {
22struct Credentials;
23}
24
36 class QXMPP_EXPORT QXmppConfiguration
37{
38public:
42 enum StreamSecurityMode {
43 TLSEnabled = 0,
44 TLSDisabled,
45 TLSRequired,
49 LegacySSL
50 };
51
55 enum NonSASLAuthMechanism {
56 NonSASLPlain = 0,
57 NonSASLDigest
58 };
59
60 QXmppConfiguration();
61 QXmppConfiguration(const QXmppConfiguration &other);
62 ~QXmppConfiguration();
63 QXmppConfiguration &operator=(const QXmppConfiguration &other);
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
QXmppConfiguration
The QXmppConfiguration class holds configuration options.
Definition QXmppConfiguration.h:37
QXmppConfiguration::host
QString host() const
Returns the custom hostname to connect to.
Definition QXmppConfiguration.cpp:247
QXmppConfiguration::autoAcceptSubscriptions
bool autoAcceptSubscriptions() const
Definition QXmppConfiguration.cpp:414
QXmppConfiguration::setDisabledSaslMechanisms
void setDisabledSaslMechanisms(const QList< QString > &)
Definition QXmppConfiguration.cpp:613
QXmppConfiguration::setResource
void setResource(const QString &)
Definition QXmppConfiguration.cpp:206
QXmppConfiguration::domain
QString domain() const
Returns the domain part of the JID.
Definition QXmppConfiguration.cpp:253
QXmppConfiguration::useSASLAuthentication
bool useSASLAuthentication() const
Returns whether to make use of SASL authentication.
Definition QXmppConfiguration.cpp:512
QXmppConfiguration::saslAuthMechanism
QString saslAuthMechanism() const
Returns the preferred SASL authentication mechanism.
Definition QXmppConfiguration.cpp:564
QXmppConfiguration::networkProxy
QNetworkProxy networkProxy() const
Definition QXmppConfiguration.cpp:659
QXmppConfiguration::setJid
void setJid(const QString &jid)
Definition QXmppConfiguration.cpp:236
QXmppConfiguration::setWindowsLiveAccessToken
void setWindowsLiveAccessToken(const QString &accessToken)
Definition QXmppConfiguration.cpp:403
QXmppConfiguration::setStreamSecurityMode
void setStreamSecurityMode(QXmppConfiguration::StreamSecurityMode mode)
Definition QXmppConfiguration.cpp:544
QXmppConfiguration::streamSecurityMode
QXmppConfiguration::StreamSecurityMode streamSecurityMode() const
Definition QXmppConfiguration.cpp:537
QXmppConfiguration::resourcePrefix
QString resourcePrefix() const
Definition QXmppConfiguration.cpp:216
QXmppConfiguration::port16
quint16 port16() const
Definition QXmppConfiguration.cpp:269
QXmppConfiguration::autoReconnectionEnabled
bool autoReconnectionEnabled() const
Definition QXmppConfiguration.cpp:436
QXmppConfiguration::nonSASLAuthMechanism
QXmppConfiguration::NonSASLAuthMechanism nonSASLAuthMechanism() const
Returns the Non-SASL authentication mechanism configuration.
Definition QXmppConfiguration.cpp:551
QXmppConfiguration::setSaslAuthMechanism
void setSaslAuthMechanism(const QString &mechanism)
Definition QXmppConfiguration.cpp:575
QXmppConfiguration::useSasl2Authentication
bool useSasl2Authentication() const
Definition QXmppConfiguration.cpp:456
QXmppConfiguration::windowsLiveAccessToken
QString windowsLiveAccessToken() const
Returns the access token used for X-MESSENGER-OAUTH2 authentication.
Definition QXmppConfiguration.cpp:392
QXmppConfiguration::setUseSASLAuthentication
void setUseSASLAuthentication(bool)
Sets whether to make use of SASL authentication.
Definition QXmppConfiguration.cpp:518
QXmppConfiguration::keepAliveTimeout
int keepAliveTimeout() const
Definition QXmppConfiguration.cpp:706
QXmppConfiguration::setNetworkProxy
void setNetworkProxy(const QNetworkProxy &proxy)
Definition QXmppConfiguration.cpp:648
QXmppConfiguration::setSasl2UserAgent
void setSasl2UserAgent(const std::optional< QXmppSasl2UserAgent > &)
Definition QXmppConfiguration.cpp:637
QXmppConfiguration::caCertificates
QList< QSslCertificate > caCertificates() const
Returns the a list of trusted CA certificates.
Definition QXmppConfiguration.cpp:718
QXmppConfiguration::user
QString user() const
Returns the localpart of the JID.
Definition QXmppConfiguration.cpp:278
QXmppConfiguration::addDisabledSaslMechanism
void addDisabledSaslMechanism(const QString &)
Definition QXmppConfiguration.cpp:599
QXmppConfiguration::setKeepAliveInterval
void setKeepAliveInterval(int secs)
Definition QXmppConfiguration.cpp:672
QXmppConfiguration::setDomain
void setDomain(const QString &)
Definition QXmppConfiguration.cpp:156
QXmppConfiguration::StreamSecurityMode
StreamSecurityMode
Definition QXmppConfiguration.h:42
QXmppConfiguration::TLSDisabled
@ TLSDisabled
No encryption even if the server offers it.
Definition QXmppConfiguration.h:44
QXmppConfiguration::TLSRequired
@ TLSRequired
Definition QXmppConfiguration.h:45
QXmppConfiguration::TLSEnabled
@ TLSEnabled
Encryption is used if available (default).
Definition QXmppConfiguration.h:43
QXmppConfiguration::LegacySSL
@ LegacySSL
Definition QXmppConfiguration.h:49
QXmppConfiguration::keepAliveInterval
int keepAliveInterval() const
Definition QXmppConfiguration.cpp:682
QXmppConfiguration::operator=
QXmppConfiguration & operator=(const QXmppConfiguration &other)
Assigns other to this QXmppConfiguration.
QXmppConfiguration::facebookAccessToken
QString facebookAccessToken() const
Returns the access token used for X-FACEBOOK-PLATFORM authentication.
Definition QXmppConfiguration.cpp:346
QXmppConfiguration::setUseFastTokenAuthentication
void setUseFastTokenAuthentication(bool)
Definition QXmppConfiguration.cpp:492
QXmppConfiguration::setFacebookAppId
void setFacebookAppId(const QString &)
Sets the application ID used for X-FACEBOOK-PLATFORM authentication.
Definition QXmppConfiguration.cpp:369
QXmppConfiguration::facebookAppId
QString facebookAppId() const
Returns the application ID used for X-FACEBOOK-PLATFORM authentication.
Definition QXmppConfiguration.cpp:363
QXmppConfiguration::setUser
void setUser(const QString &)
Definition QXmppConfiguration.cpp:179
QXmppConfiguration::jidBare
QString jidBare() const
Definition QXmppConfiguration.cpp:316
QXmppConfiguration::setResourcePrefix
void setResourcePrefix(const QString &)
Definition QXmppConfiguration.cpp:226
QXmppConfiguration::setHost
void setHost(const QString &)
Definition QXmppConfiguration.cpp:144
QXmppConfiguration::useFastTokenAuthentication
bool useFastTokenAuthentication() const
Definition QXmppConfiguration.cpp:479
QXmppConfiguration::setCredentials
void setCredentials(const QXmppCredentials &)
Definition QXmppConfiguration.cpp:340
QXmppConfiguration::setNonSASLAuthMechanism
void setNonSASLAuthMechanism(QXmppConfiguration::NonSASLAuthMechanism)
Hints the library the Non-SASL authentication mechanism to be used for authentication.
Definition QXmppConfiguration.cpp:557
QXmppConfiguration::useNonSASLAuthentication
bool useNonSASLAuthentication() const
Returns whether to make use of non-SASL authentication.
Definition QXmppConfiguration.cpp:524
QXmppConfiguration::setUseNonSASLAuthentication
void setUseNonSASLAuthentication(bool)
Sets whether to make use of non-SASL authentication.
Definition QXmppConfiguration.cpp:530
QXmppConfiguration::setPassword
void setPassword(const QString &)
Definition QXmppConfiguration.cpp:189
QXmppConfiguration::setAutoAcceptSubscriptions
void setAutoAcceptSubscriptions(bool)
Definition QXmppConfiguration.cpp:425
QXmppConfiguration::port
int port() const
Returns the port number.
Definition QXmppConfiguration.cpp:259
QXmppConfiguration::disabledSaslMechanisms
QList< QString > disabledSaslMechanisms() const
Definition QXmppConfiguration.cpp:587
QXmppConfiguration::setCaCertificates
void setCaCertificates(const QList< QSslCertificate > &)
Specifies a list of trusted CA certificates.
Definition QXmppConfiguration.cpp:712
QXmppConfiguration::resource
QString resource() const
Returns the resource identifier.
Definition QXmppConfiguration.cpp:290
QXmppConfiguration::sasl2UserAgent
std::optional< QXmppSasl2UserAgent > sasl2UserAgent() const
Definition QXmppConfiguration.cpp:625
QXmppConfiguration::QXmppConfiguration
QXmppConfiguration(const QXmppConfiguration &other)
Creates a copy of other.
QXmppConfiguration::setKeepAliveTimeout
void setKeepAliveTimeout(int secs)
Definition QXmppConfiguration.cpp:696
QXmppConfiguration::QXmppConfiguration
QXmppConfiguration()
Creates a QXmppConfiguration object.
Definition QXmppConfiguration.cpp:124
QXmppConfiguration::NonSASLAuthMechanism
NonSASLAuthMechanism
Definition QXmppConfiguration.h:55
QXmppConfiguration::NonSASLPlain
@ NonSASLPlain
Plain.
Definition QXmppConfiguration.h:56
QXmppConfiguration::NonSASLDigest
@ NonSASLDigest
Digest (default).
Definition QXmppConfiguration.h:57
QXmppConfiguration::googleAccessToken
QString googleAccessToken() const
Returns the access token used for X-OAUTH2 authentication.
Definition QXmppConfiguration.cpp:375
QXmppConfiguration::setUseSasl2Authentication
void setUseSasl2Authentication(bool)
Definition QXmppConfiguration.cpp:466
QXmppConfiguration::password
QString password() const
Returns the password.
Definition QXmppConfiguration.cpp:284
QXmppConfiguration::credentials
QXmppCredentials credentials() const
Definition QXmppConfiguration.cpp:330
QXmppConfiguration::setGoogleAccessToken
void setGoogleAccessToken(const QString &accessToken)
Definition QXmppConfiguration.cpp:386
QXmppConfiguration::setAutoReconnectionEnabled
void setAutoReconnectionEnabled(bool)
Definition QXmppConfiguration.cpp:447
QXmppConfiguration::setFacebookAccessToken
void setFacebookAccessToken(const QString &)
Definition QXmppConfiguration.cpp:357
QXmppConfiguration::setIgnoreSslErrors
void setIgnoreSslErrors(bool)
Definition QXmppConfiguration.cpp:506
QXmppConfiguration::setPort
void setPort(int)
Definition QXmppConfiguration.cpp:167
QXmppConfiguration::jid
QString jid() const
Definition QXmppConfiguration.cpp:301
QXmppConfiguration::ignoreSslErrors
bool ignoreSslErrors() const
Definition QXmppConfiguration.cpp:499
QXmppCredentials
Stores different kinds of credentials used for authentication.
Definition QXmppCredentials.h:19