Return "single" launch mode with default
[platform/core/api/application.git] / include / app_control_internal.h
index 3daa86b..26f4217 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -35,6 +35,34 @@ extern "C" {
  */
 
 /**
+ * @brief Definition for app_control data: Connect the previous app with the next app when the sub-app is terminated.
+ * @details If a sub-app is terminated, framework will connect the previous app with the next app.
+ *          By default, this flag is 'false'
+ */
+#define APP_CONTROL_DATA_REROUTE "__K_REROUTE__"
+
+/**
+ * @brief Definition for app_control data: The flag for attaching app.
+ * @details If this flag is set, callee app will be attached to caller app for a while and it will be detached when callee app is lowered.
+ *          By default, this flag is 'false'
+ */
+#define APP_CONTROL_DATA_SHIFT_WINDOW "__K_SHIFT_WINDOW"
+
+/**
+ * @brief Definition for app_control data : The flag for supporting recycling processes.
+ * @details By default, this flag is 'false'. Once it is set to 'true', launched sub-app process will be reused even if it was lowered later.
+ *
+ */
+#define APP_CONTROL_DATA_RECYCLE "__K_RECYCLE"
+
+/**
+ * @brief Definition for app_control data : The value for supporting relocating launched app under the callee app.
+ * @details By default, this value is NULL. Once it is set to app ID, that application will be relocated under the callee app after callee app is resumed.
+ * @remarks The value should be an app ID for main app which has been launched before, otherwise it will be ignored.
+ */
+#define APP_CONTROL_DATA_RELOCATE_BELOW "__K_RELOCATE_BELOW"
+
+/**
  * @brief Replaces all data in the app_control with the bundle
  *
  * @remarks This function clears all data in the app_control and adds all key-value pairs in the bundle into the app_control
@@ -84,6 +112,92 @@ int app_control_create_request(bundle *data, app_control_h *app_control);
 
 int app_control_create_event(bundle *data, app_control_h *app_control);
 
+int app_control_to_bundle(app_control_h app_control, bundle **data);
+
+/**
+ * @brief Sets the window ID of the application.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] app_control The app_control handle
+ * @param[in] id The window ID of the caller application (if the @a id is not positive, it clears the previous value)
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ * @see app_control_get_window()
+ */
+int app_control_set_window(app_control_h app_control, unsigned int id);
+
+/**
+ * @brief Gets the window ID of the application.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] app_control The app_control handle
+ * @param[out] id The window ID of the caller application
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ * @see app_control_set_app_id()
+ */
+int app_control_get_window(app_control_h app_control, unsigned int *id);
+
+/**
+ * @brief Requests the specified callee window to be transient for the caller window.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The @a callee_id window is transient for the top-level caller window and should be handled accordingly.
+ * @param[in] app_control The app_control handle
+ * @param[in] callee_id The callee window ID
+ * @param[in] cbfunc The callback function to be called when the transient is requested
+ * @param[in] data A data pointer to pass to the callback function
+ * @return @c 0 on success,
+ *         otherwise a negative error value.
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int app_control_request_transient_app(app_control_h app_control, unsigned int callee_id, app_control_host_res_fn cbfunc, void *data);
+
+/**
+ * @platform
+ * @brief Sets the ID of default application associated with operation, mime-type and uri.
+ *
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] app_control The app_control handle
+ * @param[in] app_id The ID of the application
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #APP_CONTROL_ERROR_IO_ERROR IO error
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int app_control_set_defapp(app_control_h app_control, const char *app_id);
+
+/**
+ * @platform
+ * @brief Unsets default application control setting of an application.
+ *
+ * @details When an user call this API, all the default application settings for the app_id are unset.
+ *
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] app_id The ID of the application
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #APP_CONTROL_ERROR_IO_ERROR IO error
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int app_control_unset_defapp(const char *app_id);
 /**
  * @}
  */
@@ -93,3 +207,4 @@ int app_control_create_event(bundle *data, app_control_h *app_control);
 #endif
 
 #endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */
+