2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __TIZEN_APPFW_SERVICE_H__
19 #define __TIZEN_APPFW_SERVICE_H__
21 #include <sys/types.h>
29 * @addtogroup CAPI_SERVICE_MODULE
34 typedef struct _bundle_t bundle;
38 * @brief Service handle.
40 typedef struct service_s *service_h;
44 * @brief Enumerations of error code for Service.
48 SERVICE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
49 SERVICE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
50 SERVICE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
51 SERVICE_ERROR_APP_NOT_FOUND = TIZEN_ERROR_APPLICATION_CLASS | 0x21, /**< The application was not found */
52 SERVICE_ERROR_KEY_NOT_FOUND = TIZEN_ERROR_KEY_NOT_AVAILABLE, /**< Specified key not found */
53 SERVICE_ERROR_KEY_REJECTED = TIZEN_ERROR_KEY_REJECTED, /**< Not available key */
54 SERVICE_ERROR_INVALID_DATA_TYPE = TIZEN_ERROR_APPLICATION_CLASS | 0x22, /**< Invalid data type */
55 SERVICE_ERROR_LAUNCH_REJECTED = TIZEN_ERROR_UNKNOWN, /**< Internal launch error*/
60 * @brief Enumeration of service result.
64 SERVICE_RESULT_SUCCEEDED = 0, /**< Operation succeeded */
65 SERVICE_RESULT_FAILED = -1, /**< Operation failed by the callee */
66 SERVICE_RESULT_CANCELED = -2, /**< Operation canceled by the framework */
71 * @brief Service operation : default operation for explicit launch
73 #define SERVICE_OPERATION_DEFAULT "http://tizen.org/appcontrol/operation/default"
77 * @brief Service operation : provide explicit editable access to the given data.
79 #define SERVICE_OPERATION_EDIT "http://tizen.org/appcontrol/operation/edit"
83 * @brief Service operation : display the data.
85 #define SERVICE_OPERATION_VIEW "http://tizen.org/appcontrol/operation/view"
89 * @brief Service operation : pick an item from the data, returning what was selected.
91 #define SERVICE_OPERATION_PICK "http://tizen.org/appcontrol/operation/pick"
95 * @brief Service operation : create a content, returning what was created.
97 #define SERVICE_OPERATION_CREATE_CONTENT "http://tizen.org/appcontrol/operation/create_content"
101 * @brief Service operation : perform a call to someone specified by the data.
103 #define SERVICE_OPERATION_CALL "http://tizen.org/appcontrol/operation/call"
107 * @brief Service operation : deliver some data to someone else.
109 #define SERVICE_OPERATION_SEND "http://tizen.org/appcontrol/operation/send"
113 * @brief Service operation : deliver text data to someone else.
115 #define SERVICE_OPERATION_SEND_TEXT "http://tizen.org/appcontrol/operation/send_text"
119 * @brief Service operation : share a item to someone else.
121 #define SERVICE_OPERATION_SHARE "http://tizen.org/appcontrol/operation/share"
125 * @brief Service operation : share multiple items to someone else.
127 #define SERVICE_OPERATION_MULTI_SHARE "http://tizen.org/appcontrol/operation/multi_share"
131 * @brief Service operation : share text data to someone else.
133 #define SERVICE_OPERATION_SHARE_TEXT "http://tizen.org/appcontrol/operation/share_text"
137 * @brief Service operation : dial a number as specified by the data.
139 #define SERVICE_OPERATION_DIAL "http://tizen.org/appcontrol/operation/dial"
143 * @brief Service operation : perform a search.
145 #define SERVICE_OPERATION_SEARCH "http://tizen.org/appcontrol/operation/search"
149 * @brief Service operation : download a item.
151 #define SERVICE_OPERATION_DOWNLOAD "http://tizen.org/appcontrol/operation/download"
155 * @brief Service operation : print content.
157 #define SERVICE_OPERATION_PRINT "http://tizen.org/appcontrol/operation/print"
160 * @brief Service operation : compose.
162 #define SERVICE_OPERATION_COMPOSE "http://tizen.org/appcontrol/operation/compose"
165 * @brief Service optional data : the subject of a message.
167 #define SERVICE_DATA_SUBJECT "http://tizen.org/appcontrol/data/subject"
171 * @brief Service optional data : e-mail addresses.
173 #define SERVICE_DATA_TO "http://tizen.org/appcontrol/data/to"
177 * @brief Service optional data : e-mail addresses that should be carbon copied.
179 #define SERVICE_DATA_CC "http://tizen.org/appcontrol/data/cc"
183 * @brief Service optional data : e-mail addresses that should be blind carbon copied.
185 #define SERVICE_DATA_BCC "http://tizen.org/appcontrol/data/bcc"
189 * @brief Service optional data : the content of the data is associated with #SERVICE_OPERATION_SEND.
191 #define SERVICE_DATA_TEXT "http://tizen.org/appcontrol/data/text"
195 * @brief Service optional data : the title of the data
197 #define SERVICE_DATA_TITLE "http://tizen.org/appcontrol/data/title"
201 * @brief Service optional data : the path of selected item.
203 #define SERVICE_DATA_SELECTED "http://tizen.org/appcontrol/data/selected"
207 * @brief Service optional data : multiple item path to deliver.
209 #define SERVICE_DATA_PATH "http://tizen.org/appcontrol/data/path"
213 * @brief Called when the reply of the launch request is delivered.
215 * @remarks The @a request and @a reply must not be deallocated by an application.
217 * @param [in] request The service handle of the launch request that has sent
218 * @param [in] reply The service handle in which the results of the callee are contained
219 * @param [in] result The result code of the launch request
220 * @param [in] user_data The user data passed from the callback registration function
221 * @pre When the callee replies to the launch request, this callback will be invoked.
222 * @see service_send_launch_request()
223 * @see service_reply_to_launch_request()
225 typedef void (*service_reply_cb) (service_h request, service_h reply, service_result_e result, void *user_data);
229 * @brief Called to retrieve the extra data that are contained in the service
231 * @remarks The @a key must not be deallocated by an application.
233 * @param[in] service The service handle
234 * @param[in] key The key of the value contained in the service
235 * @param[in] user_data The user data passed from the foreach function
236 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.
237 * @pre service_foreach_extra_data() will invoke this callback.
238 * @see service_foreach_extra_data()
240 typedef bool (*service_extra_data_cb)(service_h service, const char *key, void *user_data);
244 * @brief Called once for each matched application that can be launched to handle the given service request.
246 * @param [in] service The service handle
247 * @param [in] package The package name of the application that can handle the launch request of the given service.
248 * @param [in] user_data The user data passed from the foreach function
249 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.
250 * @pre service_foreach_app_matched() will invoke this callback.
251 * @see service_foreach_app_matched()
253 typedef bool (*service_app_matched_cb)(service_h service, const char *appid, void *user_data);
257 * @brief Creates a service handle.
259 * @remarks The @a service must be released with service_destroy() by you.
260 * @param [out] service A service handle to be newly created on success
261 * @return 0 on success, otherwise a negative error value.
262 * @retval #SERVICE_ERROR_NONE Successful
263 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
264 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
265 * @see service_destroy()
267 int service_create(service_h *service);
271 * @brief Destroys the service handle and releases all its resources.
273 * @param [in] service The service handle
274 * @return 0 on success, otherwise a negative error value.
275 * @retval #SERVICE_ERROR_NONE Successful
276 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
277 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
278 * @see service_create()
280 int service_destroy(service_h service);
284 * @brief Converts the service handle to bundle data.
286 * @param [in] service The service handle
287 * @param [out] data a bundle data on success
288 * @return 0 on success, otherwise a negative error value.
289 * @retval #SERVICE_ERROR_NONE Successful
290 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
292 int service_to_bundle(service_h service, bundle **data);
295 * @brief Sets the operation to be performed.
297 * @details The @a operation is the mandatory information for the launch request.
298 * If the operation is not specified, #SERVICE_OPERATION_DEFAULT is used for the launch request.
299 * If the operation is #SERVICE_OPERATION_DEFAULT, the package information is mandatory to explicitly launch the application
300 * @param [in] service The service handle
301 * @param [in] operation The operation to be performed \n
302 * If the @a operation is NULL, it clears the previous value.
303 * @return 0 on success, otherwise a negative error value.
304 * @retval #SERVICE_ERROR_NONE Successful
305 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
306 * @see service_get_operation()
307 * @see SERVICE_OPERATION_DEFAULT
308 * @see SERVICE_OPERATION_EDIT
309 * @see SERVICE_OPERATION_VIEW
310 * @see SERVICE_OPERATION_PICK
311 * @see SERVICE_OPERATION_CREATE_CONTENT
312 * @see SERVICE_OPERATION_CALL
313 * @see SERVICE_OPERATION_SEND
314 * @see SERVICE_OPERATION_SEND_TEXT
315 * @see SERVICE_OPERATION_DIAL
316 * @see SERVICE_OPERATION_SEARCH
318 int service_set_operation(service_h service, const char *operation);
322 * @brief Gets the operation to be performed.
324 * @remarks The @a operation must be released with free() by you.
325 * @param [in] service The service handle
326 * @param [out] operation The operation to be performed
327 * @return 0 on success, otherwise a negative error value.
328 * @retval #SERVICE_ERROR_NONE Successful
329 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
330 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
331 * @see service_set_operation()
333 int service_get_operation(service_h service, char **operation);
337 * @brief Sets the URI of the data.
339 * @param [in] service The service handle
340 * @param [in] uri The URI of the data this service is operating on \n
341 * If the @a uri is NULL, it clears the previous value.
342 * @return 0 on success, otherwise a negative error value.
343 * @retval #SERVICE_ERROR_NONE Successful
344 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
345 * @see service_get_uri()
347 int service_set_uri(service_h service, const char *uri);
351 * @brief Gets the URI of the data.
353 * @remarks The @a uri must be released with free() by you.
354 * @param [in] service The service handle
355 * @param [out] uri The URI of the data this service is operating on
356 * @return 0 on success, otherwise a negative error value.
357 * @retval #SERVICE_ERROR_NONE Successful
358 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
359 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
360 * @see service_set_uri()
362 int service_get_uri(service_h service, char **uri);
366 * @brief Sets the explicit MIME type of the data
368 * @param [in] service The service handle
369 * @param [in] mime the explicit MIME type of the data this service is operating on \n
370 * If the @a mime is NULL, it clears the previous value.
371 * @return 0 on success, otherwise a negative error value.
372 * @retval #SERVICE_ERROR_NONE Successful
373 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
374 * @see service_get_mime()
376 int service_set_mime(service_h service, const char *mime);
380 * @brief Gets the explicit MIME type of the data.
382 * @remarks The @a uri must be released with free() by you.
383 * @param [in] service The service handle
384 * @param [out] mime The explicit MIME type of the data this service is operating on
385 * @return 0 on success, otherwise a negative error value.
386 * @retval #SERVICE_ERROR_NONE Successful
387 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
388 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
389 * @see service_set_mime()
391 int service_get_mime(service_h service, char **mime);
395 * @brief Sets the explicit category
397 * @param [in] service The service handle
398 * @param [in] category the explicit category
399 * If the @a category is NULL, it clears the previous value.
400 * @return 0 on success, otherwise a negative error value.
401 * @retval #SERVICE_ERROR_NONE Successful
402 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
403 * @see service_get_category()
405 int service_set_category(service_h service, const char *category);
409 * @brief Gets the explicit category
411 * @remarks The @a category must be released with free() by you.
412 * @param [in] service The service handle
413 * @param [out] category The explicit category
414 * @return 0 on success, otherwise a negative error value.
415 * @retval #SERVICE_ERROR_NONE Successful
416 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
417 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
418 * @see service_set_category()
420 int service_get_category(service_h service, char **category);
424 * @brief Sets the package name of the application to explicitly launch
426 * @remark This function is @b deprecated. Use service_set_app_id() instead.
427 * @param [in] service The service handle
428 * @param [in] package The package name of the application to explicitly launch \n
429 * If the @a package is NULL, it clears the previous value.
430 * @return 0 on success, otherwise a negative error value.
431 * @retval #SERVICE_ERROR_NONE Successful
432 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
433 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
434 * @see service_get_package()
437 int service_set_package(service_h service, const char *package); // __attribute__((deprecated));
441 * @brief Gets the package name of the application to explicitly launch
443 * @remark This function is @b deprecated. Use service_get_app_id() instead.
444 * @remarks The @a package must be released with free() by you.
445 * @param [in] service The service handle
446 * @param [out] package The package name of the application to explicitly launch
447 * @return 0 on success, otherwise a negative error value.
448 * @retval #SERVICE_ERROR_NONE Successful
449 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
450 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
451 * @see service_set_package()
454 int service_get_package(service_h service, char **package); // __attribute__((deprecated));
458 * @brief Sets the ID of the application to explicitly launch
460 * @param [in] service The service handle
461 * @param [in] app_id The ID of the application to explicitly launch \n
462 * If the @a app_id is NULL, it clears the previous value.
463 * @return 0 on success, otherwise a negative error value.
464 * @retval #SERVICE_ERROR_NONE Successful
465 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
466 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
467 * @see service_get_app_id()
469 int service_set_app_id(service_h service, const char *app_id);
473 * @brief Gets the ID of the application to explicitly launch
475 * @remarks The @a app_id must be released with free() by you.
476 * @param [in] service The service handle
477 * @param [out] app_id The ID of the application to explicitly launch
478 * @return 0 on success, otherwise a negative error value.
479 * @retval #SERVICE_ERROR_NONE Successful
480 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
481 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
482 * @see service_set_app_id()
484 int service_get_app_id(service_h service, char **app_id);
487 * @brief Sets the window id of the application
489 * @param [in] service The service handle
490 * @param [in] id the window id of caller application \n
491 * If the @a id is not positive, it clears the previous value.
492 * @return 0 on success, otherwise a negative error value.
493 * @retval #SERVICE_ERROR_NONE Successful
494 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
495 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
496 * @see service_get_window()
498 int service_set_window(service_h service, unsigned int id);
502 * @brief Gets the window id of the application
504 * @param [in] service The service handle
505 * @param [out] id The window id of caller application
506 * @return 0 on success, otherwise a negative error value.
507 * @retval #SERVICE_ERROR_NONE Successful
508 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
509 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
510 * @see service_set_app_id()
512 int service_get_window(service_h service, unsigned int *id);
516 * @brief Adds the extra data to the service.
518 * @remarks The function replaces any existing value for the given key.
519 * @remarks The function returns #SERVICE_ERROR_INVALID_PARAMETER if key or value is zero-length string.
520 * @remarks The function returns #SERVICE_ERROR_KEY_REJECTED if the application tries to use same key with system-defined key
521 * @param [in] service The service handle
522 * @param [in] key The name of the extra data
523 * @param [in] value The value associated with given key
524 * @return 0 on success, otherwise a negative error value.
525 * @retval #SERVICE_ERROR_NONE Successful
526 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
527 * @retval #SERVICE_ERROR_KEY_REJECTED Not available key
528 * @see service_add_extra_data_array()
529 * @see service_remove_extra_data()
530 * @see service_get_extra_data()
532 int service_add_extra_data(service_h service, const char *key, const char *value);
536 * @brief Adds the extra data array to the service.
538 * @remarks The function replaces any existing value for the given key.
539 * @remarks The function returns #SERVICE_ERROR_INVALID_PARAMETER if key is zero-length string.
540 * @remarks The function returns #SERVICE_ERROR_KEY_REJECTED if the application tries to use same key with system-defined key
541 * @param [in] service The service handle
542 * @param [in] key The name of the extra data
543 * @param [in] value The array value associated with given key
544 * @param [in] length The length of the array
545 * @return 0 on success, otherwise a negative error value.
546 * @retval #SERVICE_ERROR_NONE Successful
547 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
548 * @retval #SERVICE_ERROR_KEY_REJECTED Not available key
549 * @see service_add_extra_data()
550 * @see service_remove_extra_data()
551 * @see service_get_extra_data()
553 int service_add_extra_data_array(service_h service, const char *key, const char* value[], int length);
557 * @brief Removes the extra data from the service.
559 * @param [in] service The service handle
560 * @param [in] key The name of the extra data
561 * @return 0 on success, otherwise a negative error value.
562 * @retval #SERVICE_ERROR_NONE Successful
563 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
564 * @retval #SERVICE_ERROR_KEY_NOT_FOUND Specified key not found
565 * @see service_add_extra_data()
566 * @see service_add_extra_data_array()
567 * @see service_get_extra_data()
569 int service_remove_extra_data(service_h service, const char *key);
573 * @brief Gets the extra data from the service.
575 * @remarks The @a value must be released with free() by you.
576 * @remarks The function returns #SERVICE_ERROR_INVALID_DATA_TYPE if the value is array data type.
577 * @param [in] service The service handle
578 * @param [int] key The name of the extra data
579 * @param [out] value The value associated with given key
580 * @return 0 on success, otherwise a negative error value.
581 * @retval #SERVICE_ERROR_NONE Successful
582 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
583 * @retval #SERVICE_ERROR_KEY_NOT_FOUND Specified key not found
584 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
585 * @retval #SERVICE_ERROR_INVALID_DATA_TYPE Invalid data type
586 * @see service_add_extra_data()
587 * @see service_add_extra_data_array()
588 * @see service_get_extra_data()
589 * @see service_remove_extra_data()
590 * @see service_foreach_extra_data()
592 int service_get_extra_data(service_h service, const char *key, char **value);
596 * @brief Gets the extra data array from the service.
598 * @remarks The @a value must be released with free() by you.
599 * @remarks The function returns #SERVICE_ERROR_INVALID_DATA_TYPE if the value is not array data type.
600 * @param [in] service The service handle
601 * @param [int] key The name of the extra data
602 * @param [out] value The array value associated with given key
603 * @param [out] length The length of the array
604 * @return 0 on success, otherwise a negative error value.
605 * @retval #SERVICE_ERROR_NONE Successful
606 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
607 * @retval #SERVICE_ERROR_KEY_NOT_FOUND Specified key not found
608 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
609 * @retval #SERVICE_ERROR_INVALID_DATA_TYPE Invalid data type
610 * @see service_add_extra_data()
611 * @see service_add_extra_data_array()
612 * @see service_remove_extra_data()
613 * @see service_foreach_extra_data()
615 int service_get_extra_data_array(service_h service, const char *key, char ***value, int *length);
619 * @brief Checks whether if the extra data associated with given @a key is array data type.
621 * @param [in] service The service handle
622 * @param [int] key The name of the extra data
623 * @param [out] array @c True if the extra data is array data type, otherwise @c false
624 * @return 0 on success, otherwise a negative error value.
625 * @retval #SERVICE_ERROR_NONE Successful
626 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
627 * @see service_add_extra_data()
628 * @see service_add_extra_data_array()
629 * @see service_remove_extra_data()
630 * @see service_foreach_extra_data()
632 int service_is_extra_data_array(service_h service, const char *key, bool *array);
636 * @brief Retrieves all extra data contained in service.
637 * @details This function calls service_extra_data_cb() once for each key-value pair for extra data contained in service. \n
638 * If service_extra_data_cb() callback function returns false, then iteration will be finished.
640 * @param [in] service The service handle
641 * @param [in] callback The iteration callback function
642 * @param [in] user_data The user data to be passed to the callback function
643 * @return 0 on success, otherwise a negative error value.
644 * @retval #SERVICE_ERROR_NONE Successful
645 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
646 * @post This function invokes service_extra_data_cb().
647 * @see service_extra_data_cb()
649 int service_foreach_extra_data(service_h service, service_extra_data_cb callback, void *user_data);
653 * @brief Retrieves all applications that can be launched to handle the given service request.
655 * @param [in] service The service handle
656 * @param [in] callback The iteration callback function
657 * @param [in] user_data The user data to be passed to the callback function
658 * @return 0 on success, otherwise a negative error value.
659 * @retval #SERVICE_ERROR_NONE Success
660 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
661 * @post This function invokes service_app_matched_cb().
662 * @see service_app_matched_cb()
664 int service_foreach_app_matched(service_h service, service_app_matched_cb callback, void *user_data);
668 * @brief Sends the launch request.
670 * @details The operation is mandatory information for the launch request. \n
671 * If the operation is not specified, #SERVICE_OPERATION_DEFAULT is used by default.
672 * If the operation is #SERVICE_OPERATION_DEFAULT, the application ID is mandatory to explicitly launch the application
673 * @param [in] service The service handle
674 * @param [in] callback The callback function to be called when the reply is delivered
675 * @param [in] user_data The user data to be passed to the callback function
676 * @return 0 on success, otherwise a negative error value.
677 * @retval #SERVICE_ERROR_NONE Successful
678 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
679 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
680 * @retval #SERVICE_ERROR_APP_NOT_FOUND The application was not found to run the given launch request
681 * @retval #SERVICE_ERROR_LAUNCH_REJECTED The application launch is rejected due to timeout, continuous launch request while launching and application hang
682 * @post If the launch request is sent for the result, the result will come back through service_reply_cb() from the callee application
683 * @see service_reply_to_launch_request()
684 * @see service_reply_cb()
686 int service_send_launch_request(service_h service, service_reply_cb callback, void *user_data);
690 * @brief Replies to the launch request that the caller sent
691 * @details If the caller application sent the launch request to receive the result, the callee application can return the result back to the caller.
693 * @param [in] reply The service handle in which the results of the callee are contained
694 * @param [in] request The service handle that the caller sent
695 * @param [in] result The result code of the launch request
696 * @return 0 on success, otherwise a negative error value.
697 * @retval #SERVICE_ERROR_NONE Successful
698 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
699 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
700 * @see service_send_launch_request()
702 int service_reply_to_launch_request(service_h reply, service_h request, service_result_e result);
706 * @brief Creates and returns a copy of the given service handle.
708 * @remarks A newly created service should be destroyed by calling service_destroy() if it is no longer needed.
710 * @param [out] clone If successful, a newly created service handle will be returned.
711 * @param [in] service The service handle
712 * @return 0 on success, otherwise a negative error value.
713 * @retval #SERVICE_ERROR_NONE Successful
714 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
715 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
716 * @see service_destroy()
718 int service_clone(service_h *clone, service_h service);
722 * @brief Gets the application ID of the caller from the launch request
724 * @remarks The @a service must be the launch reqeust from app_service_cb().
725 * @remarks This function returns #SERVICE_ERROR_INVALID_PARAMETER if the given service is not the launch request.
726 * @remarks The @a id must be released with free() by you.
727 * @param [in] service The service handle from app_service_cb()
728 * @param [out] id The application ID of the caller
729 * @return 0 on success, otherwise a negative error value.
730 * @retval #SERVICE_ERROR_NONE Successful
731 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
732 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
734 int service_get_caller(service_h service, char **id);
738 * @brief Check whether the caller is requesting a reply from the launch reqeust
740 * @remarks The @a service must be the launch reqeust from app_service_cb().
741 * @remarks This function returns #SERVICE_ERROR_INVALID_PARAMETER if the given service is not the launch request.
742 * @param [in] service The service handle from app_service_cb()
743 * @param [out] requested whether a reply is requested by the caller
744 * @return 0 on success, otherwise a negative error value.
745 * @retval #SERVICE_ERROR_NONE Successful
746 * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
747 * @retval #SERVICE_ERROR_OUT_OF_MEMORY Out of memory
749 int service_is_reply_requested(service_h service, bool *requested);
759 #endif /* __TIZEN_APPFW_SERVICE_H__ */