Fix appmanager tool
[platform/core/api/app-manager.git] / include / app_info.h
1 /*
2  * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef __TIZEN_APPFW_APP_INFO_H
19 #define __TIZEN_APPFW_APP_INFO_H
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file app_info.h
29  */
30
31 /**
32 * @addtogroup CAPI_APP_INFO_MODULE
33 * @{
34 */
35
36 /**
37  * @brief  Definition for string property for filtering based on app info: String property for filtering packages with app id.
38  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
39  */
40 #define  PACKAGE_INFO_PROP_APP_ID            "PACKAGE_INFO_PROP_APP_ID"
41
42 /**
43  * @brief  Definition for string property for filtering based on app info: String property for filtering packages with app type.
44  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
45  */
46 #define  PACKAGE_INFO_PROP_APP_TYPE          "PACKAGE_INFO_PROP_APP_TYPE"
47
48 /**
49  * @brief  Definition for string property for filtering based on app info: String property for filtering packages with app category.
50  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
51  */
52 #define  PACKAGE_INFO_PROP_APP_CATEGORY      "PACKAGE_INFO_PROP_APP_CATEGORY"
53
54 /**
55  * @brief  Definition for string property for filtering based on app info: String property for filtering packages with installed storage of app.
56  *         Value related with this property should be "installed_internal" or "installed_external".
57  * @since_tizen 3.0
58  */
59 #define  PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE      "PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE"
60
61 /**
62  * @brief Definition for boolean property for filtering based on app info: Boolean property for filtering whether the package is nodisplay or not based on package info.
63  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
64  */
65 #define PACKAGE_INFO_PROP_APP_NODISPLAY     "PACKAGE_INFO_PROP_APP_NODISPLAY"
66
67 /**
68  * @brief Definition for boolean property for filtering based on app info: Boolean property for filtering whether the package has the authority to manage task or not based on package info.
69  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
70  */
71 #define PACKAGE_INFO_PROP_APP_TASKMANAGE    "PACKAGE_INFO_PROP_APP_TASKMANAGE"
72
73 /**
74  * @brief Definition for boolean property for filtering based on app info: Boolean property for filtering whether the application has been disabled.
75  * @since_tizen 4.0
76  */
77 #define   PACKAGE_INFO_PROP_APP_DISABLED    "PACKAGE_INFO_PROP_APP_DISABLED"
78
79 /**
80  * @brief Definition for string property for filtering based on app info: String property for
81  *        filtering with the application component type.
82  *        Value related with this property should be one of "uiapp", "svcapp", "widgetapp",
83  *        "watchapp" and "componentbasedapp" (Since 5.5).
84  * @since_tizen 4.0
85  * @see app_info_app_component_type_e
86  * @see app_info_get_app_component_type()
87  */
88 #define   PACKAGE_INFO_PROP_APP_COMPONENT_TYPE    "PACKAGE_INFO_PROP_APP_COMPONENT_TYPE"
89
90 /**
91  * @brief Enumeration for application component type.
92  * @details A component is an application considered as a part of a package.
93  *          The application component type indicates what type of
94  *          a component an application is in a package.
95  * @since_tizen 4.0
96  * @see PACKAGE_INFO_PROP_APP_COMPONENT_TYPE
97  * @see app_info_get_app_component_type()
98  */
99 typedef enum {
100         APP_INFO_APP_COMPONENT_TYPE_UI_APP,                     /**< UI application */
101         APP_INFO_APP_COMPONENT_TYPE_SERVICE_APP,                /**< Service application */
102         APP_INFO_APP_COMPONENT_TYPE_WIDGET_APP,                 /**< Widget application */
103         APP_INFO_APP_COMPONENT_TYPE_WATCH_APP,                  /**< Watch application */
104         APP_INFO_APP_COMPONENT_TYPE_COMPONENT_BASED_APP,        /**< Component-based application (Since 5.5) */
105 } app_info_app_component_type_e;
106
107 /**
108  * @brief Application information handle.
109  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
110  */
111 typedef struct app_info_s *app_info_h;
112
113 /**
114  * @brief Application filter handle.
115  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
116  */
117 typedef struct app_info_filter_s *app_info_filter_h;
118
119 /**
120  * @brief Application metadata filter handle.
121  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
122  */
123 typedef struct app_info_metadata_filter_s *app_info_metadata_filter_h;
124
125 /**
126  * @brief  Called to get the application information once for each installed application.
127  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
128  * @param[in]   app_info   The application information of each installed application
129  * @param[in]   user_data  The user data passed from the foreach function
130  * @return      @c true to continue with the next iteration of the loop, \n
131  *              otherwise @c false to break out of the loop
132  * @pre app_manager_foreach_app_info() will invoke this callback.
133  * @see app_manager_foreach_app_info()
134  */
135 typedef bool (*app_info_filter_cb) (app_info_h app_info, void *user_data);
136
137 /**
138  * @brief  Called to get application metadata in app_info_foreach_metadata().
139  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
140  * @param[in]   metadata_key   The key of the metadata
141  * @param[in]   metadata_value  The value of the metadata
142  * @param[in]   user_data       The user data passed to app_info_foreach_metadata()
143  * @return      @c true to continue with the next iteration of the loop, \n
144  *              otherwise @c false to break out of the loop
145  * @pre app_info_foreach_metadata() will invoke this callback.
146  * @see app_info_foreach_metadata()
147  */
148 typedef bool (*app_info_metadata_cb) (const char *metadata_key, const char *metadata_value, void *user_data);
149
150 /**
151  * @brief  Called for each application category in app_info_foreach_category().
152  * @since_tizen 4.0
153  * @remarks     @a category will be freed when the application information handle is destroyed
154  *              using app_info_destroy()
155  * @param[in]   category        The name of the category
156  * @param[in]   user_data       The user data passed to app_info_foreach_category()
157  * @return      @c true to continue with the next iteration of the loop, \n
158  *              otherwise @c false to break out of the loop
159  * @pre app_info_foreach_category() will invoke this callback.
160  * @see app_info_foreach_category()
161  */
162 typedef bool (*app_info_category_cb) (const char *category, void *user_data);
163
164 /**
165  * @brief  Creates the application information handle.
166  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
167  * @remarks The @a app_info should be released using app_info_destroy().
168  * @param[in]   app_id    The application ID
169  * @param[out]  app_info  The application information handle
170  * @return      @c 0 on success,
171  *              otherwise a negative error value
172  * @retval  #APP_MANAGER_ERROR_NONE               Successful
173  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
174  * @retval  #APP_MANAGER_ERROR_NO_SUCH_APP        The app is not installed
175  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
176  * @see app_manager_foreach_app_info()
177  * @see app_manager_get_app_info()
178  */
179 int app_info_create(const char *app_id, app_info_h *app_info);
180
181 /**
182  * @brief  Destroys the application information handle and releases all its resources.
183  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
184  * @param[in]   app_info  The application information handle
185  * @return      @c 0 on success,
186  *              otherwise a negative error value
187  * @retval  #APP_MANAGER_ERROR_NONE               Successful
188  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
189  * @see app_manager_foreach_app_info()
190  * @see app_manager_get_app_info()
191  */
192 int app_info_destroy(app_info_h app_info);
193
194 /**
195  * @brief  Gets the application ID with the given application context.
196  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
197  * @remarks     You must release @a app_id using free().
198  * @param[in]   app_info  The application information
199  * @param[out]  app_id    The application ID of the given application context
200  * @return      @c 0 on success,
201  *              otherwise a negative error value
202  * @retval  #APP_MANAGER_ERROR_NONE               Successful
203  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
204  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
205  */
206 int app_info_get_app_id(app_info_h app_info, char **app_id);
207
208 /**
209  * @brief  Gets the executable path of the application.
210  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
211  * @remarks     You must release @a exec path using free().
212  * @param[in]   app_info The application information
213  * @param[out]  exec     The executable path of the application
214  * @return      @c 0 on success,
215  *              otherwise a negative error value
216  * @retval  #APP_MANAGER_ERROR_NONE               Successful
217  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
218  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
219  */
220 int app_info_get_exec(app_info_h app_info, char **exec);
221
222 /**
223  * @brief  Gets the label of the application.
224  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
225  * @remarks     You must release @a label using free().
226  * @param[in]   app_info  The application information
227  * @param[out]  label     The label of the application
228  * @return      @c 0 on success,
229  *              otherwise a negative error value
230  * @retval  #APP_MANAGER_ERROR_NONE               Successful
231  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
232  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
233  */
234 int app_info_get_label(app_info_h app_info, char **label);
235
236 /**
237  * @brief  Gets the localed name of the application.
238  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
239  * @remarks     You must release localed name using free().
240  * @param[in]   app_id  The application ID
241  * @param[in]   locale  The locale information
242  * @param[out]  label   The localed name of the application
243  * @return      @c 0 on success,
244  *              otherwise a negative error value
245  * @retval  #APP_MANAGER_ERROR_NONE               Successful
246  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
247  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
248  */
249 int app_info_get_localed_label(const char *app_id, const char *locale, char **label);
250
251 /**
252  * @brief  Gets the absolute path to the icon image.
253  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
254  * @remarks     You must release @a path using free().
255  * @param[in]   app_info  The application information
256  * @param[out]  path      The absolute path to the icon
257  * @return      @c 0 on success,
258  *              otherwise a negative error value
259  * @retval  #APP_MANAGER_ERROR_NONE               Successful
260  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
261  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
262  */
263 int app_info_get_icon(app_info_h app_info, char **path);
264
265 /**
266  * @brief  Gets the package name.
267  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
268  * @remarks     You must release @a package name using free().
269  * @param[in]   app_info  The application information
270  * @param[out]  package   The package name
271  * @return      @c 0 on success,
272  *              otherwise a negative error value
273  * @retval  #APP_MANAGER_ERROR_NONE               Successful
274  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
275  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
276  */
277 int app_info_get_package(app_info_h app_info, char **package);
278
279 /**
280  * @brief  Gets the package type name.
281  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
282  * @remarks     You must release package @a type name using free().
283  * @param[in]   app_info The application information
284  * @param[out]  type     The package type
285  * @return      @c 0 on success,
286  *              otherwise a negative error value
287  * @retval  #APP_MANAGER_ERROR_NONE               Successful
288  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
289  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
290  */
291 int app_info_get_type(app_info_h app_info, char **type);
292
293 /**
294  * @brief  Gets the application component type.
295  * @since_tizen 4.0
296  * @param[in]   app_info  The application information
297  * @param[out]  type      The application component type
298  * @return      @c 0 on success,
299  *              otherwise a negative error value
300  * @retval  #APP_MANAGER_ERROR_NONE               Successful
301  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
302  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
303  * @see #PACKAGE_INFO_PROP_APP_COMPONENT_TYPE
304  * @see #app_info_app_component_type_e
305  */
306 int app_info_get_app_component_type(app_info_h app_info, app_info_app_component_type_e *type);
307
308 /**
309  * @brief  Gets the list of metadata for a particular application.
310  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
311  * @param[in]  app_info   The application information
312  * @param[in]  callback   The callback function for list
313  * @param[in]  user_data  The user data to be passed to callback function
314  * @return      @c 0 on success,
315  *              otherwise a negative error value
316  * @retval  #APP_MANAGER_ERROR_NONE               Successful
317  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
318  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
319  */
320 int app_info_foreach_metadata(app_info_h app_info, app_info_metadata_cb callback, void *user_data);
321
322 /**
323  * @brief  Checks whether application information is nodisplay.
324  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
325  * @param[in]   app_info   The application information
326  * @param[out]  nodisplay  @c true if the application is nodisplay, \n
327  *                         otherwise @c false
328  * @return      @c 0 on success,
329  *              otherwise a negative error value
330  * @retval  #APP_MANAGER_ERROR_NONE               Successful
331  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
332  */
333 int app_info_is_nodisplay(app_info_h app_info, bool *nodisplay);
334
335 /**
336  * @brief  Checks whether two application information are equal.
337  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
338  * @param[in]   lhs    The first application information to compare
339  * @param[in]   rhs    The second application information to compare
340  * @param[out]  equal  @c true if the application information are equal, \n
341  *                     otherwise @c false
342  * @return      @c 0 on success,
343  *              otherwise a negative error value
344  * @retval  #APP_MANAGER_ERROR_NONE               Successful
345  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
346  */
347 int app_info_is_equal(app_info_h lhs, app_info_h rhs, bool *equal);
348
349 /**
350  * @brief  Checks whether application is enabled.
351  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
352  * @param[in]   app_info  The application information
353  * @param[out]  enabled   @c true if the application is enabled, \n
354  *                        otherwise @c false
355  * @return      @c 0 on success,
356  *              otherwise a negative error value
357  * @retval  #APP_MANAGER_ERROR_NONE               Successful
358  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
359  */
360 int app_info_is_enabled(app_info_h app_info, bool *enabled);
361
362 /**
363  * @brief  Checks whether application is launched on booting time.
364  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
365  * @param[in]   app_info  The application information
366  * @param[out]  onboot    @c true if the application is launched on booting time, \n
367  *                        otherwise @c false
368  * @return      @c 0 on success,
369  *              otherwise a negative error value
370  * @retval  #APP_MANAGER_ERROR_NONE               Successful
371  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
372  */
373 int app_info_is_onboot(app_info_h app_info, bool *onboot);
374
375 /**
376  * @brief  Checks whether application is preloaded.
377  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
378  * @param[in]   app_info  The application information
379  * @param[out]  preload   @c true if the application is preloaded, \n
380  *                        otherwise @c false
381  * @return        @c 0 on success,
382  *                otherwise a negative error value
383  * @retval  #APP_MANAGER_ERROR_NONE               Successful
384  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
385  */
386 int app_info_is_preload(app_info_h app_info, bool *preload);
387
388 /**
389  * @brief  Checks whether the application supports ambient mode.
390  * @since_tizen 5.5
391  * @param[in]   app_info         The application information
392  * @param[out]  ambient_supported  @c true if the application supports ambient mode, \n
393  *              otherwise @c false
394  * @return      @c 0 on success,
395  *              otherwise a negative error value
396  * @retval  #APP_MANAGER_ERROR_NONE               Successful
397  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
398  */
399 int app_info_is_support_ambient(app_info_h app_info, bool *ambient_supported);
400
401 /**
402  * @brief  Clones the application information handle.
403  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
404  * @remarks The @a clone should be released using app_info_destroy().
405  * @param[out]  clone     A newly created application information handle, if successfully cloned
406  * @param[in]   app_info  The application information
407  * @return      @c 0 on success,
408  *              otherwise a negative error value
409  * @retval  #APP_MANAGER_ERROR_NONE               Successful
410  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
411  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
412  * @retval  #APP_MANAGER_ERROR_NO_SUCH_APP        The app is not installed
413  */
414 int app_info_clone(app_info_h *clone, app_info_h app_info);
415
416 /**
417  * @platform
418  * @brief  Runs a callback for each category which the given application belongs to.
419  * @since_tizen 4.0
420  * @privlevel platform
421  * @privilege %http://tizen.org/privilege/packagemanager.admin
422  * @param[in]  app_info   The application information
423  * @param[in]  callback   The callback function
424  * @param[in]  user_data  The user data to be passed to the callback function
425  * @return      @c 0 on success,
426  *              otherwise a negative error value
427  * @retval  #APP_MANAGER_ERROR_NONE               Successful
428  * @retval  #APP_MANAGER_ERROR_PERMISSION_DENIED  Permission denied
429  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
430  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
431  * @see app_info_create()
432  */
433 int app_info_foreach_category(app_info_h app_info, app_info_category_cb callback, void *user_data);
434
435 /**
436  * @brief  Creates the application information filter handle from DB.
437  *         All filter properties will be ANDed.
438  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
439  * @remarks The @a handle should be released using app_info_filter_destroy().
440  * @param[out]  handle  The pointer to the application info filter handle
441  * @return      @c 0 on success,
442  *              otherwise a negative error value
443  * @retval  #APP_MANAGER_ERROR_NONE               Successful
444  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
445  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
446  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
447  */
448 int app_info_filter_create(app_info_filter_h *handle);
449
450 /**
451  * @brief  Destroys the application information filter handle, freeing up all the resources.
452  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
453  * @param[in]  handle  The pointer to the application info filter handle
454  * @return     @c 0 on success,
455  *             otherwise a negative error value
456  * @retval  #APP_MANAGER_ERROR_NONE               Successful
457  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
458  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
459  */
460 int app_info_filter_destroy(app_info_filter_h handle);
461
462 /**
463  * @brief  Adds a boolean filter property to the filter handle.
464  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
465  * @param[in]  handle    The pointer to the application info filter handle
466  * @param[in]  property  The integer property name
467  * @param[in]  value     The value corresponding to the property
468  * @return     @c 0 on success,
469  *             otherwise a negative error value
470  * @retval  #APP_MANAGER_ERROR_NONE               Successful
471  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
472  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
473  */
474 int app_info_filter_add_bool(app_info_filter_h handle, const char *property, const bool value);
475
476 /**
477  * @brief  Adds a string filter property to the filter handle.
478  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
479  * @param[in]  handle    The pointer to the application info filter handle
480  * @param[in]  property  The integer property name
481  * @param[in]  value     The value corresponding to the property
482  * @return     @c 0 on success,
483  *             otherwise a negative error value
484  * @retval  #APP_MANAGER_ERROR_NONE               Successful
485  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
486  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
487  */
488 int app_info_filter_add_string(app_info_filter_h handle, const char *property, const char *value);
489
490 /**
491  * @brief  Gets the count of filtered apps.
492  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
493  * @param[in]   handle  The pointer to the application info filter handle
494  * @param[out]  count   The pointer to the variable for count
495  * @return      @c 0 on success,
496  *              otherwise a negative error value
497  * @retval  #APP_MANAGER_ERROR_NONE               Successful
498  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
499  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
500  */
501 int app_info_filter_count_appinfo(app_info_filter_h handle, int *count);
502
503 /**
504  * @brief  Executes the user supplied callback function for each application that satisfy the filter conditions.
505  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
506  * @param[in]  handle     The pointer to the application info filter handle
507  * @param[in]  callback   The callback function
508  * @param[in]  user_data  The user data to be passed to the callback function
509  * @return     @c 0 on success,
510  *             otherwise a negative error value
511  * @retval  #APP_MANAGER_ERROR_NONE               Successful
512  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
513  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
514  */
515 int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filter_cb callback, void *user_data);
516
517 /**
518  * @brief  Creates the application's metadata information filter handle from DB.
519  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
520  * @remarks The @a handle should be released using app_info_metadata_filter_destroy().
521  * @param[out]  handle  The pointer to the application metadata info filter handle
522  * @return      @c 0 on success,
523  *              otherwise a negative error value
524  * @retval  #APP_MANAGER_ERROR_NONE               Successful
525  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
526  * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memory
527  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
528  */
529 int app_info_metadata_filter_create(app_info_metadata_filter_h *handle);
530
531 /**
532  * @brief  Destroys the application's metadata information filter handle.
533  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
534  * @param[in]  handle  The pointer to the application info filter handle
535  * @return  @c 0 on success,
536  *          otherwise a negative error value
537  * @retval  #APP_MANAGER_ERROR_NONE               Successful
538  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
539  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
540  */
541 int app_info_metadata_filter_destroy(app_info_metadata_filter_h handle);
542
543 /**
544  * @brief  Adds filter condition for the query API.
545  * @details  The query will search the entire application metadata information collected from
546  *           the manifest file of all the installed packages. You can specify value as @c NULL to search based on key only.
547  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
548  * @param[in]  handle  The pointer to the application metadata info filter handle
549  * @param[in]  key     The pointer to metadata key
550  * @param[in]  value   The pointer to metadata value
551  * @return     @c 0 on success,
552  *             otherwise a negative error value
553  * @retval  #APP_MANAGER_ERROR_NONE               Successful
554  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
555  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
556  */
557 int app_info_metadata_filter_add(app_info_metadata_filter_h handle, const char *key, const char *value);
558
559 /**
560  * @brief  Executes the filter query.
561  * @details  The query will search the entire application metadata information collected from
562  *           the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
563  *           negative value, no more callbacks will be called and API will return.
564  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
565  * @param[in]  handle     The pointer to the application metadata info filter handle
566  * @param[in]  callback   The function pointer to callback
567  * @param[in]  user_data  The pointer to user data
568  * @return     @c 0 on success,
569  *             otherwise a negative error value
570  * @retval  #APP_MANAGER_ERROR_NONE               Successful
571  * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
572  * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
573  */
574 int app_info_metadata_filter_foreach(app_info_metadata_filter_h handle, app_info_filter_cb callback, void *user_data);
575
576
577 /**
578 * @}
579 */
580
581 #ifdef __cplusplus
582 }
583 #endif
584
585 #endif /* __TIZEN_APPFW_APP_INFO_H */
586