Libksieve

sieveimapaccountsettings.h
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ksieveui_export.h"
10 #include <QDebug>
11 namespace KSieveUi
12 {
13 /**
14  * @brief The SieveImapAccountSettings class
15  * @author Laurent Montel <[email protected]>
16  */
17 class KSIEVEUI_EXPORT SieveImapAccountSettings
18 {
19 public:
20  // Keep sync with KIMAP settings.
22  Unencrypted = 0,
23  SSLorTLS, /*!< Use SSL/TLS encryption, KIMAP will automatically negoatiate
24  the best supported encryption protocol. */
25  STARTTLS /*!< Use STARTTLS to upgrade an initially plaintext connection to
26  encrypted connection. KIMAP will automatically negoatiate
27  the best supported encryption protocol. */
28  };
29 
30  enum AuthenticationMode { ClearText = 0, Login, Plain, CramMD5, DigestMD5, NTLM, GSSAPI, Anonymous, XOAuth2 };
32 
33  Q_REQUIRED_RESULT QString identifier() const;
34 
35  void setServerName(const QString &serverName);
36  Q_REQUIRED_RESULT QString serverName() const;
37 
38  void setPort(int port);
39  Q_REQUIRED_RESULT int port() const;
40 
41  void setUserName(const QString &userName);
42  Q_REQUIRED_RESULT QString userName() const;
43 
44  void setPassword(const QString &password);
45  Q_REQUIRED_RESULT QString password() const;
46 
47  void setAuthenticationType(KSieveUi::SieveImapAccountSettings::AuthenticationMode type);
48  Q_REQUIRED_RESULT AuthenticationMode authenticationType() const;
49  Q_REQUIRED_RESULT bool operator==(const SieveImapAccountSettings &other) const;
50 
51  Q_REQUIRED_RESULT bool isValid() const;
52 
53  Q_REQUIRED_RESULT SieveImapAccountSettings::EncryptionMode encryptionMode() const;
54  void setEncryptionMode(EncryptionMode encryptionMode);
55 
56 private:
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 }
65 Q_DECLARE_METATYPE(KSieveUi::SieveImapAccountSettings)
66 KSIEVEUI_EXPORT QDebug operator<<(QDebug d, const KSieveUi::SieveImapAccountSettings &settings);
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
The SieveImapAccountSettings class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 9 2021 23:09:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.