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