Libksieve

sieveimapaccountsettings.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ksievecore_export.h"
10#include <QDebug>
11namespace KSieveCore
12{
13/**
14 * @brief The SieveImapAccountSettings class
15 * @author Laurent Montel <montel@kde.org>
16 */
17class KSIEVECORE_EXPORT SieveImapAccountSettings
18{
19public:
20 // Keep sync with KIMAP settings.
22 Unencrypted = 0,
23 SSLorTLS, /*!< Use SSL/TLS encryption, KIMAP will automatically negotiate
24 the best supported encryption protocol. */
25 STARTTLS /*!< Use STARTTLS to upgrade an initially plaintext connection to
26 encrypted connection. KIMAP will automatically negotiate
27 the best supported encryption protocol. */
28 };
29
30 enum AuthenticationMode { ClearText = 0, Login, Plain, CramMD5, DigestMD5, NTLM, GSSAPI, Anonymous, XOAuth2 };
31 SieveImapAccountSettings();
32
33 [[nodiscard]] QString identifier() const;
34
35 void setServerName(const QString &serverName);
36 [[nodiscard]] QString serverName() const;
37
38 void setPort(int port);
39 [[nodiscard]] int port() const;
40
41 void setUserName(const QString &userName);
42 [[nodiscard]] QString userName() const;
43
44 void setPassword(const QString &password);
45 [[nodiscard]] QString password() const;
46
47 void setAuthenticationType(KSieveCore::SieveImapAccountSettings::AuthenticationMode type);
48 [[nodiscard]] AuthenticationMode authenticationType() const;
49 [[nodiscard]] bool operator==(const SieveImapAccountSettings &other) const;
50
51 [[nodiscard]] bool isValid() const;
52
53 [[nodiscard]] SieveImapAccountSettings::EncryptionMode encryptionMode() const;
54 void setEncryptionMode(EncryptionMode encryptionMode);
55
56private:
57 QString mServerName;
58 QString mUserName;
59 QString mPassword;
60 SieveImapAccountSettings::AuthenticationMode mAuthenticationType = Plain;
61 SieveImapAccountSettings::EncryptionMode mEncryptionMode = Unencrypted;
62 int mPort = -1;
63};
64}
66KSIEVECORE_EXPORT QDebug operator<<(QDebug d, const KSieveCore::SieveImapAccountSettings &settings);
The SieveImapAccountSettings class.
QDebug operator<<(QDebug dbg, const PerceptualColor::LchaDouble &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.