2.0_alpha release commit
[framework/messaging/email-service.git] / email-daemon / include / email-daemon.h
1 /*
2 *  email-service
3 *
4 * Copyright (c) 2000 - 2011 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, unsigned* handle, int* err_code);
109
110 /**
111  * Change the information of a email account.
112  *
113  * @param[in] account_id        Specifies the orignal account ID.
114  * @param[in] new_account       Specifies the information of new account.
115  * @param[out] err_code         Specifies the error code returned.
116  * @remarks N/A
117  * @return This function returns true on success or false on failure.
118  */
119 INTERNAL_FUNC int emdaemon_update_account(int account_id, email_account_t* new_account, int* err_code);
120
121 /**
122  * Change the information of a email account after validation
123  *
124  * @param[in] old_account_id    Specifies the orignal account ID.
125  * @param[in] new_account_info  Specifies the information of new account.
126  * @param[in] handle                    Specifies the handle for stopping validation.
127  * @param[out] err_code                 Specifies the error code returned.
128  * @remarks N/A
129  * @return This function returns true on success or false on failure.
130  */
131 INTERNAL_FUNC int emdaemon_validate_account_and_update(int old_account_id, email_account_t* new_account_info, unsigned* handle,int *err_code);
132
133 /**
134  * Get a email account by ID.
135  *
136  * @param[in] account_id        Specifies the account ID.
137  * @param[in] pulloption        Specifies the pulloption.
138  * @param[out] acount           The returned account is saved here.
139  * @param[out] err_code         Specifies the error code returned.
140  * @remarks N/A
141  * @return This function returns true on success or false on failure.
142  */
143 INTERNAL_FUNC int emdaemon_get_account(int account_id, int pulloption, email_account_t* acount, int* err_code);
144
145 /**
146  * Get all emails.
147  *
148  * @param[out] acount_list      The returned accounts are saved here.(possibly NULL)
149  * @param[out] count                    The count of returned accounts is saved here.(possibly 0)
150  * @param[out] err_code         Specifies the error code returned.
151  * @remarks N/A
152  * @return This function returns true on success or false on failure.
153  */
154 INTERNAL_FUNC int emdaemon_get_account_list(email_account_t** acount_list, int* count, int* err_code);
155
156 /**
157  * Free allocated memory.
158  *
159  * @param[in] account_list      Specifies the structure pointer of account.
160  * @param[in] count                     Specifies the count of accounts.
161  * @param[out] err_code         Specifies the error code returned.
162  * @remarks N/A
163  * @return This function returns true on success or false on failure.
164  */
165 INTERNAL_FUNC int emdaemon_free_account(email_account_t** account_list, int count, int* err_code);
166
167 /**
168  * Get a information of filtering.
169  *
170  * @param[in] filter_id                 Specifies the filter ID.
171  * @param[out] filtering_set    The returned information of filter are saved here.
172  * @param[out] err_code                 Specifies the error code returned.
173  * @remarks N/A
174  * @return This function returns true on success or false on failure.
175  */
176 INTERNAL_FUNC int emdaemon_get_filter(int filter_id, email_rule_t** filtering_set, int* err_code);
177
178 /**
179  * Get all filterings.
180  *
181  * @param[out] filtering_set            The returned filterings are saved here.(possibly NULL)
182  * @param[out] count                            The count of returned filters is saved here.(possibly 0)
183  * @param[out] err_code                 Specifies the error code returned.
184  * @remarks N/A
185  * @return This function returns true on success or false on failure.
186  */
187 INTERNAL_FUNC int emdaemon_get_filter_list(email_rule_t** filtering_set, int* count, int* err_code);
188
189 /**
190  * find a filter already exists.
191  *
192  * @param[in] filtering_set     Specifies the pointer of adding filter structure.
193  * @param[out] err_code         Specifies the error code returned.
194  * @remarks N/A
195  * @return This function returns true if enable add filter, else returns false.
196  */
197 INTERNAL_FUNC int emdaemon_find_filter(email_rule_t* filter_info, int* err_code);
198
199 /**
200  * Add a filter information.
201  *
202  * @param[in] filtering_set             Specifies the pointer of adding filter structure.
203  * @param[out] err_code         Specifies the error code returned.
204  * @remarks N/A
205  * @return This function returns true on success or false on failure.(only EMAIL_FILTER_BLOCK supported.)
206  */
207 INTERNAL_FUNC int emdaemon_add_filter(email_rule_t* filtering_set, int* err_code);
208
209 /**
210  * Change a filter information.
211  *
212  * @param[in] filter_id Specifies the original filter ID.
213  * @param[in] new_set   Specifies the information of new filter.
214  * @param[out] err_code Specifies the error code returned.
215  * @remarks N/A
216  * @return This function returns true on success or false on failure.
217  */
218 INTERNAL_FUNC int emdaemon_update_filter(int filter_id, email_rule_t* new_set, int* err_code);
219
220 /**
221  * Delete a filter information.
222  *
223  * @param[in] filter_id Specifies the filter ID.
224  * @param[out] err_code         Specifies the error code returned.
225  * @remarks N/A
226  * @return This function returns true on success or false on failure.
227  */
228 INTERNAL_FUNC int emdaemon_delete_filter(int filter_id, int* err_code);
229
230 /**
231  * Free allocated memory.
232  *
233  * @param[in] filtering_set     Specifies the pointer of pointer of filter structure for memory free.
234  * @param[in] count                     Specifies the count of filter.
235  * @param[out] err_code         Specifies the error code returned.
236  * @remarks N/A
237  * @return This function returns true on success or false on failure.
238  */
239 INTERNAL_FUNC int emdaemon_free_filter (email_rule_t** filtering_set, int count, int* err_code);
240
241
242 /*****************************************************************************/
243 /*  Mail                                                                     */
244 /*****************************************************************************/
245
246 /**
247  * Send a mail.
248  *
249  * @param[in] mail_id                           Specifies the mail ID.
250  * @param[in] sending_option    Specifies the sending option.
251  * @param[in] callback                  Specifies the callback function for retrieving sending information.
252  * @param[in] handle                            Specifies the handle for stopping sending.
253  * @param[out] err_code         Specifies the error code returned.
254  * @remarks N/A
255  * @return This function returns true on success or false on failure.
256  */
257 INTERNAL_FUNC int emdaemon_send_mail(int mail_id, email_option_t* sending_option,  unsigned* handle, int* err_code);
258
259 /**
260  * Send all mails to been saved in Offline-mode.
261  *
262  * @param[in] account_id                        Specifies the account ID.
263  * @param[in] sending_option    Specifies the sending option.
264  * @param[in] callback                          Specifies the callback function for retrieving sending information.
265  * @param[in] handle                                    Specifies the handle for stopping sending.
266  * @param[out] err_code                 Specifies the error code returned.
267  * @remarks N/A
268  * @return This function returns true on success or false on failure.
269  */
270 INTERNAL_FUNC int emdaemon_send_mail_saved(int account_id, email_option_t* sending_option,  unsigned* handle, int* err_code);
271
272 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);
273
274 INTERNAL_FUNC int emdaemon_add_meeting_request(int account_id, int input_mailbox_id, email_meeting_request_t *meeting_req, int* err_code);
275
276 /**
277  * Delete a mail or multiple mails.
278  *
279  * @param[in] mailbox_id                Specifies the mailbox.
280  * @param[in] mail_id                   Specifies the arrary of mail id.
281  * @param[in] num                               Specifies the number of mail id.
282  * @param[in] from_server           Specifies whether mails are deleted from server.
283  * @param[in] callback                  Specifies the callback function for retrieving deleting information.
284  * @param[in] handle                            Reserved.
285  * @param[out] err_code         Specifies the error code returned.
286  * @remarks N/A
287  * @return This function returns true on success or false on failure.
288  */
289
290 INTERNAL_FUNC int emdaemon_delete_mail(int mailbox_id, int mail_id[], int num, int from_server,  unsigned* handle, int* err_code);
291
292 /**
293  * Delete all mail from a mailbox.
294  *
295  * @param[in] input_mailbox_id  Specifies the id of target mailbox.
296  * @param[in] input_from_server Specifies whether mails are also deleted from server.
297  * @param[in] output_handle             Reserved.
298  * @param[out] output_err_code  Specifies the error code returned.
299  * @remarks N/A
300  * @return This function returns true on success or false on failure.
301  */
302 INTERNAL_FUNC int emdaemon_delete_mail_all(int input_mailbox_id, int input_from_server, unsigned *output_handle, int *output_err_code);
303
304 /**
305  * Move a email to another mailbox.
306  *
307  *
308  * @param[in] mail_id                   Specifies the mail ID.
309  * @param[in] dst_mailbox_id    Specifies the mailbox ID for moving email.
310  * @param[in] noti_param_1      Specifies first parameter of result notification.
311  * @param[in] noti_param_2      Specifies second parameter of result notification.
312  * @param[out] err_code                 Specifies the error code returned.
313  * @remarks N/A
314  * @return This function returns true on success or false on failure.
315  */
316 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);
317
318 /**
319  * Move all email to another mailbox.
320  *
321  *
322  * @param[in] src_mailbox_id            Specifies the source mailbox ID for moving email.
323  * @param[in] dst_mailbox_id            Specifies the destination mailbox ID for moving email.
324  * @param[out] err_code                         Specifies the error code returned.
325  * @remarks N/A
326  * @return This function returns true on success or false on failure.
327  */
328 INTERNAL_FUNC int emdaemon_move_mail_all_mails(int src_mailbox_id, int dst_mailbox_id, int* err_code);
329
330
331 /**
332  * Update a existing email information.
333  *
334  * @param[in] input_mail_data   Specifies the structure of mail data.
335  * @param[in] input_attachment_data_list        Specifies the structure of mail data.
336  * @param[in] input_attachment_count    Specifies the pointer of attachment structure.
337  * @param[in] input_meeting_request     Specifies the number of attachment data.
338  * @param[in] input_from_eas    Specifies whether the mail is from EAS.
339  * @remarks N/A
340  * @return This function returns EMAIL_ERROR_NONE on success or error code on failure.
341  */
342 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);
343
344
345 /**
346  * Callback for mail resend
347  *
348  * @param[in] data                            Specifies the pointer to mail_id.
349  * @remarks N/A
350  * @return This function returns void.
351  */
352 INTERNAL_FUNC void _OnMailSendRetryTimerCB( void* data );
353
354 /**
355  * Download email body from server.
356  *
357  * @param[in] account_id                Specifies the account ID.
358  * @param[in] mail_id                   Specifies the mail ID.
359  * @param[in] callback          Specifies the callback function for retrieving download status.
360  * @param[in] handle                    Specifies the handle for stopping downloading.
361  * @param[out] err_code Specifies the error code returned.
362  * @remarks N/A
363  * @return This function returns true on success or false on failure.
364  */
365 INTERNAL_FUNC int emdaemon_download_body(int account_id, int mail_id, int verbose, int with_attachment,  unsigned* handle, int* err_code);
366
367 /**
368  * Get a mail attachment.
369  *
370  * @param[in] mail_id           Specifies the mail ID.
371  * @param[in] attachment_id     Specifies the attachment ID.
372  * @param[out] attachment       The returned attachment is save here.
373  * @param[out] err_code         Specifies the error code returned.
374  * @remarks N/A
375  * @return This function returns true on success or false on failure.
376  */
377 INTERNAL_FUNC int emdaemon_get_attachment(int attachment_id, email_attachment_data_t** attachment, int* err_code);
378
379 /**
380  * Download a email nth-attachment from server.
381  *
382  * @param[in] account_id                Specifies the account ID.
383  * @param[in] mail_id                   Specifies the mail ID.
384  * @param[in] nth                               Specifies the buffer that a attachment number been saved. the minimum number is "1".
385  * @param[in] callback          Specifies the callback function for retrieving download status.
386  * @param[in] handle                    Specifies the handle for stopping downloading.
387  * @param[out] err_code Specifies the error code returned.
388  * @remarks N/A
389  * @return This function returns true on success or false on failure.
390  */
391 INTERNAL_FUNC int emdaemon_download_attachment(int account_id, int mail_id, int nth,  unsigned* handle, int* err_code);
392
393
394 /**
395  * Append a attachment to email.
396  *
397  * @param[in] mail_id           Specifies the mail ID.
398  * @param[in] attachment        Specifies the structure of attachment.
399  * @param[out] err_code         Specifies the error code returned.
400  * @remarks N/A
401  * @return This function returns true on success or false on failure.
402  */
403 INTERNAL_FUNC int emdaemon_add_attachment(int mail_id, email_attachment_data_t* attachment, int* err_code);
404
405 /**
406  * Delete a attachment from email.
407  *
408  * @param[in] mail_id           Specifies the mail id.
409  * @param[in] attachment_id  Specifies the attachment id.
410  * @param[out] err_code         Specifies the error code returned.
411  * @remarks N/A
412  * @return This function returns true on success or false on failure.
413  */
414 INTERNAL_FUNC int emdaemon_delete_mail_attachment(int attachment_id, int* err_code);
415
416 /**
417  * Free allocated memroy for email attachment.
418  *
419  * @param[in] atch_info Specifies the pointer of mail attachment structure pointer.
420  * @param[out] err_code Specifies the error code returned.
421  * @remarks N/A
422  * @return This function returns true on success or false on failure.
423  */
424 INTERNAL_FUNC int emdaemon_free_attachment_data(email_attachment_data_t** atch_info, int* err_code);
425
426 /**
427  * Change email flag.
428  *
429  * @param[in] mailbox   Reserved.
430  * @param[in] mail_id   Specifies the mail ID.
431  * @param[in] new_flag  Specifies the new email flag.
432  * @param[out] err_code Specifies the error code returned.
433  * @remarks N/A
434  * @return This function returns true on success or false on failure.
435  */
436 INTERNAL_FUNC int emdaemon_modify_flag(int mail_id, email_mail_flag_t new_flag, int onserver, int sticky_flag, int* err_code);
437
438 /**
439  * Change email extra flag.
440  *
441  * @param[in] mailbox   Reserved.
442  * @param[in] mail_id   Specifies the mail ID.
443  * @param[in] new_flag  Specifies the new email extra flag.
444  * @param[out] err_code Specifies the error code returned.
445  * @remarks N/A
446  * @return This function returns true on success or false on failure.
447  */
448 INTERNAL_FUNC int emdaemon_modify_extra_flag(int mail_id, email_extra_flag_t new_flag, int* err_code);
449
450 /**
451  * Change email read/unread flag.
452  * @param[in] account_id  Specifies the account id.
453  * @param[in] mail_ids          Specifies the array of mail ID.
454  * @param[in] num                           Specifies the numbers of mail ID.
455  * @param[in] field_type  Specifies the field type what you want to set. Refer email_flags_field_type.
456  * @param[in] value           Specifies the value what you want to set.
457  * @param[in] onserver          Specifies the mail on server.
458  * @param[out] err_code   Specifies the error code returned.
459  * @remarks N/A
460  * @return This function returns true on success or false on failure.
461  */
462 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);
463
464 /*****************************************************************************/
465 /*  Mailbox                                                                  */
466 /*****************************************************************************/
467 INTERNAL_FUNC int emdaemon_get_imap_mailbox_list(int account_id, char* mailbox, unsigned* handle, int* err_code);
468
469 /**
470  * Download header of new emails from mail server.
471  *
472  * @param[in] input_account_id          Specifies the account ID.
473  * @param[in] input_mailbox_id          Specifies the mailbox ID.
474  * @param[out] handle           Specifies the handle for stopping downloading.
475  * @param[out] err_code Specifies the error code returned.
476  * @remarks N/A
477  * @return This function returns true on success or false on failure.
478  */
479 INTERNAL_FUNC int emdaemon_sync_header(int input_account_id, int input_mailbox_id, unsigned* handle, int* err_code);
480
481
482 /**
483  * Get mail count from mailbox.
484  *
485  * @param[in] mailbox   Specifies the pointer of mailbox structure.
486  * @param[out] total    Total email count is saved here.
487  * @param[out] unseen   Unread email count is saved here.
488  * @param[out] err_code Specifies the error code returned.
489  * @remarks N/A
490  * @return This function returns true on success or false on failure.
491  */
492 INTERNAL_FUNC int emdaemon_get_mail_count_of_mailbox(email_mailbox_t* mailbox, int* total, int* unseen, int* err_code);
493
494 /**
495  * Get all mailboxes from account.
496  *
497  * @param[in] account_id                Specifies the account ID.
498  * @param[out] mailbox_list     Specifies the pointer of mailbox structure pointer.(possibly NULL)
499  * @param[out] count                    The mailbox count is saved here.(possibly 0)
500  * @param[out] err_code         Specifies the error code returned.
501  * @remarks N/A
502  * @return This function returns true on success or false on failure.
503  */
504 INTERNAL_FUNC int emdaemon_get_mailbox_list(int account_id, email_mailbox_t** mailbox_list, int* count, int* err_code);
505
506 /**
507  * Create a new mailbox.
508  *
509  * @param[in] new_mailbox       Specifies the pointer of creating mailbox information.
510  * @param[out] handle           Specifies the handle for stopping creating mailbox.
511  * @param[out] err_code         Specifies the error code returned.
512  * @remarks N/A
513  * @return This function returns true on success or false on failure.
514  */
515 INTERNAL_FUNC int emdaemon_add_mailbox(email_mailbox_t* new_mailbox, int on_server, unsigned* handle, int* err_code);
516
517 /**
518  * Delete a mailbox.
519  *
520  * @param[in] input_mailbox_id  Specifies the input_mailbox_id of deleting mailbox information.
521  * @param[out] handle                   Specifies the handle for stopping creating mailbox.
522  * @param[out] err_code                 Specifies the error code returned.
523  * @remarks N/A
524  * @return This function returns true on success or false on failure.
525  */
526 INTERNAL_FUNC int emdaemon_delete_mailbox(int input_mailbox_id, int on_server, unsigned* handle, int* err_code);
527
528 /**
529  * Delete all sub-mailboxes from a specific mailbox.
530  *
531  * @param[in] mailbox   Specifies the pointer of mailbox information.
532  * @param[out] err_code Specifies the error code returned.
533  * @remarks N/A
534  * @return This function returns true on success or false on failure.
535  */
536 INTERNAL_FUNC int emdaemon_delete_mailbox_all(email_mailbox_t* mailbox, int* err_code);
537
538 /**
539  * Free allocated memory for mailbox information.
540  *
541  * @param[in] mailbox_list      Specifies the pointer for searching mailbox structure pointer.
542  * @param[in] count                     Specifies the count of mailboxes.
543  * @param[out] err_code         Specifies the error code returned.
544  * @remarks N/A
545  * @return This function returns true on success or false on failure.
546  */
547 INTERNAL_FUNC int emdaemon_free_mailbox(email_mailbox_t** mailbox_list, int count, int* err_code);
548
549 /*****************************************************************************/
550 /*  Etc                                                                      */
551 /*****************************************************************************/
552
553
554 /**
555  * Register a callback for event processing.
556  *
557  * @param[in] action                    Kind of event callback.
558  * @param[in] callback          Function which will be called during processing event.
559  * @param[in] event_data        Event data which will be passed to the callback.
560  * @remarks N/A
561  * @return This function returns true on success or false on failure.
562  */
563 INTERNAL_FUNC int emdaemon_register_event_callback(email_action_t action, email_event_callback callback, void* event_data);
564
565 /**
566  * Unregister a callback for event processing.
567  *
568  * @param[in] action                    Kind of event callback.
569  * @param[in] callback          Function which will be called during processing event.
570  * @remarks N/A
571  * @return This function returns true on success or false on failure.
572  */
573 INTERNAL_FUNC int emdaemon_unregister_event_callback(email_action_t action, email_event_callback callback);
574
575 /**
576  * Get current event queue status.
577  *
578  * @param[out] on_sending               True if sending is in progress.
579  * @param[out] on_receiving             True if receiving is in progress.
580  * @remarks N/A
581  */
582 INTERNAL_FUNC void emdaemon_get_event_queue_status(int* on_sending, int* on_receiving);
583
584 /**
585  * Get the handle of a pending job.
586  *
587  * @param[in] action                    Specifies kind of the job.
588  * @param[in] account_id        Specifies the account ID.
589  * @param[in] mail_id                   Specifies the mail ID.
590  * @remarks N/A
591  * @return This function return its handle if a pending job exists, otherwise -1.
592  */
593 INTERNAL_FUNC int emdaemon_get_pending_job(email_action_t action, int account_id, int mail_id, email_event_status_type_t* status);
594
595 /**
596  * Cancel a progressive work.
597  *
598  * @param[in] account_id                Specifies the account ID.
599  * @param[in] handle                            Specifies the ID of cancelling work.
600  * @param[out] err_code         Specifies the error code returned.
601  * @remarks N/A
602  * @return This function returns true on success or false on failure.
603  */
604 INTERNAL_FUNC int emdaemon_cancel_job(int account_id, int handle, int* err_code);
605
606
607
608 /**
609  * Cancel a progressive send mail job.
610  *
611  * @param[in] account_id                Specifies the account ID.
612  * @param[in] mail_id                           Specifies the Mail ID of cancelling send mail.
613  * @param[out] err_code         Specifies the error code returned.
614  * @remarks N/A
615  * @return This function returns true on success or false on failure.
616  */
617 INTERNAL_FUNC int emdaemon_cancel_sending_mail_job(int account_id, int mail_id, int* err_code);
618
619 /**
620  * set email options.
621  *
622  * @param[in] option                    Specifies the email options.
623  * @param[out] err_code Specifies the error code returned.
624  * @remarks N/A
625  * @return This function returns true on success or false on failure.
626  */
627 INTERNAL_FUNC int emdaemon_set_option(email_option_t* option, int* err_code);
628
629 /**
630  * get email options.
631  *
632  * @param[out] option                   Specifies the email options.
633  * @param[out] err_code         Specifies the error code returned.
634  * @remarks N/A
635  * @return This function returns true on success or false on failure.
636  */
637 INTERNAL_FUNC int emdaemon_get_option(email_option_t* option, int* err_code);
638
639 /**
640  * Sync the Local activity
641  *
642  *
643  * @param[in] account_id                Specifies the Account ID.
644  * @param[out] err_code         Specifies the error code returned.
645  * @remarks N/A
646  * @return This function returns true on success or false on failure.
647  */
648 INTERNAL_FUNC int emdaemon_sync_local_activity(int account_id, int *err_code);
649
650
651 #ifdef __FEATURE_AUTO_POLLING__
652 INTERNAL_FUNC int emdaemon_start_auto_polling(int* err_code);
653 #endif /* __FEATURE_AUTO_POLLING__ */
654
655 INTERNAL_FUNC int emdaemon_insert_accountinfo_to_contact(email_account_t* account);
656
657 INTERNAL_FUNC int emdaemon_update_accountinfo_to_contact(email_account_t* old_account, email_account_t* new_account);
658
659 INTERNAL_FUNC int emdaemon_update_mailbox(email_mailbox_t* old_mailbox, email_mailbox_t* new_mailbox, int on_server, unsigned* handle, int* err_code);
660
661 INTERNAL_FUNC int emdaemon_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e input_mailbox_type);
662
663 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);
664
665 INTERNAL_FUNC int emdaemon_clear_all_mail_data(int* err_code);
666
667 INTERNAL_FUNC int emdaemon_send_mail_retry( int mail_id,  int timeout_in_sec, int* err_code);
668
669 INTERNAL_FUNC int emdaemon_validate_account_and_create(email_account_t* new_account, unsigned* handle, int* err_code);
670
671 INTERNAL_FUNC int emdaemon_set_mail_slot_size_of_mailbox(int account_id, int mailbox_id, int new_slot_size, unsigned* handle, int *err_code);
672
673 INTERNAL_FUNC int emdaemon_rename_mailbox(int input_mailbox_id, char *input_mailbox_path, char *input_mailbox_alias, int input_on_server, unsigned *output_handle);
674
675 INTERNAL_FUNC int emdaemon_move_mail_thread_to_mailbox(int thread_id, int target_mailbox_id, int move_always_flag, int *err_code);
676
677 INTERNAL_FUNC int emdaemon_delete_mail_thread(int thread_id, int delete_always_flag, unsigned* handle, int *err_code);
678
679 INTERNAL_FUNC int emdaemon_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server, unsigned* handle, int *err_code);
680
681 INTERNAL_FUNC int emdaemon_expunge_mails_deleted_flagged(int input_mailbox_id, int input_on_server, unsigned *output_handle);
682
683 #ifdef __cplusplus
684 }
685 #endif /* __cplusplus */
686
687 /**
688 * @} @}
689 */
690
691 #endif /* __EMAIL_DAEMON_H__ */