summaryrefslogtreecommitdiff
path: root/email-api/include/email-api-init.h
blob: 6e2ffe118a2fa7b3fe3290aef137915ecf65e68c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
*  email-service
*
* Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/


#ifndef __EMAIL_API_INTI_H__
#define __EMAIL_API_INTI_H__

#include "email-types.h"

/**
* @defgroup EMAIL_SERVICE Email Service
* @{
*/


/**
* @ingroup EMAIL_SERVICE
* @defgroup EMAIL_API_INIT Email Initialization API
* @{
*/

/**
 *
 * This file contains the data structures and interfaces needed for application,
 * to interact with email-service.
 * @file		email-api-init.h
 * @author	Kyuho Jo <kyuho.jo@samsung.com>
 * @author	Sunghyun Kwon <sh0701.kwon@samsung.com>
 * @version	0.1
 * @brief 	This file contains the data structures and interfaces of Email FW Initialization provided by
 *			email-service .
 *@{
 *@code
 *
 *	#include "email-api-init.h"
 *
 *	bool
 *	other_app_invoke_uniform_api_sample(int* error_code)
 *	{
 *		 int err = EMAIL_ERROR_NONE;
 *
 *		// Open connections to email-service and DB
 *		// The connections will be maintain throughout application's execution
 *		if(EMAIL_ERROR_NONE == email_service_begin())
 *		{
 *			If(EMAIL_ERROR_NONE != email_open_db())
 *			{
 *				return false;
 *			}
 *
 *			// Execute email_init_storage() if and only if there is no db file.
 *  			// This fuction will create db file and tables for email service
 *			If(EMAIL_ERROR_NONE !=email_init_storage())
 *			{
 *				return false;
 *			}
 *		}
 *
 *		......
 *
 *		// Work with calling MAPI functions
 *
 *		......
 *
 *		// Close the connections to email-service and DB after all email job is finished. (ex. close an email application)
 *		// DO NOT have to call these funtions until the connections is not needed any more.
 *		err =email_close_db();
 *		err =email_service_end();
 * 	 }
 *
 * @endcode
 * @}
 */



#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/**
 * @fn email_init_storage(void)
 * @brief	Create all tables for email.
 *
 * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure
 * @exception none
 * @see none
 * @remarks N/A
 */
EXPORT_API int email_init_storage(void);

/**
 * @fn email_open_db(void)
 * @brief This function Open the email DB and register busy handler
 *
 * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
 * @exception none
 * @see 	none
 * @remarks N/A
 */
EXPORT_API int email_open_db(void);


/**
 * @fn email_close_db(void)
 * @brief	This function closes the connection of  the email DB
 *
 * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
 * @exception none
 * @see none
 * @remarks N/A
 */
EXPORT_API int email_close_db(void);

/**
 * @fn email_service_begin(void)
 * @brief	Does the IPC Proxy Initialization by the Application which used the Email FW API's
 *
 * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
 * @exception none
 * @see 	none
 * @remarks N/A
 */
EXPORT_API int email_service_begin(void);

/**
 * @fn email_service_end(void)
 * @brief	This function does the IPC Proxy Finaization by the Application which used the Email FW API's
 *
 * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
 * @exception 	none
 * @see 	none
 * @remarks N/A
 */
EXPORT_API int email_service_end(void);

/**
 * @fn email_ping_service(void)
 * @brief	This function check email-service process is running or not
 *
 * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
 * @exception 	none
 * @see 	none
 * @remarks N/A
 */
EXPORT_API int email_ping_service(void);

#ifdef __cplusplus
}
#endif /* __cplusplus */

/**
* @} @}
*/


#endif  /* __EMAIL_API_INTI_H__ */