Tizen 2.0 Release
[platform/core/messaging/email-service.git] / email-core / include / email-core-account.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-account.h
26  * Desc :  Account Management
27  * * Auth : 
28  * * History : 
29  *    2010.08.25  :  created
30  *****************************************************************************/
31 #ifndef _EMAIL_CORE_ACCOUNT_H_
32 #define _EMAIL_CORE_ACCOUNT_H_
33
34 #include "email-types.h"
35 #include "email-internal-types.h"
36 #include "email-storage.h"
37
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif /* __cplusplus */
42
43 INTERNAL_FUNC int emcore_validate_account(int account_id, int *err_code);
44
45 INTERNAL_FUNC int emcore_validate_account_with_account_info(email_account_t *account, int *err_code);
46
47 INTERNAL_FUNC int emcore_create_account(email_account_t *account, int *err_code);
48
49 INTERNAL_FUNC int emcore_delete_account(int account_id, int *err_code);
50
51 INTERNAL_FUNC int emcore_free_account_list(email_account_t **account_list, int count, int *err_code);
52
53 INTERNAL_FUNC void emcore_free_option(email_option_t *option);
54
55 INTERNAL_FUNC void emcore_free_account(email_account_t *account_list);
56
57 INTERNAL_FUNC void emcore_duplicate_account(const email_account_t *account, email_account_t **account_dup, int *err_code);
58
59 INTERNAL_FUNC int emcore_init_account_reference();
60
61 INTERNAL_FUNC int emcore_free_account_reference();
62
63 INTERNAL_FUNC email_account_t *emcore_get_account_reference(int account_id);
64
65 INTERNAL_FUNC int emcore_get_account_reference_list(email_account_t **account_list, int *count, int *err_code);
66
67 INTERNAL_FUNC int emcore_query_server_info(const char* domain_name, email_server_info_t **result_server_info);
68
69 INTERNAL_FUNC int emcore_free_server_info(email_server_info_t **target_server_info);
70
71 INTERNAL_FUNC int emcore_save_default_account_id(int input_account_id);
72
73 INTERNAL_FUNC int emcore_load_default_account_id(int *output_account_id);
74
75 INTERNAL_FUNC int emcore_recover_from_secured_storage_failure();
76
77 INTERNAL_FUNC int emcore_update_sync_status_of_account(int input_account_id, email_set_type_t input_set_operator, int input_sync_status);
78
79
80 #ifdef __FEATURE_BACKUP_ACCOUNT__
81 INTERNAL_FUNC int emcore_backup_accounts(const char *file_path, int *error_code);
82
83 INTERNAL_FUNC int emcore_restore_accounts(const char *file_path, int *error_code);
84 #endif /*   __FEATURE_BACKUP_ACCOUNT_ */
85
86 #ifdef __cplusplus
87 }
88 #endif /* __cplusplus */
89
90 #endif /*_EMAIL_CORE_ACCOUNT_H_*/
91