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