Libksieve

sieveimapaccountsettings.h
1 /*
2  SPDX-FileCopyrightText: 2016-2020 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef SIEVEIMAPACCOUNTSETTINGS_H
8 #define SIEVEIMAPACCOUNTSETTINGS_H
9 
10 #include "ksieveui_export.h"
11 #include <QDebug>
12 namespace KSieveUi {
17 class KSIEVEUI_EXPORT SieveImapAccountSettings
18 {
19 public:
20  //Keep sync with KIMAP settings.
22  Unencrypted = 0,
23  SSLorTLS,
25  STARTTLS
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  };
42 
43  Q_REQUIRED_RESULT QString identifier() const;
44 
45  void setServerName(const QString &serverName);
46  Q_REQUIRED_RESULT QString serverName() const;
47 
48  void setPort(int port);
49  Q_REQUIRED_RESULT int port() const;
50 
51  void setUserName(const QString &userName);
52  Q_REQUIRED_RESULT QString userName() const;
53 
54  void setPassword(const QString &password);
55  Q_REQUIRED_RESULT QString password() const;
56 
57  void setAuthenticationType(KSieveUi::SieveImapAccountSettings::AuthenticationMode type);
58  Q_REQUIRED_RESULT AuthenticationMode authenticationType() const;
59  Q_REQUIRED_RESULT bool operator==(const SieveImapAccountSettings &other) const;
60 
61  Q_REQUIRED_RESULT bool isValid() const;
62 
63  Q_REQUIRED_RESULT SieveImapAccountSettings::EncryptionMode encryptionMode() const;
64  void setEncryptionMode(EncryptionMode encryptionMode);
65 
66 private:
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 }
75 Q_DECLARE_METATYPE(KSieveUi::SieveImapAccountSettings)
76 KSIEVEUI_EXPORT QDebug operator <<(QDebug d, const KSieveUi::SieveImapAccountSettings &settings);
77 #endif // SIEVEIMAPACCOUNTSETTINGS_H
The SieveImapAccountSettings class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:10:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.