KConfig

kemailsettings.h
1 /*
2  SPDX-FileCopyrightText: 2000 Alex Zepeda <[email protected]>
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 
15 class KEMailSettingsPrivate;
16 
17 /**
18  * \class KEMailSettings kemailsettings.h <KEMailSettings>
19  *
20  * This is just a small class to facilitate accessing e-mail settings in
21  * a sane way, and allowing any program to manage multiple e-mail
22  * profiles effortlessly
23  *
24  * The default profile is automatically selected in the constructor.
25  *
26  * @author Alex Zepeda [email protected]
27  **/
28 class KCONFIGCORE_EXPORT KEMailSettings
29 {
30  Q_DECLARE_TR_FUNCTIONS(KEMailSettings)
31 public:
32  /**
33  * The list of settings that I thought of when I wrote this
34  * class. Any extra settings thought of later can be accessed
35  * easily with getExtendedSetting and setExtendedSetting.
36  * @see getSetting()
37  * @see setSetting()
38  * @see getExtendedSetting()
39  * @see setExtendedSetting()
40  **/
41  enum Setting {
42  ClientProgram,
43  ClientTerminal,
44  RealName,
45  EmailAddress,
46  ReplyToAddress,
48  OutServer,
49  OutServerLogin,
50  OutServerPass,
51 #if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)
52  /**
53  * @deprecated since 5.0
54  */
55  OutServerType KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
56  /**
57  * @deprecated since 5.0
58  */
59  OutServerCommand KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
60  /**
61  * @deprecated since 5.0
62  */
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)
73  /**
74  * @deprecated since 5.0
75  */
76  InServerType KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
77  /**
78  * @deprecated since 5.0
79  */
80  InServerMBXType KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users"),
81  /**
82  * @deprecated since 5.0
83  */
84  InServerTLS KCONFIGCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "No known users")
85 #endif
86  };
87 
88  /**
89  * The various extensions allowed.
90  **/
91  enum Extension {
92  POP3,
93  SMTP,
94  OTHER,
95  };
96 
97  /**
98  * Default constructor, just sets things up and sets the default profile
99  * as the current profile
100  **/
101  KEMailSettings();
102 
103  KEMailSettings(const KEMailSettings &) = delete;
104  KEMailSettings &operator=(const KEMailSettings &) = delete;
105 
106  /**
107  * Default destructor, nothing to see here.
108  **/
109  ~KEMailSettings();
110 
111  /**
112  * List of profiles available.
113  * @return the list of profiles
114  **/
115  QStringList profiles() const;
116 
117 #if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)
118  /**
119  * Returns the name of the current profile.
120  * @returns what profile we're currently using
121  * @deprecated Since 5.0
122  **/
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 
128  /**
129  * Change the current profile.
130  * @param s the name of the new profile
131  **/
132  void setProfile(const QString &s);
133 
134  /**
135  * Returns the name of the default profile.
136  * @returns the name of the one that's currently default QString() if none
137  **/
138  QString defaultProfileName() const;
139 
140  /**
141  * Sets a new default.
142  * @param def the new default
143  **/
144  void setDefault(const QString &def);
145 
146  /**
147  * Get one of the predefined "basic" settings.
148  * @param s the setting to get
149  * @return the value of the setting, or QString() if not
150  * set
151  **/
152  QString getSetting(KEMailSettings::Setting s) const;
153 
154  /**
155  * Set one of the predefined "basic" settings.
156  * @param s the setting to set
157  * @param v the new value of the setting, or QString() to
158  * unset
159  **/
160  void setSetting(KEMailSettings::Setting s, const QString &v);
161 
162 private:
163  KEMailSettingsPrivate *const p;
164 };
165 
166 #endif
Organization
Setting
The list of settings that I thought of when I wrote this class.
Extension
The various extensions allowed.
This is just a small class to facilitate accessing e-mail settings in a sane way, and allowing any pr...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jun 21 2021 22:48:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.