2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__
18 #define __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__
22 #include <app_control.h>
29 * @file app_control_internal.h
33 * @addtogroup CAPI_APP_CONTROL_MODULE
38 * @brief Definition for app_control data: Connect the previous app with the next app when the sub-app is terminated.
39 * @details If a sub-app is terminated, framework will connect the previous app with the next app.
40 * By default, this flag is 'false'
42 #define APP_CONTROL_DATA_REROUTE "__K_REROUTE__"
45 * @brief Definition for app_control data: The flag for attaching app.
46 * @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.
47 * By default, this flag is 'false'
49 #define APP_CONTROL_DATA_SHIFT_WINDOW "__K_SHIFT_WINDOW"
52 * @brief Definition for app_control data : The flag for supporting recycling processes.
53 * @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.
56 #define APP_CONTROL_DATA_RECYCLE "__K_RECYCLE"
59 * @brief Definition for app_control data : The value for supporting relocating launched app under the callee app.
60 * @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.
61 * @remarks The value should be an app ID for main app which has been launched before, otherwise it will be ignored.
63 #define APP_CONTROL_DATA_RELOCATE_BELOW "__K_RELOCATE_BELOW"
66 * @brief Replaces all data in the app_control with the bundle
68 * @remarks This function clears all data in the app_control and adds all key-value pairs in the bundle into the app_control
69 * @param [in] app_control The app_control handle
70 * @param [in] data The bundle handle
71 * @return 0 on success, otherwise a negative error value.
72 * @retval #APP_CONTROL_ERROR_NONE Successful
73 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
74 * @see app_control_export_as_bundle()
78 * #include <app_control.h>
80 * app_control_h app_control = NULL;
81 * app_control_create(&app_control);
82 * app_control_import_from_bundle(app_control, b);
87 int app_control_import_from_bundle(app_control_h app_control, bundle *data);
90 * @brief Returns a new bundle containing all data contained int the app_control
92 * @remarks The @a data must be released with bundle_free() by you.
93 * @param [in] app_control The app_control handle
94 * @param [out] data The bundle handle
95 * @return 0 on success, otherwise a negative error value.
96 * @retval #APP_CONTROL_ERROR_NONE Successful
97 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
98 * @see app_control_import_from_bundle()
101 * #include <bundle.h>
102 * #include <app_control.h>
105 * app_control_export_as_bundle(app_control, &b);
109 int app_control_export_as_bundle(app_control_h app_control, bundle **data);
111 int app_control_create_request(bundle *data, app_control_h *app_control);
113 int app_control_create_event(bundle *data, app_control_h *app_control);
115 int app_control_to_bundle(app_control_h app_control, bundle **data);
118 * @brief Sets the window ID of the application.
120 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
121 * @param[in] app_control The app_control handle
122 * @param[in] id The window ID of the caller application (if the @a id is not positive, it clears the previous value)
123 * @return @c 0 on success,
124 * otherwise a negative error value
125 * @retval #APP_CONTROL_ERROR_NONE Successful
126 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
127 * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
128 * @see app_control_get_window()
130 int app_control_set_window(app_control_h app_control, unsigned int id);
133 * @brief Gets the window ID of the application.
135 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
136 * @param[in] app_control The app_control handle
137 * @param[out] id The window ID of the caller application
138 * @return @c 0 on success,
139 * otherwise a negative error value
140 * @retval #APP_CONTROL_ERROR_NONE Successful
141 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
142 * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
143 * @see app_control_set_app_id()
145 int app_control_get_window(app_control_h app_control, unsigned int *id);
148 * @brief Requests the specified callee window to be transient for the caller window.
150 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
151 * @remarks The @a callee_id window is transient for the top-level caller window and should be handled accordingly.
152 * @param[in] app_control The app_control handle
153 * @param[in] callee_id The callee window ID
154 * @param[in] cbfunc The callback function to be called when the transient is requested
155 * @param[in] data A data pointer to pass to the callback function
156 * @return @c 0 on success,
157 * otherwise a negative error value.
158 * @retval #APP_CONTROL_ERROR_NONE Successful
159 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
161 int app_control_request_transient_app(app_control_h app_control, unsigned int callee_id, app_control_host_res_fn cbfunc, void *data);
171 #endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */