Release version 0.5.14
[platform/core/appfw/librua.git] / include / rua_info.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_INFO_H__
18 #define __RUA_INFO_H__
19
20 #include <time.h>
21 #include <sys/types.h>
22
23 #include <rua_types.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @brief The RUA information handle.
31  * @since_tizen 5.5
32  */
33 typedef struct rua_info_s *rua_info_h;
34
35 /**
36  * @brief Gets the ID of the application.
37  * @since_tizen 5.5
38  * @remarks You should release @a app_id using free().
39  *
40  * @param[in]   info            The RUA information handle
41  * @param[out]  app_id          The application ID
42  * @return      @c 0 on success,
43  *              otherwise a negative error value
44  *
45  * @see rua_info_foreach()
46  * @see rua_info_usr_foreach()
47  */
48 int rua_info_get_app_id(rua_info_h info, char **app_id);
49
50 /**
51  * @brief Gets the path of the application.
52  * @since_tizen 5.5
53  * @remarks You should release @a app_path using free().
54  *
55  * @param[in]   info            The RUA information handle
56  * @param[out]  app_path        The application path
57  * @return      @c 0 on success,
58  *              otherwise a negative error value
59  *
60  * @see rua_info_foreach()
61  * @see rua_info_usr_foreach()
62  */
63 int rua_info_get_app_path(rua_info_h info, char **app_path);
64
65 /**
66  * @brief Gets the arguments of the application.
67  * @since_tizen 5.5
68  * @remarks You should release @a args using free().
69  *
70  * @param[in]   info            The RUA information handle
71  * @param[out]  args            The arguments
72  * @return      @c 0 on success,
73  *              otherwise a negative error value
74  *
75  * @see rua_info_foreach()
76  * @see rua_info_usr_foreach()
77  */
78 int rua_info_get_args(rua_info_h info, char **args);
79
80 /**
81  * @brief Gets the launch time of the application.
82  * @since_tizen 5.5
83  *
84  * @param[in]   info            The RUA information handle
85  * @param[out]  launch_time     The launch time
86  * @return      @c 0 on success,
87  *              otherwise a negative error value
88  *
89  * @see rua_info_foreach()
90  * @see rua_info_usr_foreach()
91  */
92 int rua_info_get_launch_time(rua_info_h info, time_t *launch_time);
93
94 /**
95  * @brief Gets the instance ID of the application.
96  * @details The function returns RUA_ERROR_NONE, event if @a instance_id is null.
97  * @since_tizen 5.5
98  * @remarks You should release @a instance_id using free().
99  *
100  * @param[in]   info            The RUA information handle
101  * @param[out]  instance_id     The instance ID
102  * @return      @c 0 on success,
103  *              otherwise a negative error value
104  *
105  * @see rua_info_foreach()
106  * @see rua_info_usr_foreach()
107  */
108 int rua_info_get_instance_id(rua_info_h info, char **instance_id);
109
110 /**
111  * @brief Gets the instance name of the application.
112  * @details The function returns RUA_ERROR_NONE, event if @a instance_name is null.
113  * @since_tizen 5.5
114  * @remarks You should release @a instance_name using free().
115  *
116  * @param[in]   info            The RUA information handle
117  * @param[out]  instance_name   The instance name
118  * @return      @c 0 on success,
119  *              otherwise a negative error value
120  *
121  * @see rua_info_foreach()
122  * @see rua_info_usr_foreach()
123  */
124 int rua_info_get_instance_name(rua_info_h info, char **instance_name);
125
126 /**
127  * @brief Gets the icon path of the application.
128  * @details The function returns RUA_ERROR_NONE, event if @a icon is null.
129  * @since_tizen 5.5
130  * @privlevel public
131  * @privilege %http://tizen.org/privilege/packagemanager.info
132  * @remarks You should release @a icon using free().
133  *
134  * @param[in]   info            The RUA information handle
135  * @param[out]  icon            The icon path
136  * @return      @c 0 on success,
137  *              otherwise a negative error value
138  *
139  * @see rua_info_foreach()
140  * @see rua_info_usr_foreach()
141  */
142 int rua_info_get_icon(rua_info_h info, char **icon);
143
144 /**
145  * @brief Gets the URI of the application.
146  * @details The function returns RUA_ERROR_NONE, event if @a uri is null.
147  * @since_tizen 5.5
148  * @remarks You should release @a uri using free().
149  *
150  * @param[in]   info            The RUA information handle
151  * @param[out]  uri             The URI
152  * @return      @c 0 on success,
153  *              otherwise a negative error value
154  *
155  * @see rua_info_foreach()
156  * @see rua_info_usr_foreach()
157  */
158 int rua_info_get_uri(rua_info_h info, char **uri);
159
160 /**
161  * @brief Gets the image path of the application.
162  * @details The function returns RUA_ERROR_NONE, event if @a image is null.
163  * @since_tizen 5.5
164  * @remarks You should release @a image using free().
165  *
166  * @param[in]   info            The RUA information handle
167  * @param[out]  image           The image path
168  * @return      @c 0 on success,
169  *              otherwise a negative error value
170  *
171  * @see rua_info_foreach()
172  * @see rua_info_usr_foreach()
173  */
174 int rua_info_get_image(rua_info_h info, char **image);
175
176 /**
177  * @brief Gets the component ID of the application.
178  * @details The function returns RUA_ERROR_NONE, event if @a component_id is null.
179  * @since_tizen 5.5
180  * @remarks You should release @a component_id using free().
181  *
182  * @param[in]   info            The RUA information handle
183  * @param[out]  component_id    The component ID
184  * @return      @c 0 on success,
185  *              otherwise a negative error value
186  *
187  * @see rua_info_foreach()
188  * @see rua_info_usr_foreach()
189  */
190 int rua_info_get_component_id(rua_info_h info, char **component_id);
191
192 /**
193  * @brief Checks whether the application should be managed by task-manager or not.
194  * @since_tizen 5.5
195  *
196  * @param[in]   info            The RUA information handle
197  * @param[out]  managed         @c true if the application should be managed by task-manager, \n
198  *                              otherwise @c false
199  * @return      @c 0 on success,
200  *              otherwise a negative error value
201  *
202  * @see rua_info_foreach()
203  * @see rua_info_usr_forach()
204  */
205 int rua_info_is_managed_by_task_manager(rua_info_h info, bool *managed);
206
207 /**
208  * @brief Gets the label.
209  * @details The function returns RUA_ERROR_NONE, event if @a label is null.
210  * @since_tizen 5.5
211  * @remarks You should release @a label using free().
212  *
213  * @param[in]   info            The RUA information handle
214  * @param[out]  label           The label
215  * @return      @c 0 on success,
216  *              otherwise a negative error value
217  *
218  * @see rua_info_foreach()
219  * @see rua_info_usr_foreach()
220  */
221 int rua_info_get_label(rua_info_h info, char **label);
222
223 /**
224  * @brief Destroyes the RUA information handle.
225  * @since_tizen 5.5
226  *
227  * @param[in]   info            The RUA information handle
228  * @return      @c 0 on success,
229  *              otherwise a negative error value
230  */
231 int rua_info_destroy(rua_info_h info);
232
233 /**
234  * @brief Creates and returns a copy of the given RUA information handle.
235  * @since_tizen 5.5
236  * @remarks You should release @a clone using rua_info_destroy().
237  *
238  * @param[in]   info            The RUA information handle
239  * @param[out]  clone           If successful, a newly created RUA information handle will be returned
240  * @return      @c 0 on success,
241  *              otherwise a negative error value
242  *
243  * @see rua_info_destroy()
244  */
245 int rua_info_clone(rua_info_h info, rua_info_h *clone);
246
247 #ifdef __cplusplus
248 }
249 #endif
250
251 #endif /*__RUA_INFO_H__*/