Add APIs for attaching and detaching window 98/122298/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 31 Mar 2017 05:03:41 +0000 (14:03 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 31 Mar 2017 05:08:38 +0000 (14:08 +0900)
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>
include/app_manager_extension.h
src/app_manager.c

index c77e354..2abe3e5 100644 (file)
@@ -138,6 +138,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 fa9cc01..335fe7e 100644 (file)
@@ -590,3 +590,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;
+}