Support launch reqeust async API
[platform/core/appfw/aul-1.git] / include / aul_svc.h
index 7818a53..d2a0239 100755 (executable)
@@ -154,6 +154,14 @@ typedef enum _aul_svc_result_val {
 */
 typedef void (*aul_svc_res_fn)(bundle *b, int request_code, aul_svc_result_val result, void *data);
 
+/**
+ * @brief Called when the result of the launch request is delivered.
+ *
+ * @param[in]   request_code    The request code
+ * @param[in]   result          The result, the process ID of the callee on success otherwise a negative error value
+ * @param[in]   user_data       The user data passed from the callback registration function
+ */
+typedef void (*aul_svc_err_cb)(int request_code, int result, void *user_data);
 
 /**
  * @brief iterator function running with aul_svc_get_list
@@ -1292,6 +1300,40 @@ int aul_svc_run_service_async(bundle *b, int request_code,
 int aul_svc_run_service_async_for_uid(bundle *b, int request_code,
                aul_svc_res_fn cbfunc, void *data, uid_t uid);
 
+
+/**
+ * @brief Sends the launch request asynchronous.
+ *
+ * @param[in]   b               The bundle object
+ * @param[in]   request_code    The request code
+ * @param[in]   cbfunc          The reply callback function
+ * @param[in]   err_cb          The result callback function
+ * @param[in]   user_data       The user data to be passed to the callback function
+ *
+ * @return      a pid of the callee on success,
+ *              otherwise a negative error value
+ */
+int aul_svc_send_launch_request(bundle *b, int request_code,
+               aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb,
+               void *user_data);
+
+/**
+ * @brief Sends the launch request asynchronous.
+ *
+ * @param[in]   b               The bundle object
+ * @param[in]   request_code    The request code
+ * @param[in]   cbfunc          The reply callback function
+ * @param[in]   err_cb          The result callback function
+ * @param[in]   user_data       The user data to be passed to the callback function
+ * @param[in]   uid             The user ID
+ *
+ * @return      a pid of the callee on success,
+ *              otherwise a negative error value
+ */
+int aul_svc_send_launch_request_for_uid(bundle *b, int request_code,
+               aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb,
+               void *user_data, uid_t uid);
+
 #ifdef __cplusplus
 }
 #endif