From: Hwankyu Jhun Date: Fri, 31 Mar 2017 05:03:41 +0000 (+0900) Subject: Add APIs for attaching and detaching window X-Git-Tag: submit/tizen_3.0/20170403.055543~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4424dc03747bfd9ad1dee7175aa44d8c4af3966c;p=platform%2Fcore%2Fapi%2Fapp-manager.git Add APIs for attaching and detaching window Requires: - https://review.tizen.org/gerrit/#/c/120646/ - https://review.tizen.org/gerrit/#/c/120647/ Change-Id: I57eb261395c98a0dc3644dc00570753c6d90a619 Signed-off-by: Hwankyu Jhun (cherry picked from commit ecccf52b112e975f1867b8fe55ed7c2bf697577e) --- diff --git a/include/app_manager_extension.h b/include/app_manager_extension.h index c77e354..2abe3e5 100644 --- a/include/app_manager_extension.h +++ b/include/app_manager_extension.h @@ -137,6 +137,35 @@ int app_manager_get_app_context_by_instance_id(const char *app_id, const char *i */ int app_manager_get_focused_app_context(app_context_h *app_context); +/** + * @brief Attaches the window of the child application to the window of the parent application. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/internal/default/platform + * @param[in] parent_app_id The ID of the parent application + * @param[in] child_app_id The ID of the child applicatio + * @return @c 0 on success, + * otherwise a negative error value + * @retval #APP_MANAGER_ERROR_NONE Successful + * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #APP_MANAGER_ERROR_IO_ERROR Internal I/O error + */ +int app_manager_attach_window(const char *parent_app_id, const char *child_app_id); + +/** + * @brief Detaches the window of the application from its parent window. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/internal/default/platform + * @param[in] app_id The ID of the application + * @return @c 0 on success, + * otherwise a negative error value + * @retval #APP_MANAGER_ERROR_NONE Successful + * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #APP_MANAGER_ERROR_IO_ERROR Internal I/O error + */ +int app_manager_detach_window(const char *app_id); + /** * @} */ diff --git a/src/app_manager.c b/src/app_manager.c index b90d678..b26239c 100644 --- a/src/app_manager.c +++ b/src/app_manager.c @@ -591,3 +591,31 @@ API int app_manager_get_focused_app_context(app_context_h *app_context) return APP_MANAGER_ERROR_NONE; } + +API int app_manager_attach_window(const char *parent_app_id, const char *child_app_id) +{ + int ret; + + if (parent_app_id == NULL || child_app_id == NULL) + return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + + ret = aul_window_attach(parent_app_id, child_app_id); + if (ret != 0) + return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); + + return APP_MANAGER_ERROR_NONE; +} + +API int app_manager_detach_window(const char *app_id) +{ + int ret; + + if (app_id == NULL) + return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + + ret = aul_window_detach(app_id); + if (ret != 0) + return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); + + return APP_MANAGER_ERROR_NONE; +}