Revert fix for modest_text_utils_convert_buffer_to_html_start()
[modest] / src / modest-account-settings.h
1 /* Copyright (c) 2007, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
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.
16  *
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.
28  */
29
30
31 /* modest-account-settings.h */
32
33 #ifndef __MODEST_ACCOUNT_SETTINGS_H__
34 #define __MODEST_ACCOUNT_SETTINGS_H__
35
36 #include <glib-object.h>
37 #include <modest-defs.h>
38 #include <modest-server-account-settings.h>
39
40 G_BEGIN_DECLS
41
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))
49
50 typedef struct _ModestAccountSettings      ModestAccountSettings;
51 typedef struct _ModestAccountSettingsClass ModestAccountSettingsClass;
52
53 struct _ModestAccountSettings {
54         GObject parent;
55 };
56
57 struct _ModestAccountSettingsClass {
58         GObjectClass parent_class;
59 };
60
61 typedef enum {
62         MODEST_ACCOUNT_RETRIEVE_HEADERS_ONLY = 0,
63         MODEST_ACCOUNT_RETRIEVE_MESSAGES,
64         MODEST_ACCOUNT_RETRIEVE_MESSAGES_AND_ATTACHMENTS
65 } ModestAccountRetrieveType;
66
67
68 /**
69  * modest_account_settings_get_type:
70  *
71  * Returns: GType of the account store
72  */
73 GType  modest_account_settings_get_type   (void) G_GNUC_CONST;
74
75 /**
76  * modest_account_settings_new:
77  *
78  * creates a new instance of #ModestAccountSettings
79  *
80  * Returns: a #ModestAccountSettings
81  */
82 ModestAccountSettings*    modest_account_settings_new (void);
83
84 /**
85  * modest_account_settings_get_fullname:
86  * @settings: a #ModestAccountSettings
87  *
88  * get the user full name.
89  *
90  * Returns: a string
91  */
92 const gchar* modest_account_settings_get_fullname (ModestAccountSettings *settings);
93
94 /**
95  * modest_account_settings_set_fullname:
96  * @settings: a #ModestAccountSettings
97  * @hostname: a string.
98  *
99  * set @fullname as the user full name .
100  */
101 void         modest_account_settings_set_fullname (ModestAccountSettings *settings,
102                                                    const gchar *fullname);
103 /**
104  * modest_account_settings_get_email_address:
105  * @settings: a #ModestAccountSettings
106  *
107  * get the user email address.
108  *
109  * Returns: a string
110  */
111 const gchar* modest_account_settings_get_email_address (ModestAccountSettings *settings);
112
113 /**
114  * modest_account_settings_set_email_address:
115  * @settings: a #ModestAccountSettings
116  * @hostname: a string.
117  *
118  * set @email_address of the account.
119  */
120 void         modest_account_settings_set_email_address (ModestAccountSettings *settings,
121                                                         const gchar *email_address);
122 /**
123  * modest_account_settings_get_retrieve_type:
124  * @settings: a #ModestAccountSettings
125  *
126  * get the account retrieve type.
127  *
128  * Returns: a #ModestAccountRetrieveType
129  */
130 ModestAccountRetrieveType modest_account_settings_get_retrieve_type (ModestAccountSettings *settings);
131
132 /**
133  * modest_account_settings_set_retrieve_type:
134  * @settings: a #ModestAccountSettings
135  * @retrieve_type: a #ModestAccountRetrieveType.
136  *
137  * set @retrieve_type of the account.
138  */
139 void         modest_account_settings_set_retrieve_type (ModestAccountSettings *settings,
140                                                         ModestAccountRetrieveType retrieve_type);
141
142 /**
143  * modest_account_settings_get_retrieve_limit:
144  * @settings: a #ModestAccountSettings
145  *
146  * get the account retrieve limit. 0 is no limit.
147  *
148  * Returns: a #gint
149  */
150 gint modest_account_settings_get_retrieve_limit (ModestAccountSettings *settings);
151
152 /**
153  * modest_account_settings_set_retrieve_limit:
154  * @settings: a #ModestAccountSettings
155  * @retrieve_limit: a #gint.
156  *
157  * set @retrieve_limit of the account. 0 is no limit.
158  */
159 void         modest_account_settings_set_retrieve_limit (ModestAccountSettings *settings,
160                                                          gint retrieve_limit);
161
162 /**
163  * modest_account_settings_get_display_name:
164  * @settings: a #ModestAccountSettings
165  *
166  * get the visible name of the account.
167  *
168  * Returns: a string
169  */
170 const gchar* modest_account_settings_get_display_name (ModestAccountSettings *settings);
171
172 /**
173  * modest_account_settings_set_display_name:
174  * @settings: a #ModestAccountSettings
175  * @hostname: a string.
176  *
177  * set @display_name as the name of the account visible to the users in UI.
178  */
179 void         modest_account_settings_set_display_name (ModestAccountSettings *settings,
180                                                        const gchar *display_name);
181
182 /**
183  * modest_account_settings_get_account_name:
184  * @settings: a #ModestAccountSettings
185  *
186  * get the #ModestAccountMgr account name for these settings, or
187  * %NULL if it's not in the manager.
188  *
189  * Returns: a string, or %NULL
190  */
191 const gchar *modest_account_settings_get_account_name (ModestAccountSettings *settings);
192
193 /**
194  * modest_account_settings_set_account_name:
195  * @settings: a #ModestAccountSettings
196  * @account_name: a string
197  *
198  * sets the account name that will be used to store the account settings. This should
199  * only be called from #ModestAccountMgr and #ModestAccountSettings.
200  */
201 void modest_account_settings_set_account_name (ModestAccountSettings *settings,
202                                                const gchar *account_name);
203
204 /**
205  * modest_account_settings_get_enabled:
206  * @settings: a #ModestAccountSettings
207  *
208  * obtains whether the account is enabled or not.
209  *
210  * Returns: a #gboolean
211  */
212 gboolean modest_account_settings_get_enabled (ModestAccountSettings *settings);
213                                               
214 /**
215  * modest_account_settings_set_enabled:
216  * @settings: a #ModestAccountSettings
217  * @enabled: a #gboolean
218  *
219  * set if @settings account is enabled or not.
220  */
221 void modest_account_settings_set_enabled (ModestAccountSettings *settings, gboolean enabled);
222
223
224 /**
225  * modest_account_settings_get_is_default:
226  * @settings: a #ModestAccountSettings
227  *
228  * obtains whether the account is the default account or not.
229  *
230  * Returns: a #gboolean
231  */
232 gboolean modest_account_settings_get_is_default (ModestAccountSettings *settings);
233                                               
234 /**
235  * modest_account_settings_set_is_default:
236  * @settings: a #ModestAccountSettings
237  * @is_default: a #gboolean
238  *
239  * set if @settings account is the default account or not.
240  */
241 void modest_account_settings_set_is_default (ModestAccountSettings *settings, gboolean is_default);
242
243 /**
244  * modest_account_settings_get_store_settings:
245  * @settings: a #ModestAccountSettings
246  *
247  * obtains a ref'ed instance of the store account server settings
248  *
249  * Returns: a ref'd #ModestServerAccountSettings. You should unreference it on finishing usage.
250  */
251 ModestServerAccountSettings *modest_account_settings_get_store_settings (ModestAccountSettings *settings);
252
253 /**
254  * modest_account_settings_set_store_settings:
255  * @settings: a #ModestAccountSettings
256  *
257  * sets @store_settings as the settings of the store account of @settings account.
258  * @settings will keep an internal reference to it.
259  */
260 void modest_account_settings_set_store_settings (ModestAccountSettings *settings, 
261                                                  ModestServerAccountSettings *store_settings);
262
263 /**
264  * modest_account_settings_get_transport_settings:
265  * @settings: a #ModestAccountSettings
266  *
267  * obtains a ref'ed instance of the transport account server settings
268  *
269  * Returns: a ref'd #ModestServerAccountSettings. You should unreference it on finishing usage.
270  */
271 ModestServerAccountSettings *modest_account_settings_get_transport_settings (ModestAccountSettings *settings);
272
273 /**
274  * modest_account_settings_set_transport_settings:
275  * @settings: a #ModestAccountSettings
276  *
277  * sets @transport_settings as the settings of the transport account of @settings account.
278  * @settings will keep an internal reference to it.
279  */
280 void modest_account_settings_set_transport_settings (ModestAccountSettings *settings, 
281                                                      ModestServerAccountSettings *transport_settings);
282
283 /**
284  * modest_account_settings_get_use_signature:
285  * @settings: a #ModestAccountSettings
286  *
287  * obtains whether the mails from this account use signature or not.
288  *
289  * Returns: a #gboolean
290  */
291 gboolean modest_account_settings_get_use_signature (ModestAccountSettings *settings);
292                                               
293 /**
294  * modest_account_settings_set_use_signature:
295  * @settings: a #ModestAccountSettings
296  * @use_signature: a #gboolean
297  *
298  * set if @settings mails use signature or not
299  */
300 void modest_account_settings_set_use_signature (ModestAccountSettings *settings, gboolean use_signature);
301
302 /**
303  * modest_account_settings_get_signature:
304  * @settings: a #ModestAccountSettings
305  *
306  * get the signature.
307  *
308  * Returns: a string
309  */
310 const gchar* modest_account_settings_get_signature (ModestAccountSettings *settings);
311
312 /**
313  * modest_account_settings_set_signature:
314  * @settings: a #ModestAccountSettings
315  * @hostname: a string.
316  *
317  * set @signature for the account .
318  */
319 void         modest_account_settings_set_signature (ModestAccountSettings *settings,
320                                                    const gchar *signature);
321 /**
322  * modest_account_settings_get_leave_messages_on_server:
323  * @settings: a #ModestAccountSettings
324  *
325  * obtains whether messages should be left on server or not
326  *
327  * Returns: a #gboolean
328  */
329 gboolean modest_account_settings_get_leave_messages_on_server (ModestAccountSettings *settings);
330                                               
331 /**
332  * modest_account_settings_set_leave_messages_on_server:
333  * @settings: a #ModestAccountSettings
334  * @leave_messages_on_server: a #gboolean
335  *
336  * set if we leave the messages on server or not.
337  */
338 void modest_account_settings_set_leave_messages_on_server (ModestAccountSettings *settings, 
339                                                            gboolean leave_messages_on_server);
340
341
342 /**
343  * modest_account_settings_get_use_connection_specific_smtp:
344  * @settings: a #ModestAccountSettings
345  *
346  * obtains if we should try the connection specific smtp servers
347  *
348  * Returns: a #gboolean
349  */
350 gboolean modest_account_settings_get_use_connection_specific_smtp (ModestAccountSettings *settings);
351                                               
352 /**
353  * modest_account_settings_set_use_connection_specific_smtp:
354  * @settings: a #ModestAccountSettings
355  * @use_connection_specific_smtp: a #gboolean
356  *
357  * if set, mails sent from this account first try the connection specific smtp servers
358  * before the transport account.
359  */
360 void modest_account_settings_set_use_connection_specific_smtp (ModestAccountSettings *settings, 
361                                                                gboolean use_connection_specific_smtp);
362
363 G_END_DECLS
364
365 #endif /* __MODEST_ACCOUNT_SETTINGS_H__ */