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 Replaces all data in the app_control with the bundle
40 * @remarks This function clears all data in the app_control and adds all key-value pairs in the bundle into the app_control
41 * @param [in] app_control The app_control handle
42 * @param [in] data The bundle handle
43 * @return 0 on success, otherwise a negative error value.
44 * @retval #APP_CONTROL_ERROR_NONE Successful
45 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
46 * @see app_control_export_as_bundle()
50 * #include <app_control.h>
52 * app_control_h app_control = NULL;
53 * app_control_create(&app_control);
54 * app_control_import_from_bundle(app_control, b);
59 int app_control_import_from_bundle(app_control_h app_control, bundle *data);
62 * @brief Returns a new bundle containing all data contained int the app_control
64 * @remarks The @a data must be released with bundle_free() by you.
65 * @param [in] app_control The app_control handle
66 * @param [out] data The bundle handle
67 * @return 0 on success, otherwise a negative error value.
68 * @retval #APP_CONTROL_ERROR_NONE Successful
69 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
70 * @see app_control_import_from_bundle()
74 * #include <app_control.h>
77 * app_control_export_as_bundle(app_control, &b);
81 int app_control_export_as_bundle(app_control_h app_control, bundle **data);
83 int app_control_create_request(bundle *data, app_control_h *app_control);
85 int app_control_create_event(bundle *data, app_control_h *app_control);
87 int app_control_to_bundle(app_control_h app_control, bundle **data);
90 * @brief Sets the window ID of the application.
92 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
93 * @param[in] app_control The app_control handle
94 * @param[in] id The window ID of the caller application (if the @a id is not positive, it clears the previous value)
95 * @return @c 0 on success,
96 * otherwise a negative error value
97 * @retval #APP_CONTROL_ERROR_NONE Successful
98 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
99 * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
100 * @see app_control_get_window()
102 int app_control_set_window(app_control_h app_control, unsigned int id);
105 * @brief Gets the window ID of the application.
107 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
108 * @param[in] app_control The app_control handle
109 * @param[out] id The window ID of the caller application
110 * @return @c 0 on success,
111 * otherwise a negative error value
112 * @retval #APP_CONTROL_ERROR_NONE Successful
113 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
114 * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
115 * @see app_control_set_app_id()
117 int app_control_get_window(app_control_h app_control, unsigned int *id);
120 * @brief Requests the specified callee window to be transient for the caller window.
122 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
123 * @remarks The @a callee_id window is transient for the top-level caller window and should be handled accordingly.
124 * @param[in] app_control The app_control handle
125 * @param[in] callee_id The callee window ID
126 * @param[in] cbfunc The callback function to be called when the transient is requested
127 * @param[in] data A data pointer to pass to the callback function
128 * @return @c 0 on success,
129 * otherwise a negative error value.
130 * @retval #APP_CONTROL_ERROR_NONE Successful
131 * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
133 int app_control_request_transient_app(app_control_h app_control, unsigned int callee_id, app_control_host_res_fn cbfunc, void *data);
143 #endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */