Libksieve

sieveimapaccountsettings.h
1 /*
2  Copyright (C) 2016-2020 Laurent Montel <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef SIEVEIMAPACCOUNTSETTINGS_H
21 #define SIEVEIMAPACCOUNTSETTINGS_H
22 
23 #include "ksieveui_export.h"
24 #include <QDebug>
25 namespace KSieveUi {
30 class KSIEVEUI_EXPORT SieveImapAccountSettings
31 {
32 public:
33  //Keep sync with KIMAP settings.
35  Unencrypted = 0,
36  SSLorTLS,
38  STARTTLS
41  };
42 
43  enum AuthenticationMode {
44  ClearText = 0,
45  Login,
46  Plain,
47  CramMD5,
48  DigestMD5,
49  NTLM,
50  GSSAPI,
51  Anonymous,
52  XOAuth2
53  };
55 
56  Q_REQUIRED_RESULT QString identifier() const;
57 
58  void setServerName(const QString &serverName);
59  Q_REQUIRED_RESULT QString serverName() const;
60 
61  void setPort(int port);
62  Q_REQUIRED_RESULT int port() const;
63 
64  void setUserName(const QString &userName);
65  Q_REQUIRED_RESULT QString userName() const;
66 
67  void setPassword(const QString &password);
68  Q_REQUIRED_RESULT QString password() const;
69 
70  void setAuthenticationType(KSieveUi::SieveImapAccountSettings::AuthenticationMode type);
71  Q_REQUIRED_RESULT AuthenticationMode authenticationType() const;
72  Q_REQUIRED_RESULT bool operator==(const SieveImapAccountSettings &other) const;
73 
74  Q_REQUIRED_RESULT bool isValid() const;
75 
76  Q_REQUIRED_RESULT SieveImapAccountSettings::EncryptionMode encryptionMode() const;
77  void setEncryptionMode(EncryptionMode encryptionMode);
78 
79 private:
80  QString mServerName;
81  QString mUserName;
82  QString mPassword;
83  SieveImapAccountSettings::AuthenticationMode mAuthenticationType = Plain;
84  SieveImapAccountSettings::EncryptionMode mEncryptionMode = Unencrypted;
85  int mPort = -1;
86 };
87 }
88 Q_DECLARE_METATYPE(KSieveUi::SieveImapAccountSettings)
89 KSIEVEUI_EXPORT QDebug operator <<(QDebug d, const KSieveUi::SieveImapAccountSettings &settings);
90 #endif // SIEVEIMAPACCOUNTSETTINGS_H
The SieveImapAccountSettings class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 23:07:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.