init Service Federation
[archive/platform/core/convergence/service-federation.git] / svcflow / svcflow.h
1 /*
2  * Service Flow
3  *
4  * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __TIZEN_CONVERGENCE_SERVICE_FLOW_H__
21 #define __TIZEN_CONVERGENCE_SERVICE_FLOW_H__
22
23 #ifndef API
24 #define API __attribute__ ((visibility("default")))
25 #endif
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 #include <stdio.h>
33
34 #include "svcbox.h"
35
36 /**
37  * @file svcflow.h
38  */
39
40 /**
41  * @ingroup
42  * @defgroup
43  *
44  * @brief
45  *
46  * @section
47  *  \#include <svcflow.h>
48  *
49  * <BR>
50  * @{
51  */
52
53 /**
54  * @brief Enumerations of result code for Service Flow
55  */
56 typedef enum _svcflow_result_e
57 {
58         SVCFLOW_RESULT_SUCCEEDED = 0,
59 } svcflow_result_e;
60
61 /**
62 * @brief Describes service group about Service Flow
63 */
64 typedef struct _svcflow_service_group_s
65 {
66         int list_len;
67 } svcflow_service_group_s;
68
69 /**
70 * @brief The handle for service group of Service Flow
71 */
72 typedef svcflow_service_group_s *svcflow_service_group_h;
73
74 /**
75 * @brief Describes service control about Service Flow
76 */
77 typedef struct _svcflow_service_control_s
78 {
79         char *uri;
80 } svcflow_service_control_s;
81
82 /**
83 * @brief The handle for service control of Service Flow
84 */
85 typedef svcflow_service_control_s *svcflow_service_control_h;
86
87 /**
88 * @brief Callback for svcflow_service_control_{transfer/defer/notify}_launch_request API
89 *
90 * @param[in]    reply           specifies reply handle of service control
91 * @param[in]    user_data       specifies user_data of svcflow_profiles_list_foreach_profile_info()
92 * @return       void.
93 * @pre  svcflow_service_control_{transfer/defer/notify}_launch_request() will invoke this callback.
94 * @see
95 */
96 typedef void (*svcflow_service_control_reply_cb)(svcflow_service_control_h reply,
97                                                 svcflow_result_e result,
98                                                 void *user_data);
99
100 /*==================================================================================================
101                                          FUNCTION PROTOTYPES
102 ==================================================================================================*/
103
104 /**
105 * @brief Connects Service Flow
106 *
107 * @param[in]
108 * @return 0 on success, otherwise a negative error value
109 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
110 */
111 int svcflow_connect();
112
113 /**
114 * @brief Disconnects Service Flow
115 *
116 * @param[in]
117 * @return 0 on success, otherwise a negative error value
118 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
119 */
120 int svcflow_disconnect();
121
122 /**
123 * @brief Creates Service Group
124 *
125 * @param[in]
126 * @return 0 on success, otherwise a negative error value
127 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
128 */
129 int svcflow_service_group_create(svcflow_service_group_h *service_group);
130
131 /**
132 * @brief Destroies Service Group
133 *
134 * @param[in]
135 * @return 0 on success, otherwise a negative error value
136 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
137 */
138 int svcflow_service_group_destroy(svcflow_service_group_h service_group);
139
140 /**
141 * @brief Adds Service Information in Service Group
142 *
143 * @param[in]
144 * @return 0 on success, otherwise a negative error value
145 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
146 */
147 int svcflow_service_group_add(svcflow_service_group_h service_group,
148                                                 svcbox_service_info_h service_info);
149
150 /**
151 * @brief Removes Service Information in Service Group
152 *
153 * @param[in]
154 * @return 0 on success, otherwise a negative error value
155 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
156 */
157 int svcflow_service_group_remove(svcflow_service_group_h service_group,
158                                                 svcbox_service_info_h service_info);
159
160 /**
161 * @brief Creates Service Control
162 *
163 * @param[in]
164 * @return 0 on success, otherwise a negative error value
165 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
166 */
167 int svcflow_service_control_create(svcflow_service_control_h *service_control);
168
169 /**
170 * @brief Destroies Service Control
171 *
172 * @param[in]
173 * @return 0 on success, otherwise a negative error value
174 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
175 */
176 int svcflow_service_control_destroy(svcflow_service_control_h service_control);
177
178 /**
179 * @brief Sets Service Control URI
180 *
181 * @param[in]
182 * @return 0 on success, otherwise a negative error value
183 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
184 */
185 int svcflow_service_control_set_uri(svcflow_service_control_h service_control,
186                                                 const char *uri);
187
188 /**
189 * @brief Gets Service Control URI
190 *
191 * @param[in]
192 * @return 0 on success, otherwise a negative error value
193 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
194 */
195 int svcflow_service_control_get_uri(svcflow_service_control_h service_control,
196                                                 char **uri);
197
198 /**
199 * @brief Sets Service Control Name
200 *
201 * @param[in]
202 * @return 0 on success, otherwise a negative error value
203 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
204 */
205 int svcflow_service_control_set_name(svcflow_service_control_h service_control,
206                                                 const char *name);
207
208 /**
209 * @brief Gets Service Control Name
210 *
211 * @param[in]
212 * @return 0 on success, otherwise a negative error value
213 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
214 */
215 int svcflow_service_control_get_name(svcflow_service_control_h service_control,
216                                                 char **name);
217
218 /**
219 * @brief Sets Publication Service Group
220 *
221 * @param[in]
222 * @return 0 on success, otherwise a negative error value
223 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
224 */
225 int svcflow_service_control_set_publication_group(svcflow_service_control_h service_control,
226                                                 svcflow_service_group_h service_group);
227
228 /**
229 * @brief Gets Publication Service Group
230 *
231 * @param[in]
232 * @return 0 on success, otherwise a negative error value
233 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
234 */
235 int svcflow_service_control_get_publication_group(svcflow_service_control_h service_control,
236                                                 svcflow_service_group_h *service_group);
237
238 /**
239 * @brief Sets Subscription Service Group
240 *
241 * @param[in]
242 * @return 0 on success, otherwise a negative error value
243 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
244 */
245 int svcflow_service_control_set_subscription_group(svcflow_service_control_h service_control,
246                                                 svcflow_service_group_h service_group);
247
248 /**
249 * @brief Gets Subscription Service Group
250 *
251 * @param[in]
252 * @return 0 on success, otherwise a negative error value
253 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
254 */
255 int svcflow_service_control_get_subscription_group(svcflow_service_control_h service_control,
256                                                 svcflow_service_group_h *service_group);
257
258 /**
259 * @brief Transfers Launch Request
260 *
261 * @param[in]
262 * @return 0 on success, otherwise a negative error value
263 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
264 */
265 int svcflow_service_control_transfer_launch_request(svcflow_service_control_h service_control,
266                                                 svcflow_service_control_reply_cb callback,
267                                                 void *user_data);
268
269 /**
270 * @brief Transfers Termination Request
271 *
272 * @param[in]
273 * @return 0 on success, otherwise a negative error value
274 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
275 */
276 int svcflow_service_control_transfer_termination_request(svcflow_service_control_h service_control);
277
278 /**
279 * @brief Defers Launch Request
280 *
281 * @param[in]
282 * @return 0 on success, otherwise a negative error value
283 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
284 */
285 int svcflow_service_control_defer_launch_request(svcflow_service_control_h service_control,
286                                                 svcflow_service_control_reply_cb callback,
287                                                 void *user_data);
288
289 /**
290 * @brief Defers Termination Request
291 *
292 * @param[in]
293 * @return 0 on success, otherwise a negative error value
294 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
295 */
296 int svcflow_service_control_defer_termination_request(svcflow_service_control_h service_control);
297
298 /**
299 * @brief Notifies Launch Request
300 *
301 * @param[in]
302 * @return 0 on success, otherwise a negative error value
303 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
304 */
305 int svcflow_service_control_notify_launch_request(svcflow_service_control_h service_control,
306                                                 svcflow_service_control_reply_cb callback,
307                                                 void *user_data);
308
309 /**
310 * @brief Notifies Termination Request
311 *
312 * @param[in]
313 * @return 0 on success, otherwise a negative error value
314 * @retval error code defined in svcflow_result_e - SVCBOX_RESULT_SUCCEEDED if Successful
315 */
316 int svcflow_service_control_notify_termination_request(svcflow_service_control_h service_control);
317
318 /**
319  * @}
320  */
321
322 #ifdef __cplusplus
323 }
324 #endif
325
326 #endif /* __TIZEN_CONVERGENCE_SERVICE_BOX_H__ */