Prepare unit test
[platform/core/appfw/aul-1.git] / include / aul_svc_internal.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 #pragma once
18
19 #include <bundle.h>
20 #include <sys/types.h>
21
22 #include "aul_svc.h"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @brief The AUL Service information handle.
30  * @since_tizen 5.5
31  * @remarks This API is only for App Framework internally.
32  */
33 typedef void *aul_svc_info_h;
34
35 /**
36  * @brief Creates the AUL Service information handle.
37  * @since_tizen 5.5
38  *
39  * @param[in] b The bundle object
40  * @param[out] h The AUL Service information handle
41  * @return @c 0 on success,
42  *         otherwise a negative error value
43  * @retval #AUL_SVC_RET_OK Successful
44  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
45  * @retval #AUL_SVC_RET_ERROR Out of memory
46  */
47 int aul_svc_info_create(bundle *b, aul_svc_info_h *h);
48
49 /**
50  * @brief Gets the operation to be performed.
51  * @since_tizen 5.5
52  *
53  * @param[in] h The AUL Service information handle
54  * @param[out] operation The operation to be performed
55  * @return @c 0 on success,
56  *         otherwise a negative error value
57  * @retval #AUL_SVC_RET_OK Successful
58  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
59  * @retval #AUL_SVC_RET_ERROR Out of memory
60  */
61 int aul_svc_info_get_operation(aul_svc_info_h h, char **operation);
62
63 /**
64  * @brief Gets the URI of the data.
65  * @since_tizen 5.5
66  *
67  * @param[in] h The AUL Service information handle
68  * @param[out] uri The URI of the data
69  * @return @c 0 on success,
70  *         otherwise a negative error value
71  * @retval #AUL_SVC_RET_OK Successful
72  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
73  * @retval #AUL_SVC_RET_ERROR Out of memory
74  */
75 int aul_svc_info_get_uri(aul_svc_info_h h, char **uri);
76
77 /**
78  * @brief Gets the scheme of the URI.
79  * @since_tizen 5.5
80  *
81  * @param[in] h The AUL Service information handle
82  * @param[out] uri_scheme The scheme of the URI
83  * @return @c 0 on success,
84  *         otherwise a negative error value
85  * @retval #AUL_SVC_RET_OK Successful
86  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
87  * @retval #AUL_SVC_RET_ERROR Out of memory
88  */
89 int aul_svc_info_get_uri_scheme(aul_svc_info_h h, char **uri_scheme);
90
91 /**
92  * @brief Gets the host of the URI.
93  * @since_tizen 5.5
94  *
95  * @param[in] h The AUL Service information handle
96  * @param[out] uri_host The host of the URI
97  * @return @c 0 on success,
98  *         otherwise a negative error value
99  * @retval #AUL_SVC_RET_OK Successful
100  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
101  * @retval #AUL_SVC_RET_ERROR Out of memory
102  */
103 int aul_svc_info_get_uri_host(aul_svc_info_h h, char **uri_host);
104
105 /**
106  * @brief Gets the explicit MIME type of the data.
107  * @since_tizen 5.5
108  *
109  * @param[in] h The AUL Service information handle
110  * @param[out] mime The explicit MIME type of the data
111  * @return @c 0 on success,
112  *         otherwise a negative error value
113  * @retval #AUL_SVC_RET_OK Successful
114  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
115  * @retval #AUL_SVC_RET_ERROR Out of memory
116  */
117 int aul_svc_info_get_mime(aul_svc_info_h h, char **mime);
118
119 /**
120  * @brief Gets the type of the MIME type.
121  * @since_tizen 5.5
122  *
123  * @param[in] h The AUL Service information handle
124  * @param[out] mime_type The type of the MIME type
125  * @return @c 0 on success,
126  *         otherwise a negative error value
127  * @retval #AUL_SVC_RET_OK Successful
128  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
129  * @retval #AUL_SVC_RET_ERROR Out of memory
130  */
131 int aul_svc_info_get_mime_type(aul_svc_info_h h, char **mime_type);
132
133 /**
134  * @brief Gets the subtype of the MIME type.
135  * @since_tizen 5.5
136  *
137  * @param[in] h The AUL Service information handle
138  * @param[out] mime_subtype The subtype of the MIME type
139  * @return @c 0 on success,
140  *         otherwise a negative error value
141  * @retval #AUL_SVC_RET_OK Successful
142  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
143  * @retval #AUL_SVC_RET_ERROR Out of memory
144  */
145 int aul_svc_info_get_mime_subtype(aul_svc_info_h h, char **mime_subtype);
146
147 /**
148  * @brief Destroys the AUL Service information handle.
149  * @since_tizen 5.5
150  *
151  * @param[in] h The AUL Service information handle
152  * @return @c 0 on success,
153  *         otherwise a negative error value
154  * @retval #AUL_SVC_RET_OK Successful
155  * @retval #AUL_SVC_RET_EINVAL Invalid parameter
156  */
157 int aul_svc_info_destroy(aul_svc_info_h h);
158
159 #ifdef __cplusplus
160 }
161 #endif