Release version 0.5.10
[platform/core/appfw/librua.git] / include / rua_context.h
1 /*
2  * Copyright (c) 2019 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 __RUA_CONTEXT_H__
18 #define __RUA_CONTEXT_H__
19
20 #include <rua_types.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @brief The RUA context handle.
28  * @since_tizen 5.5
29  */
30 typedef struct rua_context_s *rua_context_h;
31
32 /**
33  * @brief Destroyes the RUA context handle.
34  * @since_tizen 5.5
35  *
36  * @param[in]   context         The RUA context handle
37  * @return      @c 0 on success,
38  *              otherwise a negative error value
39  */
40 int rua_context_destroy(rua_context_h context);
41
42 /**
43  * @brief Gets the application ID of the instance.
44  * @since_tizen 5.5
45  * @remarks You should release @a app_id using free().
46  *
47  * @param[in]   context         The RUA context handle
48  * @param[out]  app_id          The application ID
49  * @return      @c 0 on success,
50  *              otherwise a negative error value
51  */
52 int rua_context_get_app_id(rua_context_h context, char **app_id);
53
54 /**
55  * @brief Gets the ID of the instance.
56  * @details The function returns RUA_ERROR_NONE, event if @a instance_id is null.
57  * @since_tizen 5.5
58  * @remarks You should release @a instance_id using free().
59  *
60  * @param[in]   context         The RUA context handle
61  * @param[out]  instance_id     The instance ID
62  * @return      @c 0 on success,
63  *              otherwise a negative error value
64  */
65 int rua_context_get_instance_id(rua_context_h context, char **instance_id);
66
67 /**
68  * @brief Gets the component ID of the instance.
69  * @details The function returns RUA_ERROR_NONE, event if @a component_id is null.
70  * @since_tizen 5.5
71  * @remarks You should release @a component_id using free().
72  *
73  * @param[in]   context         The RUA context handle
74  * @param[out]  component_id    The component ID
75  * @return      @c 0 on success,
76  *              otherwise a negative error value
77  */
78 int rua_context_get_component_id(rua_context_h context, char **component_id);
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif /*__RUA_CONTEXT_H__*/