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-server-account-settings.h>
41 /* convenience macros */
42 #define MODEST_TYPE_ACCOUNT_SETTINGS (modest_account_settings_get_type())
43 #define MODEST_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_ACCOUNT_SETTINGS,ModestAccountSettings))
44 #define MODEST_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_ACCOUNT_SETTINGS,ModestAccountSettingsClass))
45 #define MODEST_IS_ACCOUNT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_ACCOUNT_SETTINGS))
46 #define MODEST_IS_ACCOUNT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_ACCOUNT_SETTINGS))
47 #define MODEST_ACCOUNT_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_ACCOUNT_SETTINGS,ModestAccountSettingsClass))
49 typedef struct _ModestAccountSettings ModestAccountSettings;
50 typedef struct _ModestAccountSettingsClass ModestAccountSettingsClass;
52 struct _ModestAccountSettings {
56 struct _ModestAccountSettingsClass {
57 GObjectClass parent_class;
61 MODEST_ACCOUNT_RETRIEVE_HEADERS_ONLY = 0,
62 MODEST_ACCOUNT_RETRIEVE_MESSAGES,
63 MODEST_ACCOUNT_RETRIEVE_MESSAGES_AND_ATTACHMENTS
64 } ModestAccountRetrieveType;
68 * modest_account_settings_get_type:
70 * Returns: GType of the account store
72 GType modest_account_settings_get_type (void) G_GNUC_CONST;
75 * modest_account_settings_new:
77 * creates a new instance of #ModestAccountSettings
79 * Returns: a #ModestAccountSettings
81 ModestAccountSettings* modest_account_settings_new (void);
84 * modest_account_settings_get_fullname:
85 * @settings: a #ModestAccountSettings
87 * get the user full name.
91 const gchar* modest_account_settings_get_fullname (ModestAccountSettings *settings);
94 * modest_account_settings_set_fullname:
95 * @settings: a #ModestAccountSettings
96 * @hostname: a string.
98 * set @fullname as the user full name .
100 void modest_account_settings_set_fullname (ModestAccountSettings *settings,
101 const gchar *fullname);
103 * modest_account_settings_get_email_address:
104 * @settings: a #ModestAccountSettings
106 * get the user email address.
110 const gchar* modest_account_settings_get_email_address (ModestAccountSettings *settings);
113 * modest_account_settings_set_email_address:
114 * @settings: a #ModestAccountSettings
115 * @hostname: a string.
117 * set @email_address of the account.
119 void modest_account_settings_set_email_address (ModestAccountSettings *settings,
120 const gchar *email_address);
122 * modest_account_settings_get_retrieve_type:
123 * @settings: a #ModestAccountSettings
125 * get the account retrieve type.
127 * Returns: a #ModestAccountRetrieveType
129 ModestAccountRetrieveType modest_account_settings_get_retrieve_type (ModestAccountSettings *settings);
132 * modest_account_settings_set_retrieve_type:
133 * @settings: a #ModestAccountSettings
134 * @retrieve_type: a #ModestAccountRetrieveType.
136 * set @retrieve_type of the account.
138 void modest_account_settings_set_retrieve_type (ModestAccountSettings *settings,
139 ModestAccountRetrieveType retrieve_type);
142 * modest_account_settings_get_retrieve_limit:
143 * @settings: a #ModestAccountSettings
145 * get the account retrieve limit. 0 is no limit.
149 gint modest_account_settings_get_retrieve_limit (ModestAccountSettings *settings);
152 * modest_account_settings_set_retrieve_limit:
153 * @settings: a #ModestAccountSettings
154 * @retrieve_limit: a #gint.
156 * set @retrieve_limit of the account. 0 is no limit.
158 void modest_account_settings_set_retrieve_limit (ModestAccountSettings *settings,
159 gint retrieve_limit);
162 * modest_account_settings_get_display_name:
163 * @settings: a #ModestAccountSettings
165 * get the visible name of the account.
169 const gchar* modest_account_settings_get_display_name (ModestAccountSettings *settings);
172 * modest_account_settings_set_display_name:
173 * @settings: a #ModestAccountSettings
174 * @hostname: a string.
176 * set @display_name as the name of the account visible to the users in UI.
178 void modest_account_settings_set_display_name (ModestAccountSettings *settings,
179 const gchar *display_name);
182 * modest_account_settings_get_account_name:
183 * @settings: a #ModestAccountSettings
185 * get the #ModestAccountMgr account name for these settings, or
186 * %NULL if it's not in the manager.
188 * Returns: a string, or %NULL
190 const gchar *modest_account_settings_get_account_name (ModestAccountSettings *settings);
193 * modest_account_settings_set_account_name:
194 * @settings: a #ModestAccountSettings
195 * @account_name: a string
197 * sets the account name that will be used to store the account settings. This should
198 * only be called from #ModestAccountMgr and #ModestAccountSettings.
200 void modest_account_settings_set_account_name (ModestAccountSettings *settings,
201 const gchar *account_name);
204 * modest_account_settings_get_enabled:
205 * @settings: a #ModestAccountSettings
207 * obtains whether the account is enabled or not.
209 * Returns: a #gboolean
211 gboolean modest_account_settings_get_enabled (ModestAccountSettings *settings);
214 * modest_account_settings_set_enabled:
215 * @settings: a #ModestAccountSettings
216 * @enabled: a #gboolean
218 * set if @settings account is enabled or not.
220 void modest_account_settings_set_enabled (ModestAccountSettings *settings, gboolean enabled);
224 * modest_account_settings_get_is_default:
225 * @settings: a #ModestAccountSettings
227 * obtains whether the account is the default account or not.
229 * Returns: a #gboolean
231 gboolean modest_account_settings_get_is_default (ModestAccountSettings *settings);
234 * modest_account_settings_set_is_default:
235 * @settings: a #ModestAccountSettings
236 * @is_default: a #gboolean
238 * set if @settings account is the default account or not.
240 void modest_account_settings_set_is_default (ModestAccountSettings *settings, gboolean is_default);
243 * modest_account_settings_get_store_settings:
244 * @settings: a #ModestAccountSettings
246 * obtains a ref'ed instance of the store account server settings
248 * Returns: a ref'd #ModestServerAccountSettings. You should unreference it on finishing usage.
250 ModestServerAccountSettings *modest_account_settings_get_store_settings (ModestAccountSettings *settings);
253 * modest_account_settings_set_store_settings:
254 * @settings: a #ModestAccountSettings
256 * sets @store_settings as the settings of the store account of @settings account.
257 * @settings will keep an internal reference to it.
259 void modest_account_settings_set_store_settings (ModestAccountSettings *settings,
260 ModestServerAccountSettings *store_settings);
263 * modest_account_settings_get_transport_settings:
264 * @settings: a #ModestAccountSettings
266 * obtains a ref'ed instance of the transport account server settings
268 * Returns: a ref'd #ModestServerAccountSettings. You should unreference it on finishing usage.
270 ModestServerAccountSettings *modest_account_settings_get_transport_settings (ModestAccountSettings *settings);
273 * modest_account_settings_set_transport_settings:
274 * @settings: a #ModestAccountSettings
276 * sets @transport_settings as the settings of the transport account of @settings account.
277 * @settings will keep an internal reference to it.
279 void modest_account_settings_set_transport_settings (ModestAccountSettings *settings,
280 ModestServerAccountSettings *transport_settings);
283 * modest_account_settings_get_use_signature:
284 * @settings: a #ModestAccountSettings
286 * obtains whether the mails from this account use signature or not.
288 * Returns: a #gboolean
290 gboolean modest_account_settings_get_use_signature (ModestAccountSettings *settings);
293 * modest_account_settings_set_use_signature:
294 * @settings: a #ModestAccountSettings
295 * @use_signature: a #gboolean
297 * set if @settings mails use signature or not
299 void modest_account_settings_set_use_signature (ModestAccountSettings *settings, gboolean use_signature);
302 * modest_account_settings_get_signature:
303 * @settings: a #ModestAccountSettings
309 const gchar* modest_account_settings_get_signature (ModestAccountSettings *settings);
312 * modest_account_settings_set_signature:
313 * @settings: a #ModestAccountSettings
314 * @hostname: a string.
316 * set @signature for the account .
318 void modest_account_settings_set_signature (ModestAccountSettings *settings,
319 const gchar *signature);
321 * modest_account_settings_get_leave_messages_on_server:
322 * @settings: a #ModestAccountSettings
324 * obtains whether messages should be left on server or not
326 * Returns: a #gboolean
328 gboolean modest_account_settings_get_leave_messages_on_server (ModestAccountSettings *settings);
331 * modest_account_settings_set_leave_messages_on_server:
332 * @settings: a #ModestAccountSettings
333 * @leave_messages_on_server: a #gboolean
335 * set if we leave the messages on server or not.
337 void modest_account_settings_set_leave_messages_on_server (ModestAccountSettings *settings,
338 gboolean leave_messages_on_server);
342 * modest_account_settings_get_use_connection_specific_smtp:
343 * @settings: a #ModestAccountSettings
345 * obtains if we should try the connection specific smtp servers
347 * Returns: a #gboolean
349 gboolean modest_account_settings_get_use_connection_specific_smtp (ModestAccountSettings *settings);
352 * modest_account_settings_set_use_connection_specific_smtp:
353 * @settings: a #ModestAccountSettings
354 * @use_connection_specific_smtp: a #gboolean
356 * if set, mails sent from this account first try the connection specific smtp servers
357 * before the transport account.
359 void modest_account_settings_set_use_connection_specific_smtp (ModestAccountSettings *settings,
360 gboolean use_connection_specific_smtp);
364 #endif /* __MODEST_ACCOUNT_SETTINGS_H__ */