tizen 2.3 release
[framework/api/application.git] / include / app_control_internal.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__
18 #define __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__
19
20 #include <bundle.h>
21
22 #include <app_control.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @file app_control_internal.h
30  */
31
32 /**
33  * @addtogroup CAPI_APP_CONTROL_MODULE
34  * @{
35  */
36
37 /**
38  * @brief Replaces all data in the app_control with the bundle
39  *
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()
47  * @code
48  *
49  * #include <bundle.h>
50  * #include <app_control.h>
51  *
52  * app_control_h app_control = NULL;
53  * app_control_create(&app_control);
54  * app_control_import_from_bundle(app_control, b);
55  *
56  * @endcode
57  *
58  */
59 int app_control_import_from_bundle(app_control_h app_control, bundle *data);
60
61 /**
62  * @brief Returns a new bundle containing all data contained int the app_control
63  *
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()
71  * @code
72  *
73  * #include <bundle.h>
74  * #include <app_control.h>
75  *
76  * bundle* b = NULL;
77  * app_control_export_as_bundle(app_control, &b);
78  *
79  * @endcode
80  */
81 int app_control_export_as_bundle(app_control_h app_control, bundle **data);
82
83 int app_control_create_request(bundle *data, app_control_h *app_control);
84
85 int app_control_create_event(bundle *data, app_control_h *app_control);
86
87 /**
88  * @}
89  */
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */