Libksieve

sieveimapaccountsettings.cpp
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "sieveimapaccountsettings.h"
8
9using namespace KSieveCore;
10
11SieveImapAccountSettings::SieveImapAccountSettings() = default;
12
13QString SieveImapAccountSettings::identifier() const
14{
15 return mUserName + QLatin1Char('_') + mServerName;
16}
17
18void SieveImapAccountSettings::setServerName(const QString &server)
19{
20 mServerName = server;
21}
22
23QString SieveImapAccountSettings::serverName() const
24{
25 return mServerName;
26}
27
28void SieveImapAccountSettings::setPort(int port)
29{
30 mPort = port;
31}
32
33int SieveImapAccountSettings::port() const
34{
35 return mPort;
36}
37
38void SieveImapAccountSettings::setUserName(const QString &userName)
39{
40 mUserName = userName;
41}
42
43QString SieveImapAccountSettings::userName() const
44{
45 return mUserName;
46}
47
48void SieveImapAccountSettings::setPassword(const QString &password)
49{
50 mPassword = password;
51}
52
53QString SieveImapAccountSettings::password() const
54{
55 return mPassword;
56}
57
58void SieveImapAccountSettings::setAuthenticationType(AuthenticationMode type)
59{
60 mAuthenticationType = type;
61}
62
63KSieveCore::SieveImapAccountSettings::AuthenticationMode SieveImapAccountSettings::authenticationType() const
64{
65 return mAuthenticationType;
66}
67
68bool SieveImapAccountSettings::operator==(const SieveImapAccountSettings &other) const
69{
70 return (mServerName == other.serverName()) && (mPassword == other.password()) && (mPort == other.port()) && (mUserName == other.userName())
71 && (mAuthenticationType == other.authenticationType()) && (mEncryptionMode == other.encryptionMode());
72}
73
74bool SieveImapAccountSettings::isValid() const
75{
76 return !mServerName.isEmpty() && !mPassword.isEmpty() && (mPort != -1) && (!mUserName.isEmpty());
77}
78
79SieveImapAccountSettings::EncryptionMode SieveImapAccountSettings::encryptionMode() const
80{
81 return mEncryptionMode;
82}
83
84void SieveImapAccountSettings::setEncryptionMode(SieveImapAccountSettings::EncryptionMode encryptionMode)
85{
86 mEncryptionMode = encryptionMode;
87}
88
90{
91 d << "serverName " << settings.serverName();
92 d << "userName " << settings.userName();
93 d << "password " << settings.password();
94 d << "authenticationType " << settings.authenticationType();
95 d << "port " << settings.port();
96 d << "encryptionMode : " << settings.encryptionMode();
97 return d;
98}
The SieveImapAccountSettings class.
Type type(const QSqlDatabase &db)
QDebug operator<<(QDebug dbg, const PerceptualColor::MultiSpinBoxSection &value)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.