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 {
31 ClearText = 0,
32 Login,
33 Plain,
34 CramMD5,
35 DigestMD5,
36 NTLM,
37 GSSAPI,
38 Anonymous,
39 XOAuth2
40 };
41 SieveImapAccountSettings();
42
43 [[nodiscard]] QString identifier() const;
44
45 void setServerName(const QString &serverName);
46 [[nodiscard]] QString serverName() const;
47
48 void setPort(int port);
49 [[nodiscard]] int port() const;
50
51 void setUserName(const QString &userName);
52 [[nodiscard]] QString userName() const;
53
54 void setPassword(const QString &password);
55 [[nodiscard]] QString password() const;
56
57 void setAuthenticationType(KSieveCore::SieveImapAccountSettings::AuthenticationMode type);
58 [[nodiscard]] AuthenticationMode authenticationType() const;
59 [[nodiscard]] bool operator==(const SieveImapAccountSettings &other) const;
60
61 [[nodiscard]] bool isValid() const;
62
63 [[nodiscard]] SieveImapAccountSettings::EncryptionMode encryptionMode() const;
64 void setEncryptionMode(EncryptionMode encryptionMode);
65
66private:
67 QString mServerName;
68 QString mUserName;
69 QString mPassword;
70 SieveImapAccountSettings::AuthenticationMode mAuthenticationType = Plain;
71 SieveImapAccountSettings::EncryptionMode mEncryptionMode = Unencrypted;
72 int mPort = -1;
73};
74}
76KSIEVECORE_EXPORT QDebug operator<<(QDebug d, const KSieveCore::SieveImapAccountSettings &settings);
The SieveImapAccountSettings class.
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:09:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.