added a error
[platform/core/appfw/app-svc.git] / include / appsvc.h
1 /*
2  *  app-svc
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 #ifndef __APP_SVC_H__
25 #define __APP_SVC_H__
26
27 /**
28  * @file    appsvc.h
29  * @version 1.1
30  * @brief   This file contains APIs of the appsvc library
31  */
32
33 /**
34  * @addtogroup APPLICATION_FRAMEWORK
35  * @{
36  *
37  * @defgroup appsvc Application Service
38  * @version  1.1
39  * @brief    Application Service library
40  *
41  */
42
43 /**
44  * @addtogroup appsvc
45  * @{
46  */
47
48
49 #include <bundle.h>
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55
56 /** APP_SVC OPERATION TYPE*/
57 #define APPSVC_OPERATION_DEFAULT                "http://tizen.org/appcontrol/operation/default"
58 /** APP_SVC OPERATION TYPE*/
59 #define APPSVC_OPERATION_EDIT                   "http://tizen.org/appcontrol/operation/edit"
60 /** APP_SVC OPERATION TYPE*/
61 #define APPSVC_OPERATION_VIEW                   "http://tizen.org/appcontrol/operation/view"
62 /** APP_SVC OPERATION TYPE*/
63 #define APPSVC_OPERATION_PICK                   "http://tizen.org/appcontrol/operation/pick"
64 /** APP_SVC OPERATION TYPE*/
65 #define APPSVC_OPERATION_CREATE_CONTENT         "http://tizen.org/appcontrol/operation/create_content"
66 /** APP_SVC OPERATION TYPE*/
67 #define APPSVC_OPERATION_CALL                   "http://tizen.org/appcontrol/operation/call"
68 /** APP_SVC OPERATION TYPE*/
69 #define APPSVC_OPERATION_SEND                   "http://tizen.org/appcontrol/operation/send"
70 /** APP_SVC OPERATION TYPE*/
71 #define APPSVC_OPERATION_SEND_TEXT              "http://tizen.org/appcontrol/operation/send_text"
72 /** APP_SVC OPERATION TYPE*/
73 #define APPSVC_OPERATION_DIAL                   "http://tizen.org/appcontrol/operation/dial"
74 /** APP_SVC OPERATION TYPE*/
75 #define APPSVC_OPERATION_SEARCH                 "http://tizen.org/appcontrol/operation/search"
76 /** APP_SVC OPERATION TYPE*/
77 #define APPSVC_OPERATION_DOWNLOAD               "http://tizen.org/appcontrol/operation/download"
78
79
80 /** APP_SVC DATA SUBJECT*/
81 #define APPSVC_DATA_SUBJECT             "http://tizen.org/appcontrol/data/subject"
82 /** APP_SVC DATA TYPE*/
83 #define APPSVC_DATA_TO                  "http://tizen.org/appcontrol/data/to"
84 /** APP_SVC DATA TYPE*/
85 #define APPSVC_DATA_CC                  "http://tizen.org/appcontrol/data/cc"
86 /** APP_SVC DATA TYPE*/
87 #define APPSVC_DATA_BCC                 "http://tizen.org/appcontrol/data/bcc"
88 /** APP_SVC DATA TYPE*/
89 #define APPSVC_DATA_TEXT                "http://tizen.org/appcontrol/data/text"
90 /** APP_SVC DATA TYPE*/
91 #define APPSVC_DATA_TITLE               "http://tizen.org/appcontrol/data/title"
92 /** APP_SVC DATA TYPE*/
93 #define APPSVC_DATA_SELECTED            "http://tizen.org/appcontrol/data/selected"
94 /** APP_SVC DATA TYPE*/
95 #define APPSVC_DATA_KEYWORD             "http://tizen.org/appcontrol/data/keyword"
96
97 /** APP SVC internal private key */
98 #define APP_SVC_K_URI_R_INFO            "__APP_SVC_URI_R_INFO__"
99
100
101 /**
102  * @brief Return values in appsvc. 
103  */
104 typedef enum _appsvc_return_val {
105         APPSVC_RET_EILLACC = -5,                /**< Illegal Access */
106         APPSVC_RET_ELAUNCH = -4,                /**< Failure on launching the app */
107         APPSVC_RET_ENOMATCH = -3,               /**< No matching result Error */
108         APPSVC_RET_EINVAL = -2,                 /**< Invalid argument */
109         APPSVC_RET_ERROR = -1,                  /**< General error */
110         APPSVC_RET_OK = 0                       /**< General success */
111 }appsvc_return_val;
112
113
114 /**
115  * @brief result values in appsvc. 
116  */
117 typedef enum _appsvc_result_val {
118         APPSVC_RES_CANCEL = -2,         /**< Cancel by system */
119         APPSVC_RES_NOT_OK = -1,         /**< Fail by user */
120         APPSVC_RES_OK = 0               /**< Success by user */
121 }appsvc_result_val;
122
123
124 /** 
125  * @brief appsvc_res_fn is appsvc result function
126  * @param[out]  b               result bundle   
127  * @param[out]  request_code    request code
128  * @param[out]  result                  result value
129  * @param[out]  data            user-supplied data      
130 */
131 typedef void (*appsvc_res_fn)(bundle *b, int request_code, appsvc_result_val result, void *data);
132
133
134 /** 
135  * @brief iterator function running with appsvc_get_list 
136  * @param[out]  pkg_name        package name retreived by appsvc_get_list
137  * @param[out]  data            user-supplied data      
138 */
139 typedef int (*appsvc_info_iter_fn)(const char *appid, void *data);
140
141 typedef int (*appsvc_host_res_fn)(void *data);
142
143 /**
144  * @par Description:
145  * This function sets an operation to launch application based on appsvc.
146  *
147  * @param[in] b bundle object 
148  * @param[in] operation operation 
149  *
150  * @return 0 if success, negative value(<0) if fail
151  * @retval APPSVC_RET_OK - success
152  * @retval APPSVC_RET_ERROR - general error 
153  * @retval APPSVC_RET_EINVAL - invalid argument(content)
154  *
155  * @pre None.
156  * @post None.
157  * @see None.
158  * @remarks An application must call this function before using appsvc_run_service API. 
159  *
160  * @par Sample code:
161  * @code
162 #include <appsvc.h>
163
164 ...
165 {
166         bundle *b = NULL;
167
168         b = bundle_create();
169         
170         appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
171 }
172  * @endcode
173  *
174  */
175 int appsvc_set_operation(bundle *b, const char *operation);
176
177 /**
178  * @par Description:
179  * This function sets an uri to launch application based on appsvc.
180  *
181  * @param[in] b bundle object 
182  * @param[in] uri uri 
183  *
184  * @return 0 if success, negative value(<0) if fail
185  * @retval APPSVC_RET_OK - success
186  * @retval APPSVC_RET_ERROR - general error 
187  * @retval APPSVC_RET_EINVAL - invalid argument(content)
188  *
189  * @pre None.
190  * @post None.
191  * @see None.
192  * @remarks None. 
193  *
194  * @par Sample code:
195  * @code
196 #include <appsvc.h>
197
198 ...
199 {
200         bundle *b = NULL;
201
202         b = bundle_create();
203         
204         appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
205         appsvc_set_uri(b,"http://www.samsung.com");
206 }
207  * @endcode
208  *
209  */
210 int appsvc_set_uri(bundle *b, const char *uri);
211
212 /**
213  * @par Description:
214  * This function sets a mime-type to launch application based on appsvc.
215  *
216  * @param[in] b bundle object 
217  * @param[in] mime mime-type 
218  *
219  * @return 0 if success, negative value(<0) if fail
220  * @retval APPSVC_RET_OK - success
221  * @retval APPSVC_RET_ERROR - general error 
222  * @retval APPSVC_RET_EINVAL - invalid argument(content)
223  *
224  * @pre None.
225  * @post None.
226  * @see None.
227  * @remarks None. 
228  *
229  * @par Sample code:
230  * @code
231 #include <appsvc.h>
232
233 ...
234 {
235         bundle *b = NULL;
236
237         b = bundle_create();
238         
239         appsvc_set_operation(b, APPSVC_OPERATION_PICK);
240         appsvc_set_mime(b,"image/jpg");
241 }
242  * @endcode
243  *
244  */
245 int appsvc_set_mime(bundle *b, const char *mime);
246
247 /**
248  * @par Description:
249  * This function sets an extra data to launch application based on appsvc.
250  *
251  * @param[in] b bundle object 
252  * @param[in] key key of extra data 
253  * @param[in] val data 
254  *
255  * @return 0 if success, negative value(<0) if fail
256  *
257  * @pre None.
258  * @post None.
259  * @see None.
260  * @remarks None. 
261  *
262  * @par Sample code:
263  * @code
264 #include <appsvc.h>
265
266 ...
267 {
268         bundle *b = NULL;
269
270         b = bundle_create();
271         
272         appsvc_set_operation(b, APPSVC_OPERATION_SEND);
273         appsvc_set_uri(b,"mailto:xxx1@xxx");
274         appsvc_add_data(b,APPSVC_DATA_CC,"xxx2@xxx");
275 }
276  * @endcode
277  *
278  */
279 int appsvc_add_data(bundle *b, const char *key, const char *val);
280
281 /**
282  * @par Description:
283  * This function sets an extra array data to launch application based on appsvc.
284  *
285  * @param[in] b bundle object 
286  * @param[in] key key of extra data 
287  * @param[in] val_array data 
288  * @param[in] len Length of array
289  *
290  * @return 0 if success, negative value(<0) if fail
291  *
292  * @pre None.
293  * @post None.
294  * @see None.
295  * @remarks None. 
296  *
297  * @par Sample code:
298  * @code
299 #include <appsvc.h>
300
301 ...
302 {
303         bundle *b = NULL;
304         char *images[] = {"/opt/media/a.jpg", "/opt/media/b.jpg", "/opt/media/c.jpg"};
305
306         b = bundle_create();
307
308         appsvc_add_data_array(b, APPSVC_DATA_SELECTED, images, 3);
309 }
310  * @endcode
311  *
312  */
313 int appsvc_add_data_array(bundle *b, const char *key, const char **val_array, int len);
314
315
316 /**
317  * @par Description:
318  * This function sets a package name to launch application based on appsvc.
319  *
320  * @param[in] b bundle object 
321  * @param[in] pkg_name package name for explict launch
322  *
323  * @return 0 if success, negative value(<0) if fail
324  * @retval APPSVC_RET_OK - success
325  * @retval APPSVC_RET_ERROR - general error 
326  * @retval APPSVC_RET_EINVAL - invalid argument(content)
327  *
328  * @pre None.
329  * @post None.
330  * @see None.
331  * @remarks None. 
332  *
333  * @par Sample code:
334  * @code
335 #include <appsvc.h>
336
337 ...
338 {
339         bundle *b = NULL;
340
341         b = bundle_create();
342         
343         appsvc_set_operation(b, APPSVC_OPERATION_PICK);
344         appsvc_set_mime(b,"image/jpg");
345         appsvc_set_pkgname(b, "org.tizen.mygallery");
346 }
347  * @endcode
348  *
349  */
350 /* Deprecated API */
351 int appsvc_set_pkgname(bundle *b, const char *pkg_name); // __attribute__((deprecated));
352
353
354 /**
355  * @par Description:
356  * This function sets a appid to launch application based on appsvc.
357  *
358  * @param[in] b bundle object
359  * @param[in] appid application id for explict launch
360  *
361  * @return 0 if success, negative value(<0) if fail
362  * @retval APPSVC_RET_OK - success
363  * @retval APPSVC_RET_ERROR - general error
364  * @retval APPSVC_RET_EINVAL - invalid argument(content)
365  *
366  * @pre None.
367  * @post None.
368  * @see None.
369  * @remarks None.
370  *
371  * @par Sample code:
372  * @code
373 #include <appsvc.h>
374
375 ...
376 {
377         bundle *b = NULL;
378
379         b = bundle_create();
380
381         appsvc_set_operation(b, APPSVC_OPERATION_PICK);
382         appsvc_set_mime(b,"image/jpg");
383         appsvc_set_appid(b, "org.tizen.mygallery");
384 }
385  * @endcode
386  *
387  */
388 int appsvc_set_appid(bundle *b, const char *appid);
389
390
391 /**
392  * @par Description:
393  * This function sets a appid to launch application based on appsvc.
394  *
395  * @param[in] b bundle object
396  * @param[in] application category
397  *
398  * @return 0 if success, negative value(<0) if fail
399  * @retval APPSVC_RET_OK - success
400  * @retval APPSVC_RET_ERROR - general error
401  * @retval APPSVC_RET_EINVAL - invalid argument(content)
402  *
403  * @pre None.
404  * @post None.
405  * @see None.
406  * @remarks None.
407  *
408  * @par Sample code:
409  * @code
410 #include <appsvc.h>
411
412 ...
413 {
414         bundle *b = NULL;
415
416         b = bundle_create();
417
418         appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
419         appsvc_set_category(b, "http://tizen.org/category/app/browser");
420 }
421  * @endcode
422  *
423  */
424 int appsvc_set_category(bundle *b, const char *category);
425
426 /**
427  * @par Description:
428  * This API launch application based on appsvc.
429  *
430  * @param[in] b bundle to be passed to callee
431  * @param[in] request_code request code
432  * @param[in] cbfunc result callback function
433  * @param[in] data user-supplied data passed to callback function
434  *
435  * @return callee's pid if success, negative value(<0) if fail
436  * @retval callee's pid - success
437  * @retval APPSVC_RET_ERROR - general error 
438  * @retval APPSVC_RET_EINVAL - invalid argument(content)
439  * @retval APPSVC_RET_ENOMATCH - no matching result Error 
440  * @retval APPSVC_RET_ELAUNCH - failure on launching the app
441  *
442  * @pre None.
443  * @post None.
444  * @see None.
445  * @remarks None. 
446  *
447  * @par Sample code:
448  * @code
449 #include <appsvc.h>
450
451 ...
452 {
453         bundle *b = NULL;
454         static int num = 0;
455
456         b = bundle_create();
457         
458         appsvc_set_operation(b, APPSVC_OPERATION_PICK);
459         appsvc_set_mime(b,"image/jpg");
460
461         return appsvc_run_service(b, 0, cb_func, (void*)NULL);
462 }
463  * @endcode
464  *
465  */
466 int appsvc_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data);
467
468 /**
469  * @par Description:
470  * This API use to get application list that is matched with given bundle.
471  *
472  * @param[in] b bundle to resolve application
473  * @param[in] iter_fn iterator function
474  * @param[in] data user-supplied data for iter_fn
475  *
476  * @return 0 if success, negative value(<0) if fail
477  * @retval APPSVC_RET_OK - success
478  * @retval APPSVC_RET_EINVAL - invalid argument(content)
479  * @retval APPSVC_RET_ENOMATCH - no matching result Error 
480  *
481  * @pre None.
482  * @post None.
483  * @see None.
484  * @remarks None. 
485  *
486  * @par Sample code:
487  * @code
488 #include <appsvc.h>
489
490 static int iter_fn(const char* pkg_name, void *data)
491 {
492         printf("\t==========================\n");
493         printf("\t pkg_name: %s\n", pkg_name);
494         printf("\t==========================\n");
495         return 0;
496 }
497
498 ...
499 {
500         bundle *b = NULL;
501         static int num = 0;
502
503         b = bundle_create();
504         
505         appsvc_set_operation(b, APPSVC_OPERATION_PICK);
506         appsvc_set_mime(b,"image/jpg");
507
508         return appsvc_get_list(b, iter_fn, (void*)NULL);
509 }
510  * @endcode
511  *
512  */
513 int appsvc_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data);
514
515 /**
516  * @par Description:
517  * This function gets a operation from bundle.
518  *
519  * @param[in] b bundle object 
520  *
521  * @return Pointer for operation string if success, NULL if fail
522  *
523  * @pre None.
524  * @post None.
525  * @see None.
526  * @remarks None. 
527  *
528  * @par Sample code:
529  * @code
530 #include <appsvc.h>
531
532 ...
533 {
534         char *val;      
535         val = appsvc_get_operation(b);
536 }
537  * @endcode
538  *
539  */
540 const char *appsvc_get_operation(bundle *b);
541
542 /**
543  * @par Description:
544  * This function gets a uri from bundle.
545  *
546  * @param[in] b bundle object 
547  *
548  * @return Pointer for uri string if success, NULL if fail
549  *
550  * @pre None.
551  * @post None.
552  * @see None.
553  * @remarks None. 
554  *
555  * @par Sample code:
556  * @code
557 #include <appsvc.h>
558
559 ...
560 {
561         char *val;      
562         val = appsvc_get_uri(b);
563 }
564  * @endcode
565  *
566  */
567 const char *appsvc_get_uri(bundle *b);
568
569 /**
570  * @par Description:
571  * This function gets a mime-type from bundle.
572  *
573  * @param[in] b bundle object 
574  *
575  * @return Pointer for mime-type string if success, NULL if fail
576  *
577  * @pre None.
578  * @post None.
579  * @see None.
580  * @remarks None. 
581  *
582  * @par Sample code:
583  * @code
584 #include <appsvc.h>
585
586 ...
587 {
588         char *val;      
589         val = appsvc_get_mime(b);
590 }
591  * @endcode
592  *
593  */
594 const char *appsvc_get_mime(bundle *b);
595
596 /**
597  * @par Description:
598  * This function gets a package name from bundle.
599  *
600  * @param[in] b bundle object 
601  *
602  * @return Pointer for package name string if success, NULL if fail
603  *
604  * @pre None.
605  * @post None.
606  * @see None.
607  * @remarks None. 
608  *
609  * @par Sample code:
610  * @code
611 #include <appsvc.h>
612
613 ...
614 {
615         char *val;      
616         val = appsvc_get_pkgname(b);
617 }
618  * @endcode
619  *
620  */
621 /* Deprecated API */
622 const char *appsvc_get_pkgname(bundle *b); // __attribute__((deprecated));
623
624 /**
625  * @par Description:
626  * This function gets a application id from bundle.
627  *
628  * @param[in] b bundle object
629  *
630  * @return Pointer for application id string if success, NULL if fail
631  *
632  * @pre None.
633  * @post None.
634  * @see None.
635  * @remarks None.
636  *
637  * @par Sample code:
638  * @code
639 #include <appsvc.h>
640
641 ...
642 {
643         char *val;
644         val = appsvc_get_appid(b);
645 }
646  * @endcode
647  *
648  */
649 const char *appsvc_get_appid(bundle *b);
650
651 /**
652  * @par Description:
653  * This function gets a application category from bundle.
654  *
655  * @param[in] b bundle object
656  *
657  * @return Pointer for application category string if success, NULL if fail
658  *
659  * @pre None.
660  * @post None.
661  * @see None.
662  * @remarks None.
663  *
664  * @par Sample code:
665  * @code
666 #include <appsvc.h>
667
668 ...
669 {
670         char *val;
671         val = appsvc_get_category(b);
672 }
673  * @endcode
674  *
675  */
676 const char *appsvc_get_category(bundle *b);
677
678 /**
679  * @par Description:
680  * This function gets value from key.
681  *
682  * @param[in] b bundle object 
683  * @param[in] key key
684  *
685  * @return Pointer for value string if success, NULL if fail
686  *
687  * @pre None.
688  * @post None.
689  * @see None.
690  * @remarks None. 
691  *
692  * @par Sample code:
693  * @code
694 #include <appsvc.h>
695
696 ...
697 {
698         char *val;      
699         val = appsvc_get_data(b, APPSVC_DATA_CC);
700 }
701  * @endcode
702  *
703  */
704 const char *appsvc_get_data(bundle *b, const char *key);
705
706 /**
707  * @par Description:
708  * This function gets value from key.
709  *
710  * @param[in] b bundle object 
711  * @param[in] key key
712  * @param[out] len length of array
713  *
714  * @return Pointer for value string array if success, NULL if fail
715  *
716  * @pre None.
717  * @post None.
718  * @see None.
719  * @remarks None. 
720  *
721  * @par Sample code:
722  * @code
723 #include <appsvc.h>
724
725 ...
726 {
727         char **val_array;       
728         int len;
729         char *val;
730
731         if(appsvc_data_is_array(b, APPSVC_DATA_SELECTED))
732                 val_array = appsvc_get_data_array(b, APPSVC_DATA_SELECTED, &len);
733         else 
734                 val = appsvc_get_data(b, APPSVC_DATA_SELECTED);
735 }
736  * @endcode
737  *
738  */
739 const char **appsvc_get_data_array(bundle *b, const char *key, int *len);
740
741 /**
742  * @par Description:
743  * This API create appsvc result bundle based on bundle received in reset event.
744  *
745  * @param[in] inb bundle received in reset event 
746  * @param[in] outb bundle to use for returning result 
747  *
748  * @retval APPSVC_RET_OK - success
749  * @retval APPSVC_RET_ERROR - general error 
750  * @retval APPSVC_RET_EINVAL - invalid argument(content)
751  *
752  * @pre None.
753  * @post None.
754  * @see appsvc_send_result.
755  * @remarks None. 
756  *
757  * @par Sample code:
758  * @code
759 #include <appsvc.h>
760
761 ...
762 {
763         struct appdata *ad = data;
764         bundle* res_bundle;
765         
766         appsvc_create_result_bundle(ad->b,&res_bundle);
767         bundle_add(res_bundle, "result", "1");
768         appsvc_send_result(res_bundle, 0);
769 }
770  * @endcode
771  *
772  */
773 int appsvc_create_result_bundle(bundle *inb, bundle **outb);
774
775 /**
776  * @par Description:
777  * This API send appsvc result to caller with bundle.
778  *
779  * @param[in] b Result data in bundle format
780  * @param[in] result result value
781  *
782  * @retval APPSVC_RET_OK - success
783  * @retval APPSVC_RET_ERROR - general error 
784  * @retval APPSVC_RET_EINVAL - invalid argument(content)
785  *
786  * @pre appsvc_create_result_bundle.
787  * @post None.
788  * @see appsvc_send_result.
789  * @remarks None. 
790  *
791  * @par Sample code:
792  * @code
793 #include <appsvc.h>
794
795 ...
796 {
797         struct appdata *ad = data;
798         bundle* res_bundle;
799         
800         appsvc_create_result_bundle(ad->b,&res_bundle);
801         bundle_add(res_bundle, "result", "1");
802         appsvc_send_result(res_bundle, 0);
803 }
804  * @endcode
805  *
806  */
807 int appsvc_send_result(bundle *b, appsvc_result_val result);
808
809 /**
810  * @par Description:
811  * This API set the default application(package name) associated with op, uri and mime-type.
812  *
813  * @param[in] op                operation
814  * @param[in] mime_type mime-type
815  * @param[in] scheme    scheme of uri
816  * @param[in] defapp    default application
817  *
818  * @retval APPSVC_RET_OK - success
819  * @retval APPSVC_RET_ERROR - general error 
820  * @retval APPSVC_RET_EINVAL - invalid argument(content)
821  *
822  * @pre None.
823  * @post None.
824  * @see None.
825  * @remarks None. 
826  *
827  * @par Sample code:
828  * @code
829 #include <appsvc.h>
830
831 ...
832 {
833         appsvc_set_defapp(APPSVC_OPERATION_VIEW, NULL,"http", "org.tizen.mybrowser");
834 }
835  * @endcode
836  *
837  */
838 int appsvc_set_defapp(const char *op, const char *mime_type, const char *uri,
839                                 const char *defapp);
840
841 /**
842  * @par Description:
843  * This API unset the default application(package name) associated with op, uri and mime-type.
844  *
845  * @param[in] defapp    default application
846  *
847  * @retval APPSVC_RET_OK - success
848  * @retval APPSVC_RET_ERROR - general error 
849  *
850  * @pre None.
851  * @post None.
852  * @see None.
853  * @remarks None. 
854  *
855  * @par Sample code:
856  * @code
857 #include <appsvc.h>
858
859 ...
860 {
861         appsvc_unset_defapp("org.tizen.test");
862 }
863  * @endcode
864  *
865  */
866 int appsvc_unset_defapp(const char *defapp);
867
868 /**
869  * @par Description:
870  *      This API ask a application is default application or not.
871  *
872  * @param[in]   pkg_name        application package name
873  * @return      true / false
874  * @retval      1       app_name is default application in appsvc.
875  * @retval      0       app_name is NOT default application in appsvc.
876  *
877   * @pre None.
878   * @post None.
879   * @see None.
880   * @remarks None. 
881   *
882   * @par Sample code:
883   * @code
884 #include <appsvc.h>
885  
886  ...
887
888  * int is_defapp_browser_app()
889  * { 
890  *      return appsvc_is_defapp("org.tizen.browser");
891  * }
892  *
893  * @endcode
894  * @remark
895  *      None
896
897 */
898 int appsvc_is_defapp(const char *appid);
899
900
901 /**
902  * @par Description:
903  *      This API ask a extra data is array or not.
904  *
905  * @param[in] b bundle object 
906  * @param[in] key key of extra data 
907  * @return      true / false
908  * @retval      1       a extra data is array.
909  * @retval      0       a extra data is not array.
910  *
911   * @pre None.
912   * @post None.
913   * @see None.
914   * @remarks None. 
915   *
916   * @par Sample code:
917   * @code
918 #include <appsvc.h>
919  
920  ...
921
922  * int is_defapp_browser_app(bundle *b, char *key)
923  * { 
924  *      return appsvc_data_is_array(b, key);
925  * }
926  *
927  * @endcode
928  * @remark
929  *      None
930
931 */
932 int appsvc_data_is_array(bundle *b, const char *key);
933
934
935 #ifdef __cplusplus
936         }
937 #endif
938
939 /**
940  * @}
941  */
942 /**
943  * @}
944  */
945
946
947 #endif          /* __APP_SVC_H__ */
948
949 /* vi: set ts=8 sts=8 sw=8: */