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