Tizen 2.1 base
[platform/core/system/sync-agent.git] / include / event / oma_dm_fota_api.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef OMA_DM_FOTA_API_H_
19 #define OMA_DM_FOTA_API_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 #include "oma_dm_api_common.h"
26
27 /**
28  * @file        oma_dm_fota_api.h
29  * @brief       Support to use framework event module for agent
30  */
31
32 /** @addtogroup event
33  *      @{
34  */
35
36 /**
37  * API to Init fota ui config event API.
38  * @remarks This function is use to init fota ui config.
39  *
40  * @par Usage:
41  * @code
42  *
43  *
44         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
45
46         err_code = sync_agent_dm_fota_init();
47         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
48                 //error handling
49         }
50         ...
51  *
52  * @endcode
53  *
54  *
55  *
56  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
57  *
58  * @pre  This function should be called if need to init fota ui config.
59  * @post
60  *
61  * @par Since:
62  *
63  *
64  * @see
65  *
66  */
67         sync_agent_dm_error_e sync_agent_dm_fota_init();
68
69 /**
70  * API to Deinit fota ui config event API.
71  * @remarks This function is use to deinit fota ui config.
72  *
73  * @par Usage:
74  * @code
75  *
76  *
77         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
78
79         err_code = sync_agent_dm_fota_deinit();
80         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
81                 //error handling
82         }
83         ...
84  *
85  * @endcode
86  *
87  *
88  *
89  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
90  *
91  * @pre  This function should be called if need to deinit fota ui config.
92  * @post
93  *
94  * @par Since:
95  *
96  *
97  * @see
98  *
99  */
100         sync_agent_dm_error_e sync_agent_dm_fota_deinit();
101
102 /**
103  * API to Software update button in fota ui event API.
104  * @remarks This function is use to software update.
105  *
106  * @par Usage:
107  * @code
108  *
109  *
110         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
111         sync_agent_dm_service_server_type_e server_type = UI_SAMSUNG_FUMO_TYPE;
112
113         err_code = sync_agent_dm_fota_software_update(server_type);
114         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
115                 //error handling
116         }
117         ...
118  *
119  * @endcode
120  *
121  * @param[in] server_type server type
122  *
123  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
124  *
125  * @pre  This function should be called if click software update button.
126  * @post
127  *
128  * @par Since:
129  *
130  *
131  * @see
132  *
133  */
134         sync_agent_dm_error_e sync_agent_dm_fota_software_update(sync_agent_dm_service_server_type_e server_type);
135
136 /**
137  * API to Cancel button in fota ui event API.
138  * @remarks This function is use to cancel fota flow.
139  *
140  * @par Usage:
141  * @code
142  *
143  *
144         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
145
146         err_code = sync_agent_dm_fota_cancel();
147         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
148                 //error handling
149         }
150         ...
151  *
152  * @endcode
153  *
154  *
155  *
156  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
157  *
158  * @pre  This function should be called if click cancel button.
159  * @post
160  *
161  * @par Since:
162  *
163  *
164  * @see
165  *
166  */
167         sync_agent_dm_error_e sync_agent_dm_fota_cancel();
168
169 /**
170  * API to Download button in fota ui event API.
171  * @remarks This function is use to download fota delta file.
172  *
173  * @par Usage:
174  * @code
175  *
176  *
177         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
178         int response_type = 1;
179
180         err_code = sync_agent_dm_fota_download(response_type);
181         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
182                 //error handling
183         }
184         ...
185  *
186  * @endcode
187  *
188  * @param[in] response_type event response result
189  *
190  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
191  *
192  * @pre  This function should be called if click download button.
193  * @post
194  *
195  * @par Since:
196  *
197  *
198  * @see
199  *
200  */
201         sync_agent_dm_error_e sync_agent_dm_fota_download(int response_type);
202
203 /**
204  * API to Install button in fota ui event API.
205  * @remarks This function is use to install fota.
206  *
207  * @par Usage:
208  * @code
209  *
210  *
211         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
212         int response_type = 1;
213
214         err_code = sync_agent_dm_fota_install(response_type);
215         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
216                 //error handling
217         }
218         ...
219  *
220  * @endcode
221  *
222  * @param[in] response_type event response result
223  *
224  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
225  *
226  * @pre  This function should be called if click install button.
227  * @post
228  *
229  * @par Since:
230  *
231  *
232  * @see
233  *
234  */
235         sync_agent_dm_error_e sync_agent_dm_fota_install(int response_type);
236
237 /**
238  * API to Remind interval save button in fota ui event API.
239  * @remarks This function is use to set remind interval.
240  *
241  * @par Usage:
242  * @code
243  *
244  *
245         sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
246         int interval_type = 1;
247
248         err_code = sync_agent_dm_fota_install(interval_type);
249         if(err != SYNC_AGENT_DM_MO_SUCCESS) {
250                 //error handling
251         }
252         ...
253  *
254  * @endcode
255  *
256  * @param[in] interval_type remind interval value
257  *
258  * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
259  *
260  * @pre  This function should be called if click remind interval button.
261  * @post
262  *
263  * @par Since:
264  *
265  *
266  * @see
267  *
268  */
269         sync_agent_dm_error_e sync_agent_dm_fota_set_interval(int interval_type);
270
271 /**
272  *      @}
273  */
274
275 #ifdef __cplusplus
276 }
277 #endif                          /* __cplusplus */
278 #endif                          /* OMA_DM_FOTA_API_H_ */