Tizen 2.0 Release
[platform/core/messaging/email-service.git] / email-daemon / include / email-daemon-emn.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 EMN.
26  * @file        email-daemon-emn.h
27  * @author      Kyuho Jo(kyuho.jo@samsung.com)
28  * @version     0.1
29  * @brief       This file is the header file of EMN library.
30  */
31
32 #ifndef __EMAIL_DAEMON_EMN_H__
33 #define __EMAIL_DAEMON_EMN_H__
34
35 /**
36 * @ingroup EMAIL_SERVICE
37 * @defgroup EMN EMN
38 * @{
39 */
40
41 #include "email-internal-types.h"
42
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif /* __cplusplus */
47
48 enum
49 {
50         EMN_HEADER_DATA = 0,
51         EMN_WBXML_DATA,
52 };
53
54 /* Error Values for the Email options */
55 enum
56 {
57         EMAIL_OPTION_ERROR_NONE = 0,
58         EMAIL_OPTION_ERROR_INVALID_PARAM,
59         EMAIL_OPTION_ERROR_STORAGE,
60 };
61
62 /* Manual Network value */
63 #define   EMAIL_OPTION_NETWORK_MANUAL  1
64
65
66 /* Enums for the Gcong Option Key */
67 typedef enum
68 {
69         EMAIL_OPTION_KEY_HOME_NETWORK = 0,
70         EMAIL_OPTION_KEY_ROAMING_NETWORK,
71 }optionkey;
72
73
74 int emdaemon_initialize_emn(void);
75 int emdaemon_finalize_emn(int bExtDest);
76
77 /** 
78  * This callback specifies the callback of retrieving the result that is downloaded new messages.
79  *
80  * @param[in] mail_count        Specifies count of new mail.
81  * @param[in] user_data         Specifies the user data.
82  * @param[in] err_code          Specifies the error code.
83  * @remarks N/A
84  * @return This function returns true on success or false on failure.
85  */
86 typedef int (*email_emn_noti_cb)(
87         void*                                   user_data,
88         int                     err_code
89 );
90
91 #ifdef USE_OMA_EMN
92 /**
93  * Handle OMA EMN data
94  *
95  * @param[in] wbxml_b64         Specifies the encoded string
96  * @param[in] callback          Specifies the callback function for retrieving the result that is downloaded new mail.
97  * @param[out] err_code         Specifies the error code returned.
98  * @remarks N/A
99  * @return This function returns true on success or false on failure.
100  */
101 INTERNAL_FUNC int emdaemon_handle_emn_notification(unsigned char* wbxml_b64, email_emn_noti_cb callback, int* err_code);
102 #endif
103
104 #ifdef __cplusplus
105 }
106 #endif /* __cplusplus */
107
108 /**
109 * @} @}
110 */
111
112
113 #endif /* __EMAIL_DAEMON_EMN_H__ */
114 /* EOF */
115