1 /* Copyright (c) 2007, Nokia Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Nokia Corporation nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 /* modest-account-settings.h */
33 #ifndef __MODEST_ACCOUNT_SETTINGS_H__
34 #define __MODEST_ACCOUNT_SETTINGS_H__
36 #include <glib-object.h>
37 #include <modest-defs.h>
38 #include <modest-server-account-settings.h>
42 /* convenience macros */
43 #define MODEST_TYPE_ACCOUNT_SETTINGS (modest_account_settings_get_type())
44 #define MODEST_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_ACCOUNT_SETTINGS,ModestAccountSettings))
45 #define MODEST_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_ACCOUNT_SETTINGS,ModestAccountSettingsClass))
46 #define MODEST_IS_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_ACCOUNT_SETTINGS))
47 #define MODEST_IS_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_ACCOUNT_SETTINGS))
48 #define MODEST_ACCOUNT_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_ACCOUNT_SETTINGS,ModestAccountSettingsClass))
50 typedef struct _ModestAccountSettings ModestAccountSettings;
51 typedef struct _ModestAccountSettingsClass ModestAccountSettingsClass;
53 struct _ModestAccountSettings {
57 struct _ModestAccountSettingsClass {
58 GObjectClass parent_class;
62 MODEST_ACCOUNT_RETRIEVE_HEADERS_ONLY = 0,
63 MODEST_ACCOUNT_RETRIEVE_MESSAGES,
64 MODEST_ACCOUNT_RETRIEVE_MESSAGES_AND_ATTACHMENTS
65 } ModestAccountRetrieveType;
69 * modest_account_settings_get_type:
71 * Returns: GType of the account store
73 GType modest_account_settings_get_type (void) G_GNUC_CONST;
76 * modest_account_settings_new:
78 * creates a new instance of #ModestAccountSettings
80 * Returns: a #ModestAccountSettings
82 ModestAccountSettings* modest_account_settings_new (void);
85 * modest_account_settings_get_fullname:
86 * @settings: a #ModestAccountSettings
88 * get the user full name.
92 const gchar* modest_account_settings_get_fullname (ModestAccountSettings *settings);
95 * modest_account_settings_set_fullname:
96 * @settings: a #ModestAccountSettings
97 * @hostname: a string.
99 * set @fullname as the user full name .
101 void modest_account_settings_set_fullname (ModestAccountSettings *settings,
102 const gchar *fullname);
104 * modest_account_settings_get_email_address:
105 * @settings: a #ModestAccountSettings
107 * get the user email address.
111 const gchar* modest_account_settings_get_email_address (ModestAccountSettings *settings);
114 * modest_account_settings_set_email_address:
115 * @settings: a #ModestAccountSettings
116 * @hostname: a string.
118 * set @email_address of the account.
120 void modest_account_settings_set_email_address (ModestAccountSettings *settings,
121 const gchar *email_address);
123 * modest_account_settings_get_retrieve_type:
124 * @settings: a #ModestAccountSettings
126 * get the account retrieve type.
128 * Returns: a #ModestAccountRetrieveType
130 ModestAccountRetrieveType modest_account_settings_get_retrieve_type (ModestAccountSettings *settings);
133 * modest_account_settings_set_retrieve_type:
134 * @settings: a #ModestAccountSettings
135 * @retrieve_type: a #ModestAccountRetrieveType.
137 * set @retrieve_type of the account.
139 void modest_account_settings_set_retrieve_type (ModestAccountSettings *settings,
140 ModestAccountRetrieveType retrieve_type);
143 * modest_account_settings_get_retrieve_limit:
144 * @settings: a #ModestAccountSettings
146 * get the account retrieve limit. 0 is no limit.
150 gint modest_account_settings_get_retrieve_limit (ModestAccountSettings *settings);
153 * modest_account_settings_set_retrieve_limit:
154 * @settings: a #ModestAccountSettings
155 * @retrieve_limit: a #gint.
157 * set @retrieve_limit of the account. 0 is no limit.
159 void modest_account_settings_set_retrieve_limit (ModestAccountSettings *settings,
160 gint retrieve_limit);
163 * modest_account_settings_get_display_name:
164 * @settings: a #ModestAccountSettings
166 * get the visible name of the account.
170 const gchar* modest_account_settings_get_display_name (ModestAccountSettings *settings);
173 * modest_account_settings_set_display_name:
174 * @settings: a #ModestAccountSettings
175 * @hostname: a string.
177 * set @display_name as the name of the account visible to the users in UI.
179 void modest_account_settings_set_display_name (ModestAccountSettings *settings,
180 const gchar *display_name);
183 * modest_account_settings_get_account_name:
184 * @settings: a #ModestAccountSettings
186 * get the #ModestAccountMgr account name for these settings, or
187 * %NULL if it's not in the manager.
189 * Returns: a string, or %NULL
191 const gchar *modest_account_settings_get_account_name (ModestAccountSettings *settings);
194 * modest_account_settings_set_account_name:
195 * @settings: a #ModestAccountSettings
196 * @account_name: a string
198 * sets the account name that will be used to store the account settings. This should
199 * only be called from #ModestAccountMgr and #ModestAccountSettings.
201 void modest_account_settings_set_account_name (ModestAccountSettings *settings,
202 const gchar *account_name);
205 * modest_account_settings_get_enabled:
206 * @settings: a #ModestAccountSettings
208 * obtains whether the account is enabled or not.
210 * Returns: a #gboolean
212 gboolean modest_account_settings_get_enabled (ModestAccountSettings *settings);
215 * modest_account_settings_set_enabled:
216 * @settings: a #ModestAccountSettings
217 * @enabled: a #gboolean
219 * set if @settings account is enabled or not.
221 void modest_account_settings_set_enabled (ModestAccountSettings *settings, gboolean enabled);
225 * modest_account_settings_get_is_default:
226 * @settings: a #ModestAccountSettings
228 * obtains whether the account is the default account or not.
230 * Returns: a #gboolean
232 gboolean modest_account_settings_get_is_default (ModestAccountSettings *settings);
235 * modest_account_settings_set_is_default:
236 * @settings: a #ModestAccountSettings
237 * @is_default: a #gboolean
239 * set if @settings account is the default account or not.
241 void modest_account_settings_set_is_default (ModestAccountSettings *settings, gboolean is_default);
244 * modest_account_settings_get_store_settings:
245 * @settings: a #ModestAccountSettings
247 * obtains a ref'ed instance of the store account server settings
249 * Returns: a ref'd #ModestServerAccountSettings. You should unreference it on finishing usage.
251 ModestServerAccountSettings *modest_account_settings_get_store_settings (ModestAccountSettings *settings);
254 * modest_account_settings_set_store_settings:
255 * @settings: a #ModestAccountSettings
257 * sets @store_settings as the settings of the store account of @settings account.
258 * @settings will keep an internal reference to it.
260 void modest_account_settings_set_store_settings (ModestAccountSettings *settings,
261 ModestServerAccountSettings *store_settings);
264 * modest_account_settings_get_transport_settings:
265 * @settings: a #ModestAccountSettings
267 * obtains a ref'ed instance of the transport account server settings
269 * Returns: a ref'd #ModestServerAccountSettings. You should unreference it on finishing usage.
271 ModestServerAccountSettings *modest_account_settings_get_transport_settings (ModestAccountSettings *settings);
274 * modest_account_settings_set_transport_settings:
275 * @settings: a #ModestAccountSettings
277 * sets @transport_settings as the settings of the transport account of @settings account.
278 * @settings will keep an internal reference to it.
280 void modest_account_settings_set_transport_settings (ModestAccountSettings *settings,
281 ModestServerAccountSettings *transport_settings);
284 * modest_account_settings_get_use_signature:
285 * @settings: a #ModestAccountSettings
287 * obtains whether the mails from this account use signature or not.
289 * Returns: a #gboolean
291 gboolean modest_account_settings_get_use_signature (ModestAccountSettings *settings);
294 * modest_account_settings_set_use_signature:
295 * @settings: a #ModestAccountSettings
296 * @use_signature: a #gboolean
298 * set if @settings mails use signature or not
300 void modest_account_settings_set_use_signature (ModestAccountSettings *settings, gboolean use_signature);
303 * modest_account_settings_get_signature:
304 * @settings: a #ModestAccountSettings
310 const gchar* modest_account_settings_get_signature (ModestAccountSettings *settings);
313 * modest_account_settings_set_signature:
314 * @settings: a #ModestAccountSettings
315 * @hostname: a string.
317 * set @signature for the account .
319 void modest_account_settings_set_signature (ModestAccountSettings *settings,
320 const gchar *signature);
322 * modest_account_settings_get_leave_messages_on_server:
323 * @settings: a #ModestAccountSettings
325 * obtains whether messages should be left on server or not
327 * Returns: a #gboolean
329 gboolean modest_account_settings_get_leave_messages_on_server (ModestAccountSettings *settings);
332 * modest_account_settings_set_leave_messages_on_server:
333 * @settings: a #ModestAccountSettings
334 * @leave_messages_on_server: a #gboolean
336 * set if we leave the messages on server or not.
338 void modest_account_settings_set_leave_messages_on_server (ModestAccountSettings *settings,
339 gboolean leave_messages_on_server);
343 * modest_account_settings_get_use_connection_specific_smtp:
344 * @settings: a #ModestAccountSettings
346 * obtains if we should try the connection specific smtp servers
348 * Returns: a #gboolean
350 gboolean modest_account_settings_get_use_connection_specific_smtp (ModestAccountSettings *settings);
353 * modest_account_settings_set_use_connection_specific_smtp:
354 * @settings: a #ModestAccountSettings
355 * @use_connection_specific_smtp: a #gboolean
357 * if set, mails sent from this account first try the connection specific smtp servers
358 * before the transport account.
360 void modest_account_settings_set_use_connection_specific_smtp (ModestAccountSettings *settings,
361 gboolean use_connection_specific_smtp);
365 #endif /* __MODEST_ACCOUNT_SETTINGS_H__ */