remove account_svc and merge with latest code
[platform/core/messaging/email-service.git] / email-daemon / include / email-daemon.h
1 /*
2 *  email-service
3 *
4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5 *
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21
22
23
24 /**
25  * This file defines all APIs of Email Framework.
26  * @file        email-daemon.h
27  * @author      Kyu-ho Jo(kyuho.jo@samsung.com)
28  * @version     0.1
29  * @brief       This file is the header file of email-engine library.
30  */
31 #ifndef __EMAIL_DAEMON_H__
32 #define __EMAIL_DAEMON_H__
33
34 /**
35 * @defgroup EMAIL_SERVICE EmailFW
36 * @{
37 */
38
39 /**
40 * @ingroup EMAIL_SERVICE
41 * @defgroup EMAIL_SERVICE Email Service
42 * @{
43 */
44
45 #include "email-types.h"
46 #include "email-internal-types.h"
47
48 #include <time.h>
49
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif /* __cplusplus */
54
55 /*****************************************************************************/
56 /*  Initialization                                                           */
57 /*****************************************************************************/
58 /**
59  * Initialize Email-engine.
60  *
61  * @param[out] err_code Specifies the error code returned.
62  * @remarks N/A
63  * @return This function returns true on success or false on failure.
64  */
65 INTERNAL_FUNC int emdaemon_initialize(int* err_code);
66
67 /**
68  * Finalize Email-engine.
69  *
70  * @param[out] err_code Specifies the error code returned.
71  * @remarks N/A
72  * @return This function returns true on success or false on failure.
73  */
74 INTERNAL_FUNC int emdaemon_finalize(int* err_code);
75
76
77 /*****************************************************************************/
78 /*  Account                                                                  */
79 /*****************************************************************************/
80 /**
81  * Create a new email account.
82  *
83  * @param[in] account   Specifies the structure pointer of account.
84  * @param[out] err_code Specifies the error code returned.
85  * @remarks N/A
86  * @return This function returns true on success or false on failure.
87  */
88 INTERNAL_FUNC int emdaemon_create_account(email_account_t* account, int* err_code);
89
90 /**
91  * Delete a email account.
92  *
93  * @param[in] account_id        Specifies the account ID.
94  * @param[out] err_code         Specifies the error code returned.
95  * @remarks N/A
96  * @return This function returns true on success or false on failure.
97  */
98 INTERNAL_FUNC int emdaemon_delete_account(int account_id, int* err_code);
99
100 /**
101  * Validate a email account.
102  *
103  * @param[in] account_id        Specifies the account ID.
104  * @param[out] err_code         Specifies the error code returned.
105  * @remarks N/A
106  * @return This function returns true on success or false on failure.
107  */
108 INTERNAL_FUNC int emdaemon_validate_account(int account_id, int *handle, int* err_code);
109
110 INTERNAL_FUNC int emdaemon_validate_account_ex(email_account_t* account, int *handle);
111
112 /**
113  * Change the information of a email account.
114  *
115  * @param[in] account_id        Specifies the orignal account ID.
116  * @param[in] new_account       Specifies the information of new account.
117  * @param[out] err_code         Specifies the error code returned.
118  * @remarks N/A
119  * @return This function returns true on success or false on failure.
120  */
121 INTERNAL_FUNC int emdaemon_update_account(int account_id, email_account_t* new_account, int* err_code);
122
123 /**
124  * Change the information of a email account after validation
125  *
126  * @param[in] old_account_id    Specifies the orignal account ID.
127  * @param[in] new_account_info  Specifies the information of new account.
128  * @param[in] handle                    Specifies the handle for stopping validation.
129  * @param[out] err_code                 Specifies the error code returned.
130  * @remarks N/A
131  * @return This function returns true on success or false on failure.
132  */
133 INTERNAL_FUNC int emdaemon_validate_account_and_update(int old_account_id, email_account_t* new_account_info, int *handle,int *err_code);
134
135 /**
136  * Get a email account by ID.
137  *
138  * @param[in] account_id        Specifies the account ID.
139  * @param[in] pulloption        Specifies the pulloption.
140  * @param[out] acount           The returned account is saved here.
141  * @param[out] err_code         Specifies the error code returned.
142  * @remarks N/A
143  * @return This function returns true on success or false on failure.
144  */
145 INTERNAL_FUNC int emdaemon_get_account(int account_id, int pulloption, email_account_t* acount, int* err_code);
146
147 /**
148  * Get all emails.
149  *
150  * @param[out] acount_list      The returned accounts are saved here.(possibly NULL)
151  * @param[out] count                    The count of returned accounts is saved here.(possibly 0)
152  * @param[out] err_code         Specifies the error code returned.
153  * @remarks N/A
154  * @return This function returns true on success or false on failure.
155  */
156 INTERNAL_FUNC int emdaemon_get_account_list(email_account_t** acount_list, int* count, int* err_code);
157
158 /**
159  * Free allocated memory.
160  *
161  * @param[in] account_list      Specifies the structure pointer of account.
162  * @param[in] count                     Specifies the count of accounts.
163  * @param[out] err_code         Specifies the error code returned.
164  * @remarks N/A
165  * @return This function returns true on success or false on failure.
166  */
167 INTERNAL_FUNC int emdaemon_free_account(email_account_t** account_list, int count, int* err_code);
168
169 /**
170  * Get a information of filtering.
171  *
172  * @param[in] filter_id                 Specifies the filter ID.
173  * @param[out] filtering_set    The returned information of filter are saved here.
174  * @param[out] err_code                 Specifies the error code returned.
175  * @remarks N/A
176  * @return This function returns true on success or false on failure.
177  */
178 INTERNAL_FUNC int emdaemon_get_filter(int filter_id, email_rule_t** filtering_set, int* err_code);
179
180 /**
181  * Get all filterings.
182  *
183  * @param[out] filtering_set            The returned filterings are saved here.(possibly NULL)
184  * @param[out] count                            The count of returned filters is saved here.(possibly 0)
185  * @param[out] err_code                 Specifies the error code returned.
186  * @remarks N/A
187  * @return This function returns true on success or false on failure.
188  */
189 INTERNAL_FUNC int emdaemon_get_filter_list(email_rule_t** filtering_set, int* count, int* err_code);
190
191 /**
192  * find a filter already exists.
193  *
194  * @param[in] filtering_set     Specifies the pointer of adding filter structure.
195  * @param[out] err_code         Specifies the error code returned.
196  * @remarks N/A
197  * @return This function returns true if enable add filter, else returns false.
198  */
199 INTERNAL_FUNC int emdaemon_find_filter(email_rule_t* filter_info, int* err_code);
200
201 /**
202  * Add a filter information.
203  *
204  * @param[in] filtering_set             Specifies the pointer of adding filter structure.
205  * @remarks N/A
206  * @return This function returns true on success or false on failure.(only EMAIL_FILTER_BLOCK supported.)
207  */
208 INTERNAL_FUNC int emdaemon_add_filter(email_rule_t* filtering_set);
209
210 /**
211  * Change a filter information.
212  *
213  * @param[in] filter_id Specifies the original filter ID.
214  * @param[in] new_set   Specifies the information of new filter.
215  * @param[out] err_code Specifies the error code returned.
216  * @remarks N/A
217  * @return This function returns true on success or false on failure.
218  */
219 INTERNAL_FUNC int emdaemon_update_filter(int filter_id, email_rule_t* new_set, int* err_code);
220
221 /**
222  * Delete a filter information.
223  *
224  * @param[in] filter_id Specifies the filter ID.
225  * @param[out] err_code         Specifies the error code returned.
226  * @remarks N/A
227  * @return This function returns true on success or false on failure.
228  */
229 INTERNAL_FUNC int emdaemon_delete_filter(int filter_id, int* err_code);
230
231 /**
232  * Free allocated memory.
233  *
234  * @param[in] filtering_set     Specifies the pointer of pointer of filter structure for memory free.
235  * @param[in] count                     Specifies the count of filter.
236  * @param[out] err_code         Specifies the error code returned.
237  * @remarks N/A
238  * @return This function returns true on success or false on failure.
239  */
240 INTERNAL_FUNC int emdaemon_free_filter (email_rule_t** filtering_set, int count, int* err_code);
241
242 /**
243  * Apply a filter information.
244  *
245  * @param[in] filter_id Specifies the filter ID.
246  * @param[out] err_code         Specifies the error code returned.
247  * @remarks N/A
248  * @return This function returns true on success or false on failure.
249  */
250 INTERNAL_FUNC int emdaemon_apply_filter(int filter_id, int* err_code);
251
252 /*****************************************************************************/
253 /*  Mail                                                                     */
254 /*****************************************************************************/
255
256 /**
257  * Send a mail.
258  *
259  * @param[in] mail_id                           Specifies the mail ID.
260  * @param[in] callback                  Specifies the callback function for retrieving sending information.
261  * @param[in] handle                            Specifies the handle for stopping sending.
262  * @param[out] err_code         Specifies the error code returned.
263  * @remarks N/A
264  * @return This function returns true on success or false on failure.
265  */
266 INTERNAL_FUNC int emdaemon_send_mail(int mail_id, int *handle, int* err_code);
267
268 /**
269  * Send all mails to been saved in Offline-mode.
270  *
271  * @param[in] account_id                        Specifies the account ID.
272  * @param[in] callback                          Specifies the callback function for retrieving sending information.
273  * @param[in] handle                                    Specifies the handle for stopping sending.
274  * @param[out] err_code                 Specifies the error code returned.
275  * @remarks N/A
276  * @return This function returns true on success or false on failure.
277  */
278 INTERNAL_FUNC int emdaemon_send_mail_saved(int account_id, int *handle, int* err_code);
279
280 INTERNAL_FUNC int emdaemon_add_mail(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data_list, int input_attachment_count, email_meeting_request_t *input_meeting_request, int input_from_eas);
281
282 INTERNAL_FUNC int emdaemon_add_meeting_request(int account_id, int input_mailbox_id, email_meeting_request_t *meeting_req, int* err_code);
283
284 /**
285  * Delete a mail or multiple mails.
286  *
287  * @param[in] mailbox_id                Specifies the mailbox.
288  * @param[in] mail_id                   Specifies the arrary of mail id.
289  * @param[in] num                               Specifies the number of mail id.
290  * @param[in] from_server           Specifies whether mails are deleted from server.
291  * @param[in] callback                  Specifies the callback function for retrieving deleting information.
292  * @param[in] handle                            Reserved.
293  * @param[out] err_code         Specifies the error code returned.
294  * @remarks N/A
295  * @return This function returns true on success or false on failure.
296  */
297
298 INTERNAL_FUNC int emdaemon_delete_mail(int mailbox_id, int mail_id[], int num, int from_server,  int *handle, int* err_code);
299
300 /**
301  * Delete all mail from a mailbox.
302  *
303  * @param[in] input_mailbox_id  Specifies the id of target mailbox.
304  * @param[in] input_from_server Specifies whether mails are also deleted from server.
305  * @param[in] output_handle             Reserved.
306  * @param[out] output_err_code  Specifies the error code returned.
307  * @remarks N/A
308  * @return This function returns true on success or false on failure.
309  */
310 INTERNAL_FUNC int emdaemon_delete_mail_all(int input_mailbox_id, int input_from_server, int *output_handle, int *output_err_code);
311
312 /**
313  * Move a email to another mailbox.
314  *
315  *
316  * @param[in] mail_id                   Specifies the mail ID.
317  * @param[in] dst_mailbox_id    Specifies the mailbox ID for moving email.
318  * @param[in] noti_param_1      Specifies first parameter of result notification.
319  * @param[in] noti_param_2      Specifies second parameter of result notification.
320  * @param[out] err_code                 Specifies the error code returned.
321  * @remarks N/A
322  * @return This function returns true on success or false on failure.
323  */
324 INTERNAL_FUNC int emdaemon_move_mail(int mail_ids[], int num, int dst_mailbox_id, int noti_param_1, int noti_param_2, int* err_code);
325
326 /**
327  * Move all email to another mailbox.
328  *
329  *
330  * @param[in] src_mailbox_id            Specifies the source mailbox ID for moving email.
331  * @param[in] dst_mailbox_id            Specifies the destination mailbox ID for moving email.
332  * @param[out] err_code                         Specifies the error code returned.
333  * @remarks N/A
334  * @return This function returns true on success or false on failure.
335  */
336 INTERNAL_FUNC int emdaemon_move_mail_all_mails(int src_mailbox_id, int dst_mailbox_id, int* err_code);
337
338
339 /**
340  * Update a existing email information.
341  *
342  * @param[in] input_mail_data   Specifies the structure of mail data.
343  * @param[in] input_attachment_data_list        Specifies the structure of mail data.
344  * @param[in] input_attachment_count    Specifies the pointer of attachment structure.
345  * @param[in] input_meeting_request     Specifies the number of attachment data.
346  * @param[in] input_from_eas    Specifies whether the mail is from EAS.
347  * @remarks N/A
348  * @return This function returns EMAIL_ERROR_NONE on success or error code on failure.
349  */
350 INTERNAL_FUNC int emdaemon_update_mail(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data_list, int input_attachment_count, email_meeting_request_t *input_meeting_request, int input_from_eas);
351
352
353 /**
354  * Callback for mail resend
355  *
356  * @param[in] data                            Specifies the pointer to mail_id.
357  * @remarks N/A
358  * @return This function returns void.
359  */
360 INTERNAL_FUNC void _OnMailSendRetryTimerCB( void* data );
361
362 /**
363  * Download email body from server.
364  *
365  * @param[in] account_id                Specifies the account ID.
366  * @param[in] mail_id                   Specifies the mail ID.
367  * @param[in] callback          Specifies the callback function for retrieving download status.
368  * @param[in] handle                    Specifies the handle for stopping downloading.
369  * @param[out] err_code Specifies the error code returned.
370  * @remarks N/A
371  * @return This function returns true on success or false on failure.
372  */
373 INTERNAL_FUNC int emdaemon_download_body(int account_id, int mail_id, int verbose, int with_attachment,  int *handle, int* err_code);
374
375 /**
376  * Get a mail attachment.
377  *
378  * @param[in] mail_id           Specifies the mail ID.
379  * @param[in] attachment_id     Specifies the attachment ID.
380  * @param[out] attachment       The returned attachment is save here.
381  * @param[out] err_code         Specifies the error code returned.
382  * @remarks N/A
383  * @return This function returns true on success or false on failure.
384  */
385 INTERNAL_FUNC int emdaemon_get_attachment(int attachment_id, email_attachment_data_t** attachment, int* err_code);
386
387 /**
388  * Download a email nth-attachment from server.
389  *
390  * @param[in] account_id                Specifies the account ID.
391  * @param[in] mail_id                   Specifies the mail ID.
392  * @param[in] nth                               Specifies the buffer that a attachment number been saved. the minimum number is "1".
393  * @param[in] callback          Specifies the callback function for retrieving download status.
394  * @param[in] handle                    Specifies the handle for stopping downloading.
395  * @param[out] err_code Specifies the error code returned.
396  * @remarks N/A
397  * @return This function returns true on success or false on failure.
398  */
399 INTERNAL_FUNC int emdaemon_download_attachment(int account_id, int mail_id, int nth,  int *handle, int* err_code);
400
401
402 /**
403  * Append a attachment to email.
404  *
405  * @param[in] mail_id           Specifies the mail ID.
406  * @param[in] attachment        Specifies the structure of attachment.
407  * @param[out] err_code         Specifies the error code returned.
408  * @remarks N/A
409  * @return This function returns true on success or false on failure.
410  */
411 INTERNAL_FUNC int emdaemon_add_attachment(int mail_id, email_attachment_data_t* attachment, int* err_code);
412
413 /**
414  * Delete a attachment from email.
415  *
416  * @param[in] mail_id           Specifies the mail id.
417  * @param[in] attachment_id  Specifies the attachment id.
418  * @param[out] err_code         Specifies the error code returned.
419  * @remarks N/A
420  * @return This function returns true on success or false on failure.
421  */
422 INTERNAL_FUNC int emdaemon_delete_mail_attachment(int attachment_id, int* err_code);
423
424 /**
425  * Free allocated memroy for email attachment.
426  *
427  * @param[in] atch_info Specifies the pointer of mail attachment structure pointer.
428  * @param[out] err_code Specifies the error code returned.
429  * @remarks N/A
430  * @return This function returns true on success or false on failure.
431  */
432 INTERNAL_FUNC int emdaemon_free_attachment_data(email_attachment_data_t** atch_info, int* err_code);
433
434 /**
435  * Change email read/unread flag.
436  * @param[in] account_id  Specifies the account id.
437  * @param[in] mail_ids          Specifies the array of mail ID.
438  * @param[in] num                           Specifies the numbers of mail ID.
439  * @param[in] field_type  Specifies the field type what you want to set. Refer email_flags_field_type.
440  * @param[in] value           Specifies the value what you want to set.
441  * @param[in] onserver          Specifies the mail on server.
442  * @param[out] err_code   Specifies the error code returned.
443  * @remarks N/A
444  * @return This function returns true on success or false on failure.
445  */
446 INTERNAL_FUNC int emdaemon_set_flags_field(int account_id, int mail_ids[], int num, email_flags_field_type field_type, int value, int onserver, int* err_code);
447
448 /*****************************************************************************/
449 /*  Mailbox                                                                  */
450 /*****************************************************************************/
451 INTERNAL_FUNC int emdaemon_get_imap_mailbox_list(int account_id, char* mailbox, int *handle, int* err_code);
452
453 /**
454  * Download header of new emails from mail server.
455  *
456  * @param[in] input_account_id          Specifies the account ID.
457  * @param[in] input_mailbox_id          Specifies the mailbox ID.
458  * @param[out] handle           Specifies the handle for stopping downloading.
459  * @param[out] err_code Specifies the error code returned.
460  * @remarks N/A
461  * @return This function returns true on success or false on failure.
462  */
463 INTERNAL_FUNC int emdaemon_sync_header(int input_account_id, int input_mailbox_id, int *handle, int* err_code);
464
465
466 /**
467  * Get mail count from mailbox.
468  *
469  * @param[in] mailbox   Specifies the pointer of mailbox structure.
470  * @param[out] total    Total email count is saved here.
471  * @param[out] unseen   Unread email count is saved here.
472  * @param[out] err_code Specifies the error code returned.
473  * @remarks N/A
474  * @return This function returns true on success or false on failure.
475  */
476 INTERNAL_FUNC int emdaemon_get_mail_count_of_mailbox(email_mailbox_t* mailbox, int* total, int* unseen, int* err_code);
477
478 /**
479  * Get all mailboxes from account.
480  *
481  * @param[in] account_id                Specifies the account ID.
482  * @param[out] mailbox_list     Specifies the pointer of mailbox structure pointer.(possibly NULL)
483  * @param[out] count                    The mailbox count is saved here.(possibly 0)
484  * @param[out] err_code         Specifies the error code returned.
485  * @remarks N/A
486  * @return This function returns true on success or false on failure.
487  */
488 INTERNAL_FUNC int emdaemon_get_mailbox_list(int account_id, email_mailbox_t** mailbox_list, int* count, int* err_code);
489
490 /**
491  * Create a new mailbox.
492  *
493  * @param[in] new_mailbox       Specifies the pointer of creating mailbox information.
494  * @param[out] handle           Specifies the handle for stopping creating mailbox.
495  * @param[out] err_code         Specifies the error code returned.
496  * @remarks N/A
497  * @return This function returns true on success or false on failure.
498  */
499 INTERNAL_FUNC int emdaemon_add_mailbox(email_mailbox_t* new_mailbox, int on_server, int *handle, int* err_code);
500
501 /**
502  * Delete a mailbox.
503  *
504  * @param[in] input_mailbox_id  Specifies the input_mailbox_id of deleting mailbox information.
505  * @param[out] handle                   Specifies the handle for stopping creating mailbox.
506  * @param[out] err_code                 Specifies the error code returned.
507  * @remarks N/A
508  * @return This function returns true on success or false on failure.
509  */
510 INTERNAL_FUNC int emdaemon_delete_mailbox(int input_mailbox_id, int on_server, int *handle, int* err_code);
511
512 /**
513  * Delete all sub-mailboxes from a specific mailbox.
514  *
515  * @param[in] mailbox   Specifies the pointer of mailbox information.
516  * @param[out] err_code Specifies the error code returned.
517  * @remarks N/A
518  * @return This function returns true on success or false on failure.
519  */
520 INTERNAL_FUNC int emdaemon_delete_mailbox_all(email_mailbox_t* mailbox, int* err_code);
521
522 /**
523  * Free allocated memory for mailbox information.
524  *
525  * @param[in] mailbox_list      Specifies the pointer for searching mailbox structure pointer.
526  * @param[in] count                     Specifies the count of mailboxes.
527  * @param[out] err_code         Specifies the error code returned.
528  * @remarks N/A
529  * @return This function returns true on success or false on failure.
530  */
531 INTERNAL_FUNC int emdaemon_free_mailbox(email_mailbox_t** mailbox_list, int count, int* err_code);
532
533 /*****************************************************************************/
534 /*  Etc                                                                      */
535 /*****************************************************************************/
536
537
538 /**
539  * Register a callback for event processing.
540  *
541  * @param[in] action                    Kind of event callback.
542  * @param[in] callback          Function which will be called during processing event.
543  * @param[in] event_data        Event data which will be passed to the callback.
544  * @remarks N/A
545  * @return This function returns true on success or false on failure.
546  */
547 INTERNAL_FUNC int emdaemon_register_event_callback(email_action_t action, email_event_callback callback, void* event_data);
548
549 /**
550  * Unregister a callback for event processing.
551  *
552  * @param[in] action                    Kind of event callback.
553  * @param[in] callback          Function which will be called during processing event.
554  * @remarks N/A
555  * @return This function returns true on success or false on failure.
556  */
557 INTERNAL_FUNC int emdaemon_unregister_event_callback(email_action_t action, email_event_callback callback);
558
559 /**
560  * Get current event queue status.
561  *
562  * @param[out] on_sending               True if sending is in progress.
563  * @param[out] on_receiving             True if receiving is in progress.
564  * @remarks N/A
565  */
566 INTERNAL_FUNC void emdaemon_get_event_queue_status(int* on_sending, int* on_receiving);
567
568 /**
569  * Get the handle of a pending job.
570  *
571  * @param[in] action                    Specifies kind of the job.
572  * @param[in] account_id        Specifies the account ID.
573  * @param[in] mail_id                   Specifies the mail ID.
574  * @remarks N/A
575  * @return This function return its handle if a pending job exists, otherwise -1.
576  */
577 INTERNAL_FUNC int emdaemon_get_pending_job(email_action_t action, int account_id, int mail_id, email_event_status_type_t* status);
578
579 /**
580  * Cancel a progressive work.
581  *
582  * @param[in] account_id                Specifies the account ID.
583  * @param[in] handle                            Specifies the ID of cancelling work.
584  * @param[out] err_code         Specifies the error code returned.
585  * @remarks N/A
586  * @return This function returns true on success or false on failure.
587  */
588 INTERNAL_FUNC int emdaemon_cancel_job(int account_id, int handle, int* err_code);
589
590
591
592 /**
593  * Cancel a progressive send mail job.
594  *
595  * @param[in] account_id                Specifies the account ID.
596  * @param[in] mail_id                           Specifies the Mail ID of cancelling send mail.
597  * @param[out] err_code         Specifies the error code returned.
598  * @remarks N/A
599  * @return This function returns true on success or false on failure.
600  */
601 INTERNAL_FUNC int emdaemon_cancel_sending_mail_job(int account_id, int mail_id, int* err_code);
602
603 /**
604  * set email options.
605  *
606  * @param[in] option                    Specifies the email options.
607  * @param[out] err_code Specifies the error code returned.
608  * @remarks N/A
609  * @return This function returns true on success or false on failure.
610  */
611 INTERNAL_FUNC int emdaemon_set_option(email_option_t* option, int* err_code);
612
613 /**
614  * get email options.
615  *
616  * @param[out] option                   Specifies the email options.
617  * @param[out] err_code         Specifies the error code returned.
618  * @remarks N/A
619  * @return This function returns true on success or false on failure.
620  */
621 INTERNAL_FUNC int emdaemon_get_option(email_option_t* option, int* err_code);
622
623 /**
624  * Sync the Local activity
625  *
626  *
627  * @param[in] account_id                Specifies the Account ID.
628  * @param[out] err_code         Specifies the error code returned.
629  * @remarks N/A
630  * @return This function returns true on success or false on failure.
631  */
632 INTERNAL_FUNC int emdaemon_sync_local_activity(int account_id, int *err_code);
633
634
635 #ifdef __FEATURE_AUTO_POLLING__
636 INTERNAL_FUNC int emdaemon_start_auto_polling(int* err_code);
637 #endif /* __FEATURE_AUTO_POLLING__ */
638
639 INTERNAL_FUNC int emdaemon_insert_accountinfo_to_contact(email_account_t* account);
640
641 INTERNAL_FUNC int emdaemon_update_accountinfo_to_contact(email_account_t* old_account, email_account_t* new_account);
642
643 INTERNAL_FUNC int emdaemon_update_mailbox(email_mailbox_t* old_mailbox, email_mailbox_t* new_mailbox, int on_server, int *handle, int* err_code);
644
645 INTERNAL_FUNC int emdaemon_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e input_mailbox_type);
646
647 INTERNAL_FUNC int emdaemon_set_local_mailbox(int input_mailbox_id, int input_is_local_mailbox);
648
649 INTERNAL_FUNC int emdaemon_search_mail_on_server(int input_account_id, int input_mailbox_id, email_search_filter_t *input_search_filter, int input_search_filter_count, unsigned int *output_handle, int *err_code);
650
651 INTERNAL_FUNC int emdaemon_clear_all_mail_data(int* err_code);
652
653 INTERNAL_FUNC int emdaemon_send_mail_retry( int mail_id,  int timeout_in_sec, int* err_code);
654
655 INTERNAL_FUNC int emdaemon_validate_account_and_create(email_account_t* new_account, int *handle, int* err_code);
656
657 INTERNAL_FUNC int emdaemon_set_mail_slot_size_of_mailbox(int account_id, int mailbox_id, int new_slot_size, int *handle, int *err_code);
658
659 INTERNAL_FUNC int emdaemon_rename_mailbox(int input_mailbox_id, char *input_mailbox_path, char *input_mailbox_alias, int input_on_server, int *output_handle);
660
661 INTERNAL_FUNC int emdaemon_move_mail_thread_to_mailbox(int thread_id, int target_mailbox_id, int move_always_flag, int *err_code);
662
663 INTERNAL_FUNC int emdaemon_delete_mail_thread(int thread_id, int delete_always_flag, int *handle, int *err_code);
664
665 INTERNAL_FUNC int emdaemon_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server, int *handle, int *err_code);
666
667 INTERNAL_FUNC int emdaemon_expunge_mails_deleted_flagged(int input_mailbox_id, int input_on_server, int *output_handle);
668
669 #ifdef __cplusplus
670 }
671 #endif /* __cplusplus */
672
673 /**
674 * @} @}
675 */
676
677 #endif /* __EMAIL_DAEMON_H__ */