KConfig 5.109.0
kemailsettings.h
1/*
2 SPDX-FileCopyrightText: 2000 Alex Zepeda <zipzippy@sonic.net>
3
4 SPDX-License-Identifier: BSD-2-Clause
5*/
6
7#ifndef _KEMAILSETTINGS_H
8#define _KEMAILSETTINGS_H
9
10#include <QCoreApplication> // Q_DECLARE_TR_FUNCTIONS
11#include <QStringList>
12
13#include <kconfigcore_export.h>
14
15class KEMailSettingsPrivate;
16
28class KCONFIGCORE_EXPORT KEMailSettings
29{
30 Q_DECLARE_TR_FUNCTIONS(KEMailSettings)
31public:
41 enum Setting {
42 ClientProgram,
43 ClientTerminal,
44 RealName,
45 EmailAddress,
46 ReplyToAddress,
47 Organization,
48 OutServer,
49 OutServerLogin,
50 OutServerPass,
51#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)
55 OutServerType KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
59 OutServerCommand KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
63 OutServerTLS KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
64#else
65 OutServerType_DEPRECATED_DO_NOT_USE,
66 OutServerCommand_DEPRECATED_DO_NOT_USE,
67 OutServerTLS_DEPRECATED_DO_NOT_USE,
68#endif
69 InServer,
70 InServerLogin,
71 InServerPass,
72#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)
76 InServerType KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
80 InServerMBXType KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
84 InServerTLS KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users")
85#endif
86 };
87
91 enum Extension {
92 POP3,
93 SMTP,
94 OTHER,
95 };
96
102
103 KEMailSettings(const KEMailSettings &) = delete;
104 KEMailSettings &operator=(const KEMailSettings &) = delete;
105
110
115 QStringList profiles() const;
116
117#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)
123 KCONFIGCORE_DEPRECATED_VERSION(5, 0, "API planned to be changed")
124 QString currentProfileName() const;
125 // see https://git.reviewboard.kde.org/r/111910/
126#endif
127
132 void setProfile(const QString &s);
133
138 QString defaultProfileName() const;
139
144 void setDefault(const QString &def);
145
153
160 void setSetting(KEMailSettings::Setting s, const QString &v);
161
162private:
163 KEMailSettingsPrivate *const p;
164};
165
166#endif
This is just a small class to facilitate accessing e-mail settings in a sane way, and allowing any pr...
Definition kemailsettings.h:29
Extension
The various extensions allowed.
Definition kemailsettings.h:91
QString getSetting(KEMailSettings::Setting s) const
Get one of the predefined "basic" settings.
void setProfile(const QString &s)
Change the current profile.
void setSetting(KEMailSettings::Setting s, const QString &v)
Set one of the predefined "basic" settings.
QString defaultProfileName() const
Returns the name of the default profile.
KEMailSettings()
Default constructor, just sets things up and sets the default profile as the current profile.
QStringList profiles() const
List of profiles available.
~KEMailSettings()
Default destructor, nothing to see here.
Setting
The list of settings that I thought of when I wrote this class.
Definition kemailsettings.h:41
void setDefault(const QString &def)
Sets a new default.