Fix Prevent and remove compile warning messages
[platform/core/appfw/ail.git] / include / ail.h
1 /*
2  * ail
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __AIL_H__
23 #define __AIL_H__
24
25 #include <stdbool.h>
26 #include <unistd.h>
27 #include <sys/types.h>
28 #include <pwd.h>
29 #include <tzplatform_config.h>
30
31 #define OWNER_ROOT 0
32 #define GROUP_MENU 6010
33 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
34 #define BUFSZE 1024
35 #define USR_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RO_DESKTOP_APP)
36 #define APP_INFO_DB_FILE tzplatform_mkpath(TZ_SYS_DB, ".app_info.db")
37 #define APP_INFO_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB, ".app_info.db-journal")
38 #define APP_INFO_DB_LABEL "*"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43
44 /**
45  * @open
46  * @ingroup APPLICATION_FRAMEWORK
47  * @defgroup ail Application Information Library
48  */
49
50 /**
51  * @file       ail.h
52  * @brief      Application Information Library header
53  * @author     Sunghyuk Lee (sunghyuk.lee@samsung.com), Jin Yoon (jinny.yoon@samsung.com)
54  * @date       2011-07-30
55  * @version    0.1
56  */
57
58 /**
59  * @addtogroup ail
60  * @{
61  */
62
63 /**
64  * @brief string type properties
65  */
66 #define AIL_PROP_PACKAGE_STR                    "AIL_PROP_PACKAGE_STR"
67 #define AIL_PROP_EXEC_STR                       "AIL_PROP_EXEC_STR"
68 #define AIL_PROP_NAME_STR                       "AIL_PROP_NAME_STR"
69 #define AIL_PROP_TYPE_STR                       "AIL_PROP_TYPE_STR"
70 #define AIL_PROP_ICON_STR                       "AIL_PROP_ICON_STR"
71 #define AIL_PROP_CATEGORIES_STR                 "AIL_PROP_CATEGORIES_STR"
72 #define AIL_PROP_VERSION_STR                    "AIL_PROP_VERSION_STR"
73 #define AIL_PROP_MIMETYPE_STR                   "AIL_PROP_MIMETYPE_STR"
74 #define AIL_PROP_X_SLP_SERVICE_STR              "AIL_PROP_X_SLP_SERVICE_STR"
75 #define AIL_PROP_X_SLP_PACKAGETYPE_STR          "AIL_PROP_X_SLP_PACKAGETYPE_STR"
76 #define AIL_PROP_X_SLP_PACKAGECATEGORIES_STR    "AIL_PROP_X_SLP_PACKAGECATEGORIES_STR"
77 #define AIL_PROP_X_SLP_PACKAGEID_STR            "AIL_PROP_X_SLP_PACKAGEID_STR"
78 #define AIL_PROP_X_SLP_SVC_STR                  "AIL_PROP_X_SLP_SVC_STR"
79 #define AIL_PROP_X_SLP_EXE_PATH                 "AIL_PROP_X_SLP_EXE_PATH"
80 #define AIL_PROP_X_SLP_APPID_STR                "AIL_PROP_X_SLP_APPID_STR"
81 #define AIL_PROP_X_SLP_PKGID_STR                "AIL_PROP_X_SLP_PKGID_STR"
82 #define AIL_PROP_X_SLP_DOMAIN_STR               "AIL_PROP_X_SLP_DOMAIN_STR"
83 #define AIL_PROP_X_SLP_SUBMODEMAINID_STR        "AIL_PROP_X_SLP_SUBMODEMAINID_STR"
84 #define AIL_PROP_X_SLP_INSTALLEDSTORAGE_STR     "AIL_PROP_X_SLP_INSTALLEDSTORAGE_STR"
85
86 /**
87  * @brief integer type properties
88  */
89 #define AIL_PROP_X_SLP_TEMP_INT                 "AIL_PROP_X_SLP_TEMP_INT"
90 #define AIL_PROP_X_SLP_INSTALLEDTIME_INT        "AIL_PROP_X_SLP_INSTALLEDTIME_INT"
91
92 /**
93  * @brief boolean type properties
94  */
95 #define AIL_PROP_NODISPLAY_BOOL                 "AIL_PROP_NODISPLAY_BOOL"
96 #define AIL_PROP_X_SLP_TASKMANAGE_BOOL          "AIL_PROP_X_SLP_TASKMANAGE_BOOL"
97 #define AIL_PROP_X_SLP_MULTIPLE_BOOL            "AIL_PROP_X_SLP_MULTIPLE_BOOL"
98 #define AIL_PROP_X_SLP_REMOVABLE_BOOL           "AIL_PROP_X_SLP_REMOVABLE_BOOL"
99 #define AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL   "AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL"
100 #define AIL_PROP_X_SLP_ENABLED_BOOL             "AIL_PROP_X_SLP_ENABLED_BOOL"
101 #define AIL_PROP_X_SLP_SUBMODE_BOOL             "AIL_PROP_X_SLP_SUBMODE_BOOL"
102
103 /**
104  * @brief A handle for filters
105  */
106 typedef struct ail_filter *ail_filter_h;
107
108 /**
109  * @brief A handle for appinfos
110  */
111 typedef struct ail_appinfo *ail_appinfo_h;
112
113 /**
114  * @brief return values
115  */
116 typedef enum {
117         AIL_ERROR_OK = 0,                       /**< General success */
118         AIL_ERROR_FAIL = -1,                    /**< General error */
119         AIL_ERROR_DB_FAILED = -2,               /**< Database error */
120         AIL_ERROR_OUT_OF_MEMORY = -3,           /**< Out of memory */
121         AIL_ERROR_INVALID_PARAMETER = -4,       /**< Invalid parameter */
122         AIL_ERROR_NO_DATA = -5,                 /**< Success, but no data */
123 } ail_error_e;
124
125 /**
126  * @fn ail_error_e ail_filter_new(ail_filter_h *filter)
127  *
128  * @brief  Create a new filter handle which is used to filter records from Application Information Database. You can add filtering conditions to filter with ail_filter_add_xxx functions. All conditions are ANDed.
129  *
130  * @par Sync (or) Async : Synchronous API.
131  *
132  * @param[out] filter a pointer to a filter which is newly created
133  *
134  * @return 0 if success, negative value(<0) if fail\n
135  * @retval      AIL_ERROR_OK                                    success
136  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
137  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
138  *
139  * @pre None
140  * @post If the filter is no longer used, it should be freed with ail_filter_destroy()
141  *
142  * @see  ail_filter_destroy()
143  *
144  * @par Prospective Clients:
145  * External Apps.
146  *
147  * @code
148  * int count_apps()
149  * {
150  *      ail_filter_h filter;
151  *      ail_error_e ret;
152  *      int n;
153  *
154  *      ret = ail_filter_new(&filter);
155  *      if (ret != AIL_ERROR_OK)
156  *              return -1;
157  *
158  *      ret = ail_filter_add_bool(filter, AIL_PROP_NODISPLAY_BOOL, false);
159  *      if (ret != AIL_ERROR_OK)
160  *              return -1;
161  *
162  *      ret = ail_filter_add_str(filter, AIL_PROP_MIMETYPE_STR, "audio/wav");
163  *      if (ret != AIL_ERROR_OK)
164  *              return -1;
165  *
166  *      ret = ail_filter_count_appinfo(filter, &n);
167  *      if (ret != AIL_ERROR_OK)
168  *              return -1;
169  *
170  *      ret = ail_filter_destroy(filter);
171  *      printf("N of apps not to be displayed and supporting 'audo/wav' mime type = %d\n", n);
172  *
173  *      return n;
174  * }
175  * @endcode
176  */
177 ail_error_e ail_filter_new(ail_filter_h *filter);
178
179 /**
180  * @fn ail_error_e ail_error_e ail_filter_add_int(ail_filter_h filter, const char *property, const int value)
181  *
182  * @brief Add integer condition to filter
183  *
184  * @par Sync (or) Async : Synchronous API
185  *
186  * @param[in] filter    a filter handle which can be create with ail_filter_new()
187  * @param[in] property  a property type of integer
188  * @param[in] value     the value to filter by
189  *
190  * @return 0 if success, negative value(<0) if fail\n
191  * @retval      AIL_ERROR_OK                                    success
192  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
193  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
194  *
195  * @pre The filter should be valid handle which was created by ail_filter_new()
196  *
197  * @see  ail_filter_new()
198  *
199  * @par Prospective Clients:
200  * External Apps.
201  *
202  * @code
203  * int count_apps()
204  * {
205  *      ail_filter_h filter;
206  *      ail_error_e ret;
207  *      int n;
208  *
209  *      ret = ail_filter_new(&filter);
210  *      if (ret != AIL_ERROR_OK)
211  *              return -1;
212  *
213  *      ret = ail_filter_add_int(filter, AIL_PROP_X_SLP_BASELAYOUTWIDTH_INT, 480);
214  *      if (ret != AIL_ERROR_OK)
215  *              return -1;
216  *
217  *      ret = ail_filter_count_appinfo(filter, &n);
218  *      if (ret != AIL_ERROR_OK)
219  *              return -1;
220  *
221  *      printf("N of apps = %d\n", n);
222  *
223  *      return n;
224  * }
225  * @endcode
226  */
227 ail_error_e ail_filter_add_int(ail_filter_h filter, const char *property, const int value);
228
229
230 /**
231  * @fn ail_error_e ail_error_e ail_filter_add_bool(ail_filter_h filter, const char *property, const bool value)
232  *
233  * @brief Add boolean condition to filter by. The value can be true/false only
234  *
235  * @par Sync (or) Async : Synchronous API
236  *
237  * @param[in] filter     a filter handle which can be create with ail_filter_new()
238  * @param[in] property   a property type of boolean
239  * @param[in] value      the value to filter by
240  *
241  * @return 0 if success, negative value(<0) if fail\n
242  * @retval      AIL_ERROR_OK                                    success
243  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
244  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
245  *
246  * @pre The filter should be valid handle which was created by ail_filter_new()
247  *
248  * @see  ail_filter_new()
249  *
250  * @par Prospective Clients:
251  * External Apps.
252  *
253  * @code
254  * int count_apps()
255  * {
256  *      ail_filter_h filter;
257  *      ail_error_e ret;
258  *      int n;
259  *
260  *      ret = ail_filter_new(&filter);
261  *      if (ret != AIL_ERROR_OK)
262  *              return -1;
263  *
264  *      ret = ail_filter_add_bool(filter, AIL_PROP_X_SLP_REMOVABLE_BOOL, true);
265  *      if (ret != AIL_ERROR_OK)
266  *              return -1;
267  *
268  *      ret = ail_filter_count_appinfo(filter, &n);
269  *      if (ret != AIL_ERROR_OK)
270  *              return -1;
271  *
272  *      fprintf(stderr, "N of apps = %d\n", n);
273  *
274  *      return n;
275  * }
276  * @endcode
277  */
278 ail_error_e ail_filter_add_bool(ail_filter_h filter, const char *property, bool value);
279
280 /**
281  * @fn ail_error_e ail_error_e ail_filter_add_str(ail_filter_h filter, const char *property, const char *value)
282  *
283  * @brief Add string condition to filter by. The string is case-sensitive.
284  *
285  * @par Sync (or) Async : Synchronous API
286  *
287  * @param[in] filter     a filter handle which can be create with ail_filter_new()
288  * @param[in] property   a property type of string
289  * @param[in] value      the value to filter by
290  *
291  * @return 0 if success, negative value(<0) if fail\n
292  * @retval      AIL_ERROR_OK                            success
293  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
294  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
295  *
296  * @pre The filter should be valid handle which was created by ail_filter_new()
297  *
298  * @see  ail_filter_new()
299  *
300  * @par Prospective Clients:
301  * External Apps.
302  *
303  * @codea
304  * int count_apps()
305  * {
306  *      ail_filter_h filter;
307  *      ail_error_e ret;
308  *      int n;
309  *
310  *      ret = ail_filter_new(&filter);
311  *      if (ret != AIL_ERROR_OK)
312  *              return -1;
313  *
314  *      ret = ail_filter_add_str(filter, AIL_PROP_PACKAGE_STR, "com.samsung.memo");
315  *      if (ret != AIL_ERROR_OK)
316  *              return -1;
317  *
318  *      ret = ail_filter_count_appinfo(filter, &n);
319  *      if (ret != AIL_ERROR_OK)
320  *              return -1;
321  *
322  *      fprintf(stderr, "N of apps = %d\n", n);
323  *
324  *      return n;
325  * }
326  * @endcode
327  */
328 ail_error_e ail_filter_add_str(ail_filter_h filter, const char *property, const char *value);
329
330
331 /**
332  * @fn ail_error_e ail_filter_destroy(ail_filter_h filter)
333  *
334  * @brief Destroy a filter which is not used any longer.
335  *
336  * @par Sync (or) Async : Synchronous API
337  *
338  * @param[in] filter    filter handle
339  *
340  * @return 0 if success, negative value(<0) if fail\n
341  * @retval      AIL_ERROR_OK                    success
342  * @retval      AIL_ERROR_INVALID_PARAMETER     invalid parameter
343  *
344  * @post If the filter is no longer used, it should be freed with ail_filter_destroy()
345  *
346  * @see  ail_filter_new()
347  *
348  * @par Prospective Clients:
349  * External Apps.
350  *
351  * @code
352  * int count_apps()
353  * {
354  *      ail_filter_h filter;
355  *      ail_error_e ret;
356  *      int n;
357  *
358  *      ret = ail_filter_new(&filter);
359  *      if (ret != AIL_ERROR_OK)
360  *              return -1;
361  *
362  *      ret = ail_filter_add_bool(filter, AIL_PROP_X_SLP_REMOVABLE_BOOL, true);
363  *      if (ret != AIL_ERROR_OK)
364  *              return -1;
365  *
366  *      ret = ail_filter_count_appinfo(filter, &n);
367  *      if (ret != AIL_ERROR_OK)
368  *              return -1;
369  *
370  *      printf("N of removable apps = %d\n", n);
371  *
372  *      ret = ail_filter_add_str(filter, AIL_PROP_MIMETYPE_STR, "audio/wav");
373  *      if (ret != AIL_ERROR_OK)
374  *              return -1;
375  *
376  *      ret = ail_filter_count_appinfo(filter, &n);
377  *      if (ret != AIL_ERROR_OK)
378  *              return -1;
379  *
380  *      printf("N of apps removable and supporting 'audo/wav' mime type = %d\n", n);
381  *
382  *      ail_filter_destroy(filter);
383  *
384  *      return n;
385  * }
386  * @endcode
387  */
388 ail_error_e ail_filter_destroy(ail_filter_h filter);
389
390 /**
391  * @brief return value type of ail_list_appinfo_cb
392  */
393 typedef enum {
394         AIL_CB_RET_CONTINUE = 1,                /**< continue */
395         AIL_CB_RET_CANCEL = 0,                  /**< cancel */
396 } ail_cb_ret_e;
397
398 /**
399  * @fn ail_cb_ret_e (*ail_list_appinfo_cb) (const ail_appinfo_h appinfo_h, void *user_data)
400  *
401  * @breif Specifies the type of functions passed to ail_filter_list_appinfo_foreach().
402  *
403  * @param[in] appinfo_h the appinfo's handle
404  * @param[in] user_data user data passed to ail_filtet_list_appinfo_foreach()
405  *
406  * @return 0 if success, negative value(<0) if fail\n
407  * @retval      AIL_CB_RET_CONTINUE             return if you continue iteration
408  * @retval      AIL_CB_RET_CANCEL               return if you cancel iteration
409  *
410  * @see  ail_filter_list_appinfo_foreach()
411  */
412 typedef ail_cb_ret_e (*ail_list_appinfo_cb)(const ail_appinfo_h appinfo_h, void *user_data, uid_t uid);
413
414 /**
415  * @fn ail_error_e ail_error_e ail_filter_list_appinfo_foreach(ail_filter_h filter, ail_list_appinfo_cb func, void *user_data)
416  * @fn ail_error_e ail_error_e ail_filter_list_usr_appinfo_foreach(ail_filter_h filter, ail_list_appinfo_cb func, void *user_data, uid_t uid)
417  * @brief Calls the callback function for each app filtered by given filter. If the filter is not given (i.e filter handle is NULL), it is invoked for all apps.
418  *
419  * @par Sync (or) Async : Synchronous API
420  *
421  * @param[in] filter            a filter handle
422  * @param[in] func              the function to call with each app's appinfo
423  * @param[in] user_data         user_data to pass to the function
424  * @param[in] uid               ID of the owner of the application
425  *
426  * @return  0 if success, negative value(<0) if fail\n
427  * @retval      AIL_ERROR_OK                    success
428  * @retval      AIL_ERROR_DB_FAILED             database error
429  * @retval      AIL_ERROR_INVALID_PARAMETER     invalid parameter
430  *
431  * @see  ail_list_appinfo_cb
432  * @see ail_filter_add_bool()
433  * @see ail_filter_add_int()
434  * @see ail_filter_add_str()
435  *
436  * @par Prospective Clients:
437  * External Apps.
438  *
439  * @code
440  * ail_cb_ret_e appinfo_func(const ail_appinfo_h appinfo, void *user_data)
441  * {
442  *      int *i = (int *)user_data;
443  *      char *appid;
444  *
445  *      ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &appid);
446  *      printf("i=%d %s\n", (*i)++, appid);
447  *
448  *      if (*i > 30)
449  *              return AIL_CB_RET_CANCEL;
450  *
451  *      return AIL_CB_RET_CONTINUE;
452  * }
453  *
454  * int list_apps()
455  * {
456  *      ail_filter_h filter;
457  *      ail_error_e ret;
458  *      int i = 0;
459  *
460  *      ret = ail_filter_new(&filter);
461  *      if (ret != AIL_ERROR_OK)
462  *              return -1;
463  *
464  *      ret = ail_filter_add_bool(filter, AIL_PROP_X_SLP_REMOVABLE_BOOL, true);
465  *      if (ret != AIL_ERROR_OK)
466  *              return -1;
467  *
468  *      ret = ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "Application");
469  *      if (ret != AIL_ERROR_OK)
470  *              return -1;
471  *
472  *      printf("List apps which are removable and 'Application' typed\n");
473  *      ail_filter_list_appinfo_foreach(filter, appinfo_func, (void *)&i);
474  *      ail_filter_destroy(filter);
475  *
476  *      return 0;
477  * }
478  * @endcode
479  */
480 ail_error_e ail_filter_list_appinfo_foreach(ail_filter_h filter,
481                 ail_list_appinfo_cb appinfo_func, void *user_data);
482 ail_error_e ail_filter_list_usr_appinfo_foreach(ail_filter_h filter,
483                 ail_list_appinfo_cb appinfo_func, void *user_data, uid_t uid);
484
485 /**
486  * @fn ail_error_e ail_error_e ail_filter_count_appinfo(ail_filter_h filter, int *count, uid_t uid)
487  * @fn ail_error_e ail_error_e ail_filter_count_usr_appinfo(ail_filter_h filter, int *count)
488  * @brief Gets the number of app which is filtered by the given filter. If the filter is not given (i.e filter handle is NULL), all app are counted.
489  *
490  * @par Sync (or) Async : Synchronous API
491  *
492  * @param[in] filter    a filter handle
493  * @param[in] count     the number of appinfo which is filtered
494  * @param[in] uid       ID of the owner of the application
495  *
496  * @return 0 if success, negative value(<0) if fail\n
497  * @retval      AIL_ERROR_OK                    success
498  * @retval      AIL_ERROR_INVALID_PARAMETER     invalid parameter
499  * @retval      AIL_ERROR_OUT_OF_MEMORY         out of memory
500  *
501  * @pre None
502  * @post None
503  *
504  * @see ail_filter_new()
505  * @see ail_filter_add_bool()
506  * @see ail_filter_add_int()
507  * @see ail_filter_add_str()
508  *
509  * @par Prospective Clients:
510  * External Apps.
511  *
512  * @code
513  * int count_apps()
514  * {
515  *      ail_filter_h filter;
516  *      ail_error_e ret;
517  *      int n;
518  *
519  *      ret = ail_filter_new(&filter);
520  *      if (ret != AIL_ERROR_OK)
521  *              return -1;
522  *
523  *      ret = ail_filter_add_bool(filter, AIL_PROP_NODISPLAY_BOOL, true);
524  *      if (ret != AIL_ERROR_OK)
525  *              return -1;
526  *
527  *      ret = ail_filter_count_appinfo(filter, &n);
528  *      if (ret != AIL_ERROR_OK)
529  *              return -1;
530  *
531  *      printf("N of app not to be displayed = %d", n);
532  *
533  *      ret = ail_filter_count_appinfo(NULL, &n);
534  *      if (ret != AIL_ERROR_OK)
535  *              return -1;
536  *
537  *      printf("N of all app = %d\n", n);
538  *
539  *      return n;
540  * }
541  * @endcode
542  */
543 ail_error_e ail_filter_count_appinfo(ail_filter_h filter, int *count);
544 ail_error_e ail_filter_count_usr_appinfo(ail_filter_h filter, int *count, uid_t uid);
545
546 /**
547  * @fn ail_error_e ail_package_get_appinfo(const char *package, ail_appinfo_h *handle)
548  * @fn ail_error_e ail_package_get_appinfo(const char *package, uid_t uid, ail_appinfo_h *handle)
549  * @brief get an application information related to a package.
550  *      This API just retrieves all the information of the package from Application Information Database.
551  *      All data related to the package are loaded in the memory after calling this function.
552  *      If you want to read a value from the retrieving data, you have to use the functions of ail_appinfo_get_xxx.
553  * @par Sync (or) Async : Synchronous API.
554  *
555  * @param[in] package package name what you want to know about.
556  * @param[in] uid ID of the owner of the application
557  * @param[out] handle handle will be used with the functions of ail_appinfo_get_xxx. If no data, it will be NULL.
558  *
559  * @return 0 if success, negative value(<0) if fail\n
560  * @retval      AIL_ERROR_OK                            success
561  * @retval      AIL_ERROR_FAIL                          internal error
562  * @retval      AIL_ERROR_DB_FAILED                     database error
563  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
564  * @retval      AIL_ERROR_NO_DATA                       no data. cannot find the package.
565  *
566  * @pre declare a handle before calling this function. The handle is used as a second argument of this API.
567  * @post destroy the handle with the function of ail_package_destroy_appinfo after using it all.
568  *
569  * @see  ail_package_destroy_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
570  *
571  * @par Prospective Clients:
572  * External Apps.
573  *
574  * @code
575  * static ail_error_e _get_name(const char *package)
576  * {
577  *      ail_appinfo_h handle;
578  *      ail_error_e ret;
579  *      char *str;
580  *
581  *      ret = ail_package_get_appinfo(package, &handle);
582  *      if (ret != AIL_ERROR_OK)
583  *              return AIL_ERROR_FAIL;
584  *
585  *      ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
586  *      if (ret != AIL_ERROR_OK)
587  *              return AIL_ERROR_FAIL;
588  *
589  *      fprintf(stderr, "Package[%s], Property[%s] : %s\n", package, property, str);
590  *
591  *      ret = ail_package_destroy_appinfo(handle);
592  *      if (ret != AIL_ERROR_OK)
593  *              return AIL_ERROR_FAIL;
594  *
595  *      return AIL_ERROR_OK;
596  * }
597  * @endcode
598  */
599 ail_error_e ail_package_get_appinfo(const char *package, ail_appinfo_h *handle) __attribute__((deprecated));
600 ail_error_e ail_package_get_usr_appinfo(const char *package, uid_t uid, ail_appinfo_h *handle) __attribute__((deprecated));
601
602 /**
603  * @fn ail_error_e ail_get_appinfo(const char *appid, ail_appinfo_h *handle)
604  * @fn ail_error_e ail_get_usr_appinfo(const char *appid, uid_t uid, ail_appinfo_h *handle)
605  * @brief get an application information related to a appid.
606  *      This API just retrieves all the information of the application from Application Information Database.
607  *      All data related to the appid are loaded in the memory after calling this function.
608  *      If you want to read a value from the retrieving data, you have to use the functions of ail_appinfo_get_xxx.
609  *
610  * @par Sync (or) Async : Synchronous API.
611  *
612  * @param[in] appid appid what you want to know about.
613  * @param[out] handle handle will be used with the functions of ail_appinfo_get_xxx. If no data, it will be NULL.
614  *
615  * @return 0 if success, negative value(<0) if fail\n
616  * @retval      AIL_ERROR_OK                            success
617  * @retval      AIL_ERROR_FAIL                          internal error
618  * @retval      AIL_ERROR_DB_FAILED                     database error
619  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
620  * @retval      AIL_ERROR_NO_DATA                       no data. cannot find the app.
621  *
622  * @pre declare a handle before calling this function. The handle is used as a second argument of this API.
623  * @post destroy the handle with the function of ail_get_appinfo after using it all.
624  *
625  * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
626  *
627  * @par Prospective Clients:
628  * External Apps.
629  *
630  * @code
631  * static ail_error_e _get_name(const char *appid)
632  * {
633  *      ail_appinfo_h handle;
634  *      ail_error_e ret;
635  *      char *str;
636  *
637  *      ret = ail_get_appinfo(appid, &handle);
638  *      if (ret != AIL_ERROR_OK)
639  *              return AIL_ERROR_FAIL;
640  *
641  *      ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
642  *      if (ret != AIL_ERROR_OK)
643  *              return AIL_ERROR_FAIL;
644  *
645  *      fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
646  *
647  *      ret = ail_destroy_appinfo(handle);
648  *      if (ret != AIL_ERROR_OK)
649  *              return AIL_ERROR_FAIL;
650  *
651  *      return AIL_ERROR_OK;
652  * }
653  * @endcode
654  */
655 ail_error_e ail_get_appinfo(const char *appid, ail_appinfo_h *handle);
656 ail_error_e ail_get_usr_appinfo(const char *appid, uid_t uid, ail_appinfo_h *handle);
657
658 /**
659  * @fn ail_error_e ail_appinfo_get_bool(const ail_appinfo_h handle, const char *property, bool *value)
660  *
661  * @brief get a boolean value related to the property.
662  *      Before using this API, the handle is defined by calling ail_get_appinfo.
663  *      This function needs a out-parameter for the value.
664  *
665  * @par Sync (or) Async : Synchronous API.
666  *
667  * @param[in] handle    the handle is defined by calling ail_get_appinfo.
668  * @param[in] property   a property type of boolean
669  * @param[out] value    a out-parameter value that is mapped with the property.
670  *
671  * @return 0 if success, negative value(<0) if fail\n
672  * @retval      AIL_ERROR_OK                            success
673  * @retval      AIL_ERROR_DB_FAILED                     database error
674  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
675  *
676  * @pre define a handle using ail_get_appinfo. The handle is used as a first argument of this API.
677  * @post destroy the handle with the function of ail_destroy_appinfo after using it all.
678  *
679  * @see  ail_get_appinfo(), ail_destroy_appinfo(), ail_appinfo_get_int(), ail_appinfo_get_str()
680  *
681  * @par Prospective Clients:
682  * External Apps.
683  *
684  * @code
685  * static ail_error_e _get_nodisplay(const char *appid)
686  * {
687  *      ail_appinfo_h handle;
688  *      ail_error_e ret;
689  *      bool value;
690  *
691  *      ret = ail_get_appinfo(appid, &handle);
692  *      if (ret != AIL_ERROR_OK)
693  *              return AIL_ERROR_FAIL;
694  *
695  *      ret = ail_appinfo_get_bool(handle, AIL_PROP_NODISPLAY_BOOL, &value);
696  *      if (ret != AIL_ERROR_OK)
697  *              return AIL_ERROR_FAIL;
698  *
699  *      fprintf(stderr, "appid[%s] : %d\n", appid, value);
700  *
701  *      ret = ail_destroy_appinfo(handle);
702  *      if (ret != AIL_ERROR_OK)
703  *              return AIL_ERROR_FAIL;
704  *
705  *      return AIL_ERROR_OK;
706  * }
707  * @endcode
708  */
709 ail_error_e ail_appinfo_get_bool(const ail_appinfo_h handle, const char *property, bool *value);
710
711 /**
712  * @fn ail_error_e ail_appinfo_get_int(const ail_appinfo_h handle, const char *property, int *value)
713  *
714  * @brief get a integer value related to the property.
715  *      Before using this API, the handle is defined by calling ail_get_appinfo.
716  *      This function needs a out-parameter for the value.
717  *
718  * @par Sync (or) Async : Synchronous API.
719  *
720  * @param[in] handle    the handle is defined by calling ail_get_appinfo.
721  * @param[in] property  a property type of integer.
722  * @param[out] value    a out-parameter value that is mapped with the property.
723  *
724  * @return 0 if success, negative value(<0) if fail\n
725  * @retval      AIL_ERROR_OK                            success
726  * @retval      AIL_ERROR_DB_FAILED                     database error
727  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
728  *
729  * @pre define a handle using ail_get_appinfo. The handle is used as a first argument of this API.
730  * @post destroy the handle with the function of ail_destroy_appinfo after using it all.
731  *
732  * @see  ail_get_appinfo(), ail_destroy_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_str()
733  *
734  * @par Prospective Clients:
735  * External Apps.
736  *
737  * @code
738  * static ail_error_e _get_x_slp_baselayoutwidth(const char *appid)
739  * {
740  *      ail_appinfo_h handle;
741  *      ail_error_e ret;
742  *      int value;
743  *
744  *      ret = ail_get_appinfo(appid, &handle);
745  *      if (ret != AIL_ERROR_OK)
746  *              return AIL_ERROR_FAIL;
747  *
748  *      ret = ail_appinfo_get_int(handle, AIL_PROP_X_SLP_BASELAYOUTWIDTH_INT, &value);
749  *      if (ret != AIL_ERROR_OK)
750  *              return AIL_ERROR_FAIL;
751  *
752  *      fprintf(stderr, "Package[%s] : %d\n", appid, value);
753  *
754  *      ret = ail_destroy_appinfo(handle);
755  *      if (ret != AIL_ERROR_OK)
756  *              return AIL_ERROR_FAIL;
757  *
758  *      return AIL_ERROR_OK;
759  * }
760  * @endcode
761  */
762 ail_error_e ail_appinfo_get_int(const ail_appinfo_h handle, const char *property, int *value);
763
764 /**
765  * @fn ail_error_e ail_appinfo_get_str(const ail_appinfo_h handle, const char *property, uid_t uid, char **str)
766  * @fn ail_error_e ail_appinfo_get_usr_str(const ail_appinfo_h handle, const char *property, char **str)
767  * @brief get a string related to the property.
768  *      Before using this API, the handle is defined by calling ail_get_appinfo.
769  *      This function needs a out-parameter for the value.
770  *
771  * @par Sync (or) Async : Synchronous API.
772  *
773  * @param[in] handle    the handle is defined by calling ail_get_appinfo.
774  * @param[in] property  a property type of string.
775  * @param[in]   uid     the addressee user id of the instruction
776  * @param[out] str              a out-parameter string that is mapped with the property. The icon property contains the absolute file path. If there is no data, the value of str is NULL.
777  *
778  * @return 0 if success, negative value(<0) if fail\n
779  * @retval      AIL_ERROR_OK                            success
780  * @retval      AIL_ERROR_DB_FAILED                     database error
781  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
782  *
783  * @pre define a handle using ail_get_appinfo. The handle is used as a first argument of this API.
784  * @post str doesn't need to be freed. It will be freed by calling ail_destroy_appinfo.
785  *
786  * @see  ail_get_appinfo(), ail_destroy_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int()
787  *
788  * @par Prospective Clients:
789  * External Apps.
790  *
791  * @code
792  * static ail_error_e _get_nodisplay(const char *appid)
793  * {
794  *      ail_appinfo_h handle;
795  *      ail_error_e ret;
796  *      char* value;
797  *
798  *      ret = ail_get_appinfo(appid, &handle);
799  *      if (ret != AIL_ERROR_OK)
800  *              return AIL_ERROR_FAIL;
801  *
802  *      ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &value);
803  *      if (ret != AIL_ERROR_OK)
804  *              return AIL_ERROR_FAIL;
805  *
806  *      fprintf(stderr, "Package[%s] : %d\n", appid, value);
807  *
808  *      ret = ail_destroy_appinfo(handle);
809  *      if (ret != AIL_ERROR_OK)
810  *              return AIL_ERROR_FAIL;
811  *
812  *      return AIL_ERROR_OK;
813  * }
814  * @endcode
815  */
816 ail_error_e ail_appinfo_get_str(const ail_appinfo_h handle, const char *property, char **str);
817 ail_error_e ail_appinfo_get_usr_str(const ail_appinfo_h handle, const char *property, uid_t uid, char **str);
818
819 /**
820  * @fn ail_error_e ail_package_destroy_appinfo(const ail_appinfo_h handle)
821  *
822  * @brief destroy a handle what you get with the function of ail_package_get_appinfo.
823  *
824  * @par Sync (or) Async : Synchronous API.
825  *
826  * @param[in] handle destroy all resources related to the handle.
827  *
828  * @return 0 if success, negative value(<0) if fail\n
829  * @retval      AIL_ERROR_OK                            success
830  * @retval      AIL_ERROR_DB_FAILED                     database error
831  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
832  *
833  * @pre need a handle that you don't need anymore.
834  * @post cannot use the handle after destroying.
835  *
836  * @see  ail_package_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
837  *
838  * @par Prospective Clients:
839  * External Apps.
840  *
841  * @code
842  * static ail_error_e _get_name(const char *package)
843  * {
844  *      ail_appinfo_h handle;
845  *      ail_error_e ret;
846  *      char *str;
847  *
848  *      ret = ail_package_get_appinfo(package, &handle);
849  *      if (ret != AIL_ERROR_OK)
850  *              return AIL_ERROR_FAIL;
851  *
852  *      ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
853  *      if (ret != AIL_ERROR_OK)
854  *              return AIL_ERROR_FAIL;
855  *
856  *      fprintf(stderr, "Package[%s], Property[%s] : %s\n", package, property, str);
857  *
858  *      ret = ail_package_destroy_appinfo(handle);
859  *      if (ret != AIL_ERROR_OK)
860  *              return AIL_ERROR_FAIL;
861  *
862  *      return AIL_ERROR_OK;
863  * }
864  * @endcode
865  */
866 ail_error_e ail_package_destroy_appinfo(const ail_appinfo_h handle) __attribute__((deprecated));
867
868 /**
869  * @fn ail_error_e ail_destroy_appinfo(const ail_appinfo_h handle)
870  *
871  * @brief destroy a handle what you get with the function of ail_get_appinfo.
872  *
873  * @par Sync (or) Async : Synchronous API.
874  *
875  * @param[in] handle destroy all resources related to the handle.
876  *
877  * @return 0 if success, negative value(<0) if fail\n
878  * @retval      AIL_ERROR_OK                            success
879  * @retval      AIL_ERROR_DB_FAILED                     database error
880  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
881  *
882  * @pre need a handle that you don't need anymore.
883  * @post cannot use the handle after destroying.
884  *
885  * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
886  *
887  * @par Prospective Clients:
888  * External Apps.
889  *
890  * @code
891  * static ail_error_e _get_name(const char *appid)
892  * {
893  *      ail_appinfo_h handle;
894  *      ail_error_e ret;
895  *      char *str;
896  *
897  *      ret = ail_get_appinfo(appid, &handle);
898  *      if (ret != AIL_ERROR_OK)
899  *              return AIL_ERROR_FAIL;
900  *
901  *      ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
902  *      if (ret != AIL_ERROR_OK)
903  *              return AIL_ERROR_FAIL;
904  *
905  *      fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
906  *
907  *      ret = ail_destroy_appinfo(handle);
908  *      if (ret != AIL_ERROR_OK)
909  *              return AIL_ERROR_FAIL;
910  *
911  *      return AIL_ERROR_OK;
912  * }
913  * @endcode
914  */
915 ail_error_e ail_destroy_appinfo(const ail_appinfo_h handle);
916
917 /**
918  * @fn ail_error_e ail_close_appinfo_db(void)
919  *
920  * @brief close appinfo db.
921  *
922  * @par Sync (or) Async : Synchronous API.
923  *
924  * @return 0 if success, negative value(<0) if fail\n
925  * @retval      AIL_ERROR_OK                            success
926  * @retval      AIL_ERROR_DB_FAILED                     database error
927  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
928  *
929  * @pre need a handle that you don't need anymore.
930  * @post cannot use the handle after destroying.
931  *
932  * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
933  *
934  * @par Prospective Clients:
935  * External Apps.
936  *
937  * @code
938  * static ail_error_e _get_name(const char *appid)
939  * {
940  *      ail_appinfo_h handle;
941  *      ail_error_e ret;
942  *      char *str;
943  *
944  *      ret = ail_get_appinfo(appid, &handle);
945  *      if (ret != AIL_ERROR_OK)
946  *              return AIL_ERROR_FAIL;
947  *
948  *      ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
949  *      if (ret != AIL_ERROR_OK)
950  *              return AIL_ERROR_FAIL;
951  *
952  *      fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
953  *
954  *      ret = ail_destroy_appinfo(handle);
955  *      if (ret != AIL_ERROR_OK)
956  *              return AIL_ERROR_FAIL;
957  *
958  *      ret = ail_close_appinfo_db();
959  *      if (ret != AIL_ERROR_OK)
960  *              return AIL_ERROR_FAIL;
961  *
962  *      return AIL_ERROR_OK;
963  * }
964  * @endcode
965  */
966 ail_error_e ail_close_appinfo_db(void);
967
968 /**
969  * @fn ail_error_e ail_desktop_add(const char *appid, )
970  * @fn ail_error_e ail_usr_desktop_add(const char *appid, uid_t uid)
971  * @brief add a app information into Application Information Database.
972  *      A desktop file for this app has to be installed in the desktop directory before using this API.
973  *      If there is no database for Application Information Database, this API will create the DB.
974  *      If there is a DB, this function adds information for the app into the DB.
975  *      And a notification is published to the applications who want to know about changing DB.
976  *
977  * @par Sync (or) Async : Synchronous API.
978  *
979  * @param[in] appid
980  * @param[in]   uid     the addressee user id of the instruction
981  *
982  * @return 0 if success, negative value(<0) if fail\n
983  * @retval      AIL_ERROR_OK                            success
984  * @retval      AIL_ERROR_FAIL                          internal error
985  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
986  *
987  * @pre a desktop file for the app has to be installed in the desktop directory before using this API.
988  * @post app information is added into the Application Information Database.
989  *
990  * @see  ail_desktop_update(), ail_desktop_remove()
991  *
992  * @par Prospective Clients:
993  * External Apps.
994  *
995  * @code
996  * static ail_error_e _add_desktop(const char *appid)
997  * {
998  *      ail_error_e ret;
999  *
1000  *      if (!appid)
1001  *              return AIL_ERROR_FAIL;
1002  *
1003  *      ret = ail_desktop_add(appid);
1004  *      if (ret != AIL_ERROR_OK)
1005  *              return AIL_ERROR_FAIL;
1006  *
1007  *      return AIL_ERROR_OK;
1008  * }
1009  * @endcode
1010  */
1011 ail_error_e ail_desktop_add(const char *appid);
1012 ail_error_e ail_usr_desktop_add(const char *appid, uid_t uid);
1013
1014 /**
1015  * @fn ail_error_e ail_desktop_update(const char *appid)
1016  * @fn ail_error_e ail_usr_desktop_update(const char *appid,  uid_t uid)
1017  * @brief update a app information in the Application Information Database.
1018  *      A desktop file for this app has to be installed in the desktop directory before using this API.
1019  *      And a notification is published to the applications who want to know about changing DB.
1020  *
1021  * @par Sync (or) Async : Synchronous API.
1022  *
1023  * @param[in] appid
1024  * @param[in] uid       ID of the owner of the application
1025  *
1026  * @return 0 if success, negative value(<0) if fail\n
1027  * @retval      AIL_ERROR_OK                            success
1028  * @retval      AIL_ERROR_FAIL                          internal error
1029  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1030  *
1031  * @pre a desktop file for the app has to be installed in the desktop directory before using this API.
1032  * @post update a app information in the Application Information Database.
1033  *
1034  * @see  ail_desktop_add(), ail_desktop_remove()
1035  *
1036  * @par Prospective Clients:
1037  * External Apps.
1038  *
1039  * @code
1040  * static ail_error_e _update_desktop(const char *appid)
1041  * {
1042  *      ail_error_e ret;
1043  *
1044  *      if (!appid)
1045  *              return AIL_ERROR_FAIL;
1046  *
1047  *      ret = ail_desktop_update(appid);
1048  *      if (ret != AIL_ERROR_OK)
1049  *              return AIL_ERROR_FAIL;
1050  *
1051  *      return AIL_ERROR_OK;
1052  * }
1053  * @endcode
1054  */
1055 ail_error_e ail_desktop_update(const char *appid);
1056 ail_error_e ail_usr_desktop_update(const char *appid, uid_t uid);
1057
1058 /**
1059  * @fn ail_error_e ail_desktop_remove(const char *appid)
1060  * @fn ail_error_e ail_usr_desktop_remove(const char *appid, uid_t uid)
1061  * @brief remove a app information in the Application Information Database.
1062  *      And a notification is published to the applications who want to know about changing DB.
1063  *
1064  * @par Sync (or) Async : Synchronous API.
1065  *
1066  * @param[in] appid
1067  * @param[in]   uid     the addressee user id of the instruction
1068  *
1069  * @return 0 if success, negative value(<0) if fail\n
1070  * @retval      AIL_ERROR_OK                            success
1071  * @retval      AIL_ERROR_FAIL                          internal error
1072  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1073  *
1074  * @pre no pre-condition.
1075  * @post app information is removed in the Application Information Database.
1076  *
1077  * @see  ail_desktop_add(), ail_desktop_update()
1078  *
1079  * @par Prospective Clients:
1080  * External Apps.
1081  *
1082  * @code
1083  * static ail_error_e _remove_desktop(const char *appid)
1084  * {
1085  *      ail_error_e ret;
1086  *
1087  *      if (!appid)
1088  *              return AIL_ERROR_FAIL;
1089  *
1090  *      ret = ail_desktop_remove(appid);
1091  *      if (ret != AIL_ERROR_OK)
1092  *              return AIL_ERROR_FAIL;
1093  *
1094  *      return AIL_ERROR_OK;
1095  * }
1096  * @endcode
1097  */
1098 ail_error_e ail_desktop_remove(const char *appid);
1099 ail_error_e ail_usr_desktop_remove(const char *appid, uid_t uid);
1100
1101 /**
1102  * @fn ail_error_e ail_desktop_clean(const char *pkgid)
1103  * @fn ail_error_e ail_usr_desktop_clean(const char *pkgid, uid_t uid))
1104  * @brief clean a pkg information in the Application Information Database.
1105  *
1106  * @par Sync (or) Async : Synchronous API.
1107  *
1108  * @param[in] pkgid
1109  * @param[in] uid       ID of the owner of the application
1110  *
1111  * @return 0 if success, negative value(<0) if fail\n
1112  * @retval      AIL_ERROR_OK                            success
1113  * @retval      AIL_ERROR_FAIL                          internal error
1114  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1115  *
1116  * @pre no pre-condition.
1117  * @post app information is removed in the Application Information Database.
1118  *
1119  * @see  ail_desktop_add(), ail_desktop_update()
1120  *
1121  * @par Prospective Clients:
1122  * External Apps.
1123  *
1124  * @code
1125  * static ail_error_e _clean_desktop(const char *pkgid)
1126  * {
1127  *      ail_error_e ret;
1128  *
1129  *      if (!appid)
1130  *              return AIL_ERROR_FAIL;
1131  *
1132  *      ret = ail_desktop_clean(pkgid);
1133  *      if (ret != AIL_ERROR_OK)
1134  *              return AIL_ERROR_FAIL;
1135  *
1136  *      return AIL_ERROR_OK;
1137  * }
1138  * @endcode
1139  */
1140 ail_error_e ail_desktop_clean(const char *pkgid);
1141 ail_error_e ail_usr_desktop_clean(const char *pkgid, uid_t uid);
1142
1143 /**
1144  * @fn ail_error_e ail_desktop_fota(const char *appid)
1145  * @fn ail_error_e ail_usr_desktop_fota(const char *appid, uid_t uid)
1146  * @brief add a app information into Application Information Database.
1147  *      A desktop file for this app has to be installed in the desktop directory before using this API.
1148  *      If there is no database for Application Information Database, this API will create the DB.
1149  *      If there is a DB, this function adds information for the app into the DB.
1150  *      And a notification is not published to the applications who want to know about changing DB.
1151  *
1152  * @par Sync (or) Async : Synchronous API.
1153  *
1154  * @param[in] appid
1155  * @param[in]   uid     the addressee user id of the instruction
1156  *
1157  * @return 0 if success, negative value(<0) if fail\n
1158  * @retval      AIL_ERROR_OK                            success
1159  * @retval      AIL_ERROR_FAIL                          internal error
1160  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1161  *
1162  * @pre a desktop file for the app has to be installed in the desktop directory before using this API.
1163  * @post app information is added into the Application Information Database.
1164  *
1165  * @see  ail_desktop_update(), ail_desktop_remove()
1166  *
1167  * @par Prospective Clients:
1168  * External Apps.
1169  *
1170  * @code
1171  * static ail_error_e _add_desktop_fota(const char *appid)
1172  * {
1173  *      ail_error_e ret;
1174  *
1175  *      if (!appid)
1176  *              return AIL_ERROR_FAIL;
1177  *
1178  *      ret = ail_desktop_fota(appid);
1179  *      if (ret != AIL_ERROR_OK)
1180  *              return AIL_ERROR_FAIL;
1181  *
1182  *      return AIL_ERROR_OK;
1183  * }
1184  * @endcode
1185  */
1186 ail_error_e ail_desktop_fota(const char *appid);
1187 ail_error_e ail_usr_desktop_fota(const char *appid, uid_t uid);
1188
1189 /**
1190  *@fn ail_error_e ail_desktop_appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast)
1191  * @fn ail_error_e ail_desktop_appinfo_modify_usr_str(const char *appid, uid_t uid, const char *property, const char *value, bool broadcast)
1192  * @brief update a app information db.
1193  *      And a notification is published to the applications who want to know about changing DB.
1194  *
1195  * @par Sync (or) Async : Synchronous API.
1196  *
1197  * @param[in] appid
1198  * @param[in] uid       ID of the owner of the application
1199  *
1200  * @return 0 if success, negative value(<0) if fail\n
1201  * @retval      AIL_ERROR_OK                            success
1202  * @retval      AIL_ERROR_FAIL                          internal error
1203  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1204  *
1205  * @pre no pre-condition.
1206  * @post app information is removed in the Application Information Database.
1207  *
1208  *
1209  * @par Prospective Clients:
1210  * External Apps.
1211  *
1212  * @code
1213  * static ail_error_e _appinfo_modify_str(const char *appid, uid_t uid, const char *property, const char *value, bool broadcast)
1214  * {
1215  *      ail_error_e ret;
1216  *
1217  *      if (!appid)
1218  *              return AIL_ERROR_FAIL;
1219  *
1220  *      if (!property)
1221  *              return AIL_ERROR_FAIL;
1222  *
1223  *      if (!value)
1224  *              return AIL_ERROR_FAIL;
1225  *
1226  *      ret = ail_desktop_appinfo_modify_str(appid, property, value, broadcast);
1227  *      if (ret != AIL_ERROR_OK)
1228  *              return AIL_ERROR_FAIL;
1229  *
1230  *      return AIL_ERROR_OK;
1231  * }
1232  * @endcode
1233  */
1234 ail_error_e ail_desktop_appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast);
1235 ail_error_e ail_desktop_appinfo_modify_usr_str(const char *appid, uid_t uid, const char *property, const char *value, bool broadcast);
1236 /** @} */
1237
1238 #ifdef __cplusplus
1239 }
1240 #endif /* __cplusplus */
1241
1242 #endif /* __AIL_H__ */