Add APIs for attaching and detaching window 24/122524/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 31 Mar 2017 05:03:41 +0000 (14:03 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Mon, 3 Apr 2017 02:17:32 +0000 (19:17 -0700)
Requires:
 - https://review.tizen.org/gerrit/#/c/120646/
 - https://review.tizen.org/gerrit/#/c/120647/

Change-Id: I57eb261395c98a0dc3644dc00570753c6d90a619
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
(cherry picked from commit ecccf52b112e975f1867b8fe55ed7c2bf697577e)

include/app_manager_extension.h
src/app_manager.c

index c77e354349fcc9ef2fe671711808bccad7cf1b06..2abe3e521a9e563bf7aa8afc755090b891a21550 100644 (file)
@@ -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);
+
 /**
  * @}
  */
index b90d6782f24db0b2cb0c3fb0fc46ae33c6a9ded7..b26239cb9aec7dfd07635fff668dba84450c91f9 100644 (file)
@@ -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;
+}