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 Replaces all data in the app_control with the bundle
61 * @remarks This function clears all data in the app_control and adds all key-value pairs in the bundle into the app_control
62 * @param [in] app_control The app_control handle
63 * @param [in] data The bundle handle
64 * @return 0 on success, otherwise a negative error value.
65 * @retval #APP_CONTROL_ERROR_NONE Successful
66 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
67 * @see app_control_export_as_bundle()
71 * #include <app_control.h>
73 * app_control_h app_control = NULL;
74 * app_control_create(&app_control);
75 * app_control_import_from_bundle(app_control, b);
80 int app_control_import_from_bundle(app_control_h app_control, bundle *data);
83 * @brief Returns a new bundle containing all data contained int the app_control
85 * @remarks The @a data must be released with bundle_free() by you.
86 * @param [in] app_control The app_control handle
87 * @param [out] data The bundle handle
88 * @return 0 on success, otherwise a negative error value.
89 * @retval #APP_CONTROL_ERROR_NONE Successful
90 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
91 * @see app_control_import_from_bundle()
95 * #include <app_control.h>
98 * app_control_export_as_bundle(app_control, &b);
102 int app_control_export_as_bundle(app_control_h app_control, bundle **data);
104 int app_control_create_request(bundle *data, app_control_h *app_control);
106 int app_control_create_event(bundle *data, app_control_h *app_control);
108 int app_control_to_bundle(app_control_h app_control, bundle **data);
111 * @brief Sets the window ID of the application.
113 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
114 * @param[in] app_control The app_control handle
115 * @param[in] id The window ID of the caller application (if the @a id is not positive, it clears the previous value)
116 * @return @c 0 on success,
117 * otherwise a negative error value
118 * @retval #APP_CONTROL_ERROR_NONE Successful
119 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
120 * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
121 * @see app_control_get_window()
123 int app_control_set_window(app_control_h app_control, unsigned int id);
126 * @brief Gets the window ID of the application.
128 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
129 * @param[in] app_control The app_control handle
130 * @param[out] id The window ID of the caller application
131 * @return @c 0 on success,
132 * otherwise a negative error value
133 * @retval #APP_CONTROL_ERROR_NONE Successful
134 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
135 * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
136 * @see app_control_set_app_id()
138 int app_control_get_window(app_control_h app_control, unsigned int *id);
141 * @brief Requests the specified callee window to be transient for the caller window.
143 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
144 * @remarks The @a callee_id window is transient for the top-level caller window and should be handled accordingly.
145 * @param[in] app_control The app_control handle
146 * @param[in] callee_id The callee window ID
147 * @param[in] cbfunc The callback function to be called when the transient is requested
148 * @param[in] data A data pointer to pass to the callback function
149 * @return @c 0 on success,
150 * otherwise a negative error value.
151 * @retval #APP_CONTROL_ERROR_NONE Successful
152 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
154 int app_control_request_transient_app(app_control_h app_control, unsigned int callee_id, app_control_host_res_fn cbfunc, void *data);
164 #endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */