2 * Copyright (c) 2019 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 __AUL_APP_GROUP_H__
18 #define __AUL_APP_GROUP_H__
21 #include <sys/types.h>
29 * @brief The AUL application group information handle.
32 typedef struct aul_app_group_info_s *aul_app_group_info_h;
34 typedef void (*aul_app_group_leader_id_cb)(const char *leader_id, void* user_data);
36 typedef void (*aul_app_group_info_cb)(aul_app_group_info_h info, void *user_data);
41 * @remarks You should not release @a appid by using free().
43 * @param[in] h The app group info handle
44 * @param[out] id The ID
45 * @return @c 0 on success,
46 * otherwise a negative error value
48 * @remarks This function is only for App Framework internally.
50 int aul_app_group_info_get_id(aul_app_group_info_h h, const char **id);
53 * @brief Gets the process ID.
56 * @param[in] h The app group info handle
57 * @param[out] pid The process ID
58 * @return @c 0 on success,
59 * otherwise a negative error value
61 * @remarks This function is only for App Framework internally.
63 int aul_app_group_info_get_pid(aul_app_group_info_h h, pid_t *pid);
66 * @brief Gets the application ID.
68 * @remarks You should not release @a appid by using free().
70 * @param[in] h The app group info handle
71 * @param[out] appid The application ID
72 * @return @c 0 on success,
73 * otherwise a negative error value
75 * @remarks This function is only for App Framework internally.
77 int aul_app_group_info_get_appid(aul_app_group_info_h h, const char **appid);
80 * @brief Gets the package ID.
82 * @remarks You should not release @a appid by using free().
84 * @param[in] h The app group info handle
85 * @param[out] pkgid The package ID
86 * @return @c 0 on success,
87 * otherwise a negative error value
89 * @remarks This function is only for App Framework internally.
91 int aul_app_group_info_get_pkgid(aul_app_group_info_h h, const char **pkgid);
94 * @brief Gets the window ID.
97 * @param[in] h The app group info handle
98 * @param[out] wid The window ID
99 * @return @c 0 on success,
100 * otherwise a negative error value
102 * @remarks This function is only for App Framework internally.
104 int aul_app_group_info_get_window(aul_app_group_info_h h, int *wid);
107 * @brief Gets the flag that the group is running foreground.
110 * @param[in] h The app group info handle
111 * @param[out] fg_flag The flag of the foreground
112 * @return @c 0 on success,
113 * otherwise a negative error value
115 * @remarks This function is only for App Framework internally.
117 int aul_app_group_info_get_fg_flag(aul_app_group_info_h h, bool *fg_flag);
120 * @brief Gets the status of the instance.
123 * @param[in] h The app group info handle
124 * @param[out] status The status
125 * @return @c 0 on success,
126 * otherwise a negative error value
128 * @remarks This function is only for App Framework internally.
130 int aul_app_group_info_get_status(aul_app_group_info_h h, int *status);
133 * @brief Retrieves the leader instances.
136 * @param[in] callback The callback function
137 * @param[in] user_data The user data to be passed the callback function
138 * @return @c 0 on success,
139 * otherwise a negative error value
141 * @remarks This function is only for App Framework internally.
143 int aul_app_group_foreach_leader_ids(aul_app_group_leader_id_cb callback,
147 * @brief Retrieves the group instances.
150 * @param[in] leader_id The leader ID of the app group.
151 * @param[in] callback The callback function
152 * @param[in] user_data The user data to be passed the callback function
153 * @return @c 0 on success,
154 * otherwise a negative error value
156 * @remarks This function is only for App Framework internally.
158 int aul_app_group_foreach_group_info(const char *leader_id,
159 aul_app_group_info_cb callback, void *user_data);
162 * @brief Retrieves the idle instances.
165 * @param[in] callback The callback function
166 * @param[in] user_data The user data to be passed the callback function
167 * @return @c 0 on success,
168 * otherwise a negative error value
170 * @remarks This function is only for App Framework internally.
172 int aul_app_group_foreach_idle_info(aul_app_group_info_cb callback,
176 * @brief Sets the window.
179 * @param[in] id The instance ID
180 * @param[in] wid The window(surface) ID
181 * @return @c 0 on success,
182 * otherwise a negative error value
184 * @remarks This function is only for App Framework internally.
186 int aul_app_group_set_window_v2(const char *id, int wid);
189 * @brief Lowers the window.
192 * @param[in] id The instance ID
193 * @param[out] exit The flag if it's 'true', the instance should be terminated
194 * @return @c 0 on success,
195 * otherwise a negative error value
197 * @remarks This function is only for App Framework internally.
199 int aul_app_group_lower_v2(const char *id, bool *exit);
202 * @brief Adds a new app group to the app group.
203 * @details A new app group will be added using the given window ID.
206 * @param[in] wid The window(surface) ID
207 * @return @c 0 on success,
208 * otherwise a negatvie error value
210 * @remarks This function is only for App Framework internally.
212 int aul_app_group_add(int wid);
215 * @brief Removes the app group using the given window ID.
218 * @param[in] wid The window(surface) ID
219 * @return @c 0 on success,
220 * otherwise a negative error value
222 * @remarks This function is only for App Framework internally.
224 int aul_app_group_remove(int wid);
230 #endif /* __AUL_APP_GROUP_H__ */