52e831a2d857303b266388c772929b713b3de748
[platform/core/api/capability-manager.git] / include / capability-manager.h
1 // Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef __TIZEN_APPFW_CAPABILITY_MANAGER_H__
6 #define __TIZEN_APPFW_CAPABILITY_MANAGER_H__
7
8 #include <tizen.h>
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14
15 /**
16  * @brief
17  */
18 typedef enum {
19   CAPMGR_ERROR_NONE = TIZEN_ERROR_NONE,
20   CAPMGR_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,
21   CAPMGR_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,
22   CAPMGR_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR,
23 } capmgr_error_e;
24
25 typedef enum {
26   CAPMGR_APP_CONTROL_RESULT_OK,
27 } capmgr_app_control_result_e;
28
29 /**
30  * @brief
31  */
32 typedef struct capmgr_device_s* capmgr_device_h;
33
34 /**
35  * @brief
36  */
37 typedef struct capmgr_app_control_s* capmgr_app_control_h;
38
39 /**
40  * @brief
41  */
42 typedef struct capmgr_package_info_s* capmgr_package_info_h;
43
44 /**
45  * @brief
46  */
47 typedef int (*capmgr_device_foreach_cb)(const capmgr_device_h device,
48     void* user_data);
49
50 /**
51  * @brief
52  */
53 typedef int (*capmgr_app_control_reply_cb)(const capmgr_app_control_h request,
54     const capmgr_app_control_h reply, capmgr_app_control_result_e result,
55     void* user_data);
56
57 /**
58  * @brief
59  */
60 typedef int (*capmgr_package_info_foreach_package_cb)(
61     const capmgr_package_info_h remote_package_info, void* user_data);
62
63 /**
64  * @brief
65  */
66 typedef int (*capmgr_package_info_foreach_app_cb)(
67     const char* appid, void* user_data);
68
69 /**
70  * @brief
71  */
72 int capmgr_device_foreach_devices(capmgr_device_foreach_cb cb,
73     void* user_data);
74
75 /**
76  * @brief
77  */
78 int capmgr_device_clone(const capmgr_device_h device,
79     capmgr_device_h* device_clone);
80
81 /**
82  * @brief
83  */
84 int capmgr_device_destroy(capmgr_device_h device);
85
86 /**
87  * @brief
88  */
89 int capmgr_device_get_device_id(capmgr_device_h device, char** device_id);
90
91 /**
92  * @brief
93  */
94 int capmgr_device_get_model_name(capmgr_device_h device, char** model_name);
95
96 /**
97  * @brief
98  */
99 int capmgr_device_get_device_name(capmgr_device_h device, char** device_name);
100
101 /**
102  * @brief
103  */
104 int capmgr_device_get_platform_ver(capmgr_device_h device, char** platform_ver);
105
106 /**
107  * @brief
108  */
109 int capmgr_device_get_profile(capmgr_device_h device, char** profile);
110
111 /**
112  * @brief
113  */
114 int capmgr_device_get_sw_ver(capmgr_device_h device, char** sw_ver);
115
116 /**
117  * @brief
118  */
119 int capmgr_app_control_create(capmgr_app_control_h* app_control);
120
121 /**
122  * @brief
123  */
124 int capmgr_app_control_clone(const capmgr_app_control_h app_control,
125     capmgr_app_control_h* app_control_clone);
126
127 /**
128  * @brief
129  */
130 int capmgr_app_control_destroy(capmgr_app_control_h app_control);
131
132 /**
133  * @brief
134  */
135 int capmgr_app_control_get_device(capmgr_app_control_h app_control,
136     capmgr_device_h* device);
137
138 /**
139  * @brief
140  */
141 int capmgr_app_control_get_operation(capmgr_app_control_h app_control,
142     char** operation);
143
144 /**
145  * @brief
146  */
147 int capmgr_app_control_get_uri(capmgr_app_control_h app_control,
148     char** uri);
149
150 /**
151  * @brief
152  */
153 int capmgr_app_control_get_mime(capmgr_app_control_h app_control,
154     char** mime);
155
156 /**
157  * @brief
158  */
159 int capmgr_app_control_get_appid(capmgr_app_control_h app_control,
160     char** appid);
161
162 /**
163  * @brief
164  */
165 int capmgr_app_control_get_extra_data(capmgr_app_control_h app_control,
166     const char* key, char** value);
167
168 /**
169  * @brief
170  */
171 int capmgr_app_control_set_device(capmgr_app_control_h app_control,
172     const capmgr_device_h device);
173
174 /**
175  * @brief
176  */
177 int capmgr_app_control_set_operation(capmgr_app_control_h app_control,
178     const char* operation);
179
180 /**
181  * @brief
182  */
183 int capmgr_app_control_set_uri(capmgr_app_control_h app_control,
184     const char* uri);
185
186 /**
187  * @brief
188  */
189 int capmgr_app_control_set_mime(capmgr_app_control_h app_control,
190     const char* mime);
191
192 /**
193  * @brief
194  */
195 int capmgr_app_control_set_appid(capmgr_app_control_h app_control,
196     const char* appid);
197
198 /**
199  * @brief
200  */
201 int capmgr_app_control_add_extra_data(capmgr_app_control_h app_control,
202     const char* key, const char* value);
203
204 /**
205  * @brief
206  */
207 int capmgr_app_control_remove_extra_data(capmgr_app_control_h app_control,
208     const char* key);
209
210 /**
211  * @brief
212  */
213 int capmgr_app_control_send(capmgr_app_control_h app_control,
214     capmgr_app_control_reply_cb cb, void* user_data);
215
216 /**
217  * @brief
218  */
219 int capmgr_package_info_foreach_packages(const capmgr_device_h device,
220     capmgr_package_info_foreach_package_cb cb, void* user_data);
221
222 /**
223  * @brief
224  */
225 int capmgr_package_info_foreach_applications(
226     const capmgr_package_info_h remote_package_info,
227     capmgr_package_info_foreach_app_cb cb, void* user_data);
228
229 /**
230  * @brief
231  */
232 int capmgr_package_info_get_pkgid(capmgr_package_info_h remote_package_info,
233     char** pkgid);
234
235 /**
236  * @brief
237  */
238 int capmgr_package_info_get_label(capmgr_package_info_h remote_package_info,
239     char** label);
240
241
242 /**
243  * @brief
244  */
245 int capmgr_package_info_get_version(capmgr_package_info_h remote_package_info,
246     char** version);
247
248 #ifdef __cplusplus
249 }
250 #endif
251
252 #endif  // __TIZEN_APPFW_CAPABILITY_MANAGER_H__