Tizen 2.0 Release
[platform/core/messaging/email-service.git] / email-core / include / email-core-mailbox.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  * File :  email-core-mailbox.h
26  * Desc :  Local Mailbox Management Header
27  *
28  * Auth : 
29  *
30  * History : 
31  *    2006.08.16  :  created
32  *****************************************************************************/
33 #ifndef __EMAIL_CORE_MAILBOX_H__
34 #define __EMAIL_CORE_MAILBOX_H__
35
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif /* __cplusplus */
40
41 #include "c-client.h"
42 #include "email-types.h"
43 #include "email-internal-types.h"
44
45 typedef enum      
46 {
47         EM_CORE_STREAM_TYPE_RECV = 0,   
48         EM_CORE_STREAM_TYPE_SEND,               
49 } emcore_stream_type_t;
50
51 #ifdef __FEATURE_KEEP_CONNECTION__
52 INTERNAL_FUNC int emcore_remove_connection_info(int account_id);
53 #endif /* __FEATURE_KEEP_CONNECTION__ */
54 /*  in SMTP case, path argument must be (ENCODED_PATH_SMTP) */
55 /*  ex) emcore_connect_to_remote_mailbox(xxx, (char *)ENCODED_PATH_SMTP, xxx, xxx); */
56 INTERNAL_FUNC int  emcore_connect_to_remote_mailbox_with_account_info(email_account_t *ref_account, int input_mailbox_id, void **mail_stream, int *err_code);
57 INTERNAL_FUNC int  emcore_connect_to_remote_mailbox(int account_id, int input_mailbox_id, void **mail_stream, int *err_code);
58 INTERNAL_FUNC int  emcore_close_mailbox(int account_id, void *mail_stream);
59 #ifdef __FEATURE_KEEP_CONNECTION__
60 INTERNAL_FUNC void emcore_close_mailbox_receiving_stream();
61 INTERNAL_FUNC void emcore_close_mailbox_partial_body_stream();
62 INTERNAL_FUNC void emcore_reset_streams();
63 #endif
64
65 INTERNAL_FUNC int  emcore_get_mailbox_list_to_be_sync(int account_id, email_mailbox_t **mailbox_list, int *p_count, int *err_code);
66 INTERNAL_FUNC int  emcore_get_mailbox_list(int account_id, email_mailbox_t **mailbox_list, int *p_count, int *err_code);
67 INTERNAL_FUNC int  emcore_get_mail_count(email_mailbox_t *mailbox, int *total, int *unseen, int *err_code);
68 INTERNAL_FUNC int  emcore_create_mailbox(email_mailbox_t *new_mailbox, int on_server, int *err_code);
69 INTERNAL_FUNC int  emcore_delete_mailbox(int input_mailbox_id, int on_server, int *err_code);
70 INTERNAL_FUNC int  emcore_delete_mailbox_ex(int input_account_id, int *input_mailbox_id_array, int input_mailbox_id_count, int input_on_server);
71 INTERNAL_FUNC int  emcore_delete_mailbox_all(email_mailbox_t *mailbox, int *err_code);
72 INTERNAL_FUNC int  emcore_update_mailbox(email_mailbox_t *old_mailbox, email_mailbox_t *new_mailbox, int *err_code);
73 INTERNAL_FUNC int  emcore_save_local_activity_sync(int account_id, int *err_code);
74 INTERNAL_FUNC int  emcore_send_mail_event(email_mailbox_t *mailbox, int mail_id , int *err_code);
75 INTERNAL_FUNC int  emcore_partial_body_thd_local_activity_sync(int *is_event_inserted, int *err_code);
76 INTERNAL_FUNC int  emcore_get_mailbox_by_type(int account_id, email_mailbox_type_e mailbox_type, email_mailbox_t *spam_mailbox, int *err_code);
77 INTERNAL_FUNC void emcore_free_mailbox_list(email_mailbox_t **mailbox_list, int count);
78 INTERNAL_FUNC void emcore_free_mailbox(email_mailbox_t *mailbox);
79
80 INTERNAL_FUNC void emcore_bind_mailbox_type(email_internal_mailbox_t *mailbox_list);
81 INTERNAL_FUNC int  emcore_free_internal_mailbox(email_internal_mailbox_t **mailbox_list, int count, int *err_code);
82
83
84
85
86 #ifdef __FEATURE_LOCAL_ACTIVITY__
87 INTERNAL_FUNC int  emcore_local_activity_sync(int account_id, int *err_code);
88 INTERNAL_FUNC int  emcore_save_local_activity_sync(int account_id, int *err_code);
89 #endif
90
91
92 #ifdef __cplusplus
93 }
94 #endif /* __cplusplus */
95
96 #endif