Loading...
Searching...
No Matches
QXmppConfiguration.h
// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPCONFIGURATION_H
#define QXMPPCONFIGURATION_H
#include "QXmppGlobal.h"
#include <optional>
#include <QSharedDataPointer>
#include <QString>
class QNetworkProxy;
class QSslCertificate;
class QXmppConfigurationPrivate;
class QXmppCredentials;
class QXmppSasl2UserAgent;
namespace QXmpp::Private {
struct Credentials;
}
class QXMPP_EXPORT QXmppConfiguration
{
public:
enum StreamSecurityMode {
TLSEnabled = 0,
TLSDisabled,
TLSRequired,
LegacySSL
};
enum NonSASLAuthMechanism {
NonSASLPlain = 0,
NonSASLDigest
};
QXmppConfiguration();
QXmppConfiguration(const QXmppConfiguration &other);
~QXmppConfiguration();
QXmppConfiguration &operator=(const QXmppConfiguration &other);
QString host() const;
void setHost(const QString &);
QString domain() const;
void setDomain(const QString &);
int port() const;
quint16 port16() const;
void setPort(int);
QString user() const;
void setUser(const QString &);
QString password() const;
void setPassword(const QString &);
QString resource() const;
void setResource(const QString &);
QString resourcePrefix() const;
void setResourcePrefix(const QString &);
QString jid() const;
void setJid(const QString &jid);
QString jidBare() const;
QXmppCredentials credentials() const;
void setCredentials(const QXmppCredentials &);
QString facebookAccessToken() const;
void setFacebookAccessToken(const QString &);
QString facebookAppId() const;
void setFacebookAppId(const QString &);
QString googleAccessToken() const;
void setGoogleAccessToken(const QString &accessToken);
QString windowsLiveAccessToken() const;
void setWindowsLiveAccessToken(const QString &accessToken);
bool autoAcceptSubscriptions() const;
void setAutoAcceptSubscriptions(bool);
bool autoReconnectionEnabled() const;
void setAutoReconnectionEnabled(bool);
bool useSasl2Authentication() const;
void setUseSasl2Authentication(bool);
bool useFastTokenAuthentication() const;
void setUseFastTokenAuthentication(bool);
bool useSASLAuthentication() const;
void setUseSASLAuthentication(bool);
bool useNonSASLAuthentication() const;
void setUseNonSASLAuthentication(bool);
bool ignoreSslErrors() const;
void setIgnoreSslErrors(bool);
QXmppConfiguration::StreamSecurityMode streamSecurityMode() const;
void setStreamSecurityMode(QXmppConfiguration::StreamSecurityMode mode);
QXmppConfiguration::NonSASLAuthMechanism nonSASLAuthMechanism() const;
void setNonSASLAuthMechanism(QXmppConfiguration::NonSASLAuthMechanism);
QString saslAuthMechanism() const;
void setSaslAuthMechanism(const QString &mechanism);
QList<QString> disabledSaslMechanisms() const;
void addDisabledSaslMechanism(const QString &);
void setDisabledSaslMechanisms(const QList<QString> &);
std::optional<QXmppSasl2UserAgent> sasl2UserAgent() const;
void setSasl2UserAgent(const std::optional<QXmppSasl2UserAgent> &);
QNetworkProxy networkProxy() const;
void setNetworkProxy(const QNetworkProxy &proxy);
int keepAliveInterval() const;
void setKeepAliveInterval(int secs);
int keepAliveTimeout() const;
void setKeepAliveTimeout(int secs);
QList<QSslCertificate> caCertificates() const;
void setCaCertificates(const QList<QSslCertificate> &);
const QXmpp::Private::Credentials &credentialData() const;
QXmpp::Private::Credentials &credentialData();
private:
QSharedDataPointer<QXmppConfigurationPrivate> d;
};
#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