4 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include <sys/types.h>
31 * @brief Return values in AUL.
33 typedef enum _aul_return_val {
34 AUL_R_ENOENT = -15, /**< App directory entry error */
35 AUL_R_EREJECTED = -14, /**< App disable for mode */
36 AUL_R_ENOAPP = -13, /**< Failed to find app ID or pkg ID */
37 AUL_R_EHIDDENFORGUEST = -11, /**< App hidden for guest mode */
38 AUL_R_ENOLAUNCHPAD = -10, /**< no launchpad */
39 AUL_R_ETERMINATING = -9, /**< application terminating */
40 AUL_R_EILLACC = -8, /**< Illegal Access */
41 AUL_R_LOCAL = -7, /**< Launch by himself */
42 AUL_R_ETIMEOUT = -6, /**< Timeout */
43 AUL_R_ECANCELED = -5, /**< Operation canceled */
44 AUL_R_EINVAL = -4, /**< Invalid argument */
45 AUL_R_ECOMM = -3, /**< Comunication Error */
46 AUL_R_ENOINIT = -2, /**< AUL handler NOT initialized */
47 AUL_R_ERROR = -1, /**< General error */
48 AUL_R_OK = 0 /**< General success */
64 typedef enum _aul_type {
76 typedef enum aul_widget_lifecycle_event {
77 AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD = 0,
78 AUL_WIDGET_LIFE_CYCLE_EVENT_CREATE = 1, /**< The widget is created */
79 AUL_WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2, /**< The widget is destroyed */
80 AUL_WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3, /**< The widget is paused */
81 AUL_WIDGET_LIFE_CYCLE_EVENT_RESUME = 4 /**< The widget is resumed */
82 } aul_widget_lifecycle_event_e;
84 typedef enum aul_widget_instance_event {
85 AUL_WIDGET_INSTANCE_EVENT_CREATE = 0,
86 AUL_WIDGET_INSTANCE_EVENT_DESTROY = 1,
87 AUL_WIDGET_INSTANCE_EVENT_TERMINATE = 2,
88 AUL_WIDGET_INSTANCE_EVENT_PAUSE = 3,
89 AUL_WIDGET_INSTANCE_EVENT_RESUME = 4,
90 AUL_WIDGET_INSTANCE_EVENT_UPDATE = 5,
91 AUL_WIDGET_INSTANCE_EVENT_PERIOD_CHANGED = 6,
92 AUL_WIDGET_INSTANCE_EVENT_SIZE_CHANGED = 7,
93 AUL_WIDGET_INSTANCE_EVENT_EXTRA_UPDATED = 8,
94 AUL_WIDGET_INSTANCE_EVENT_FAULT = 9,
95 AUL_WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST = 10
96 } aul_widget_instance_event_e;
98 /** AUL public key - To check caller's secuirty */
99 #define AUL_K_CALLER_PID "__AUL_CALLER_PID__"
100 /** AUL public key - To check callee's secuirty */
101 #define AUL_K_CALLEE_PID "__AUL_CALLEE_PID__"
102 /** AUL public key - added for multiuser mode */
103 #define AUL_K_CALLER_UID "__AUL_CALLER_UID__"
104 /** AUL public key - added for multiuser mode */
105 #define AUL_K_CALLEE_UID "__AUL_CALLEE_UID__"
106 /** AUL public key - added for multiuser mode */
107 #define AUL_K_TARGET_UID "__AUL_TARGET_UID__"
108 /** AUL public key - To check caller's secuirty */
109 #define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
110 /** AUL public key - To check caller's secuirty */
111 #define AUL_K_CALLEE_APPID "__AUL_CALLEE_APPID__"
112 /** AUL public key - To find argv0 */
113 #define AUL_K_ARGV0 "__AUL_ARGV0__"
114 /** AUL public key - To measure launching time */
115 #define AUL_K_STARTTIME "__AUL_STARTTIME__"
116 /** AUL public key - To support launching based on mime type */
117 #define AUL_K_MIME_TYPE "__AUL_MIME_TYPE__"
118 /** AUL public key - To support launching based on mime type */
119 #define AUL_K_UNALIASED_MIME_TYPE "__AUL_UNALIASED_MIME_TYPE__"
120 /** AUL public key - To support launching based on mime type */
121 #define AUL_K_MIME_CONTENT "__AUL_MIME_CONTENT__"
122 /** AUL public key - To support launching based on service */
123 #define AUL_K_SERVICE_NAME "__AUL_SERVICE_NAME__"
124 /** AUL public key - To force launch app selector instead of lauchingn default app */
125 #define AUL_K_FORCE_LAUNCH_APP_SELECTOR "__AUL_FORCE_LAUNCH_APP_SELECTOR__"
126 /** AUL public key - To support debug argument */
127 #define AUL_K_DEBUG "__AUL_DEBUG__"
128 /** AUL public key - To support SDK */
129 #define AUL_K_SDK "__AUL_SDK__"
130 /** AUL public key - To support Media key */
131 #define AUL_K_MULTI_KEY "__AUL_MULTI_KEY__"
132 /** AUL public key - To support Media key */
133 #define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
134 /** AUL public bundle value */
135 #define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
136 /** AUL public bundle value - To support Media key*/
137 #define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
138 /** AUL public bundle value - To support Media key*/
139 #define AUL_V_KEY_RELEASED "__AUL_KEY_RELEASED__"
140 /** AUL public key - To support rua stat */
141 #define AUL_SVC_K_RUA_STAT_CALLER "__K_RUA_STAT_CALLER__"
142 #define AUL_SVC_K_RUA_STAT_TAG "__K_RUA_STAT_TAG__"
143 /** AUL public key - To support rua delete */
144 #define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
145 /** AUL public key - To support rua delete */
146 #define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
147 /** AUL public key - To support rua add */
148 #define AUL_K_RUA_ARG "__K_RUA_ARG"
149 /** AUL public key - To support rua add */
150 #define AUL_K_RUA_TIME "__K_RUA_TIME"
151 /** AUL public bundle value */
152 #define AUL_K_RUA_INSTANCE_ID "__K_RUA_INSTANCE_ID"
153 /** AUL public bundle value */
154 #define AUL_K_RUA_INSTANCE_NAME "__K_RUA_INSTANCE_NAME"
155 /** AUL public bundle value */
156 #define AUL_K_RUA_ICON "__K_RUA_ICON"
157 /** AUL public bundle value */
158 #define AUL_K_RUA_URI "__K_RUA_URI"
160 /** AUL internal private key */
161 #define AUL_K_PKG_NAME "__AUL_PKG_NAME__"
162 /** AUL internal private key */
163 #define AUL_K_WAIT_RESULT "__AUL_WAIT_RESULT__"
164 /** AUL internal private key */
165 #define AUL_K_SEND_RESULT "__AUL_SEND_RESULT__"
166 /** AUL internal private key */
167 #define AUL_K_TASK_MANAGE "__AUL_TASK_MANAGE__"
168 /** AUL internal private key */
169 #define AUL_K_APP_TYPE "__AUL_APP_TYPE__"
170 /** AUL internal private key - To check original caller's identity */
171 #define AUL_K_ORG_CALLER_PID "__AUL_ORG_CALLER_PID__"
172 /** AUL internal private key - To check forwarded callee app's pid */
173 #define AUL_K_FWD_CALLEE_PID "__AUL_FWD_CALLEE_PID__"
174 /** AUL internal private key */
175 #define AUL_K_NO_CANCEL "__AUL_NO_CANCEL__"
176 /** AUL internal private key */
177 #define AUL_K_EXEC "__AUL_EXEC__"
178 /** AUL internal private key */
179 #define AUL_K_MULTIPLE "__AUL_MULTIPLE__"
180 /** AUL internal private key */
181 #define AUL_K_PACKAGETYPE "__AUL_PACKAGETYPE__"
182 /** AUL internal private key */
183 #define AUL_K_HWACC "__AUL_HWACC__"
184 /** AUL internal private key */
185 #define AUL_K_APPID "__AUL_APPID__"
186 /** AUL internal private key */
187 #define AUL_K_PID "__AUL_PID__"
188 /** AUL internal private key */
189 #define AUL_K_WID "__AUL_WID__"
190 /** AUL internal private key */
191 #define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
192 /** AUL internal private key - To support data control */
193 #define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
194 /** AUL internal private key */
195 #define AUL_K_PKGID "__AUL_PKGID_"
196 /** AUL internal private key */
197 #define AUL_K_INTERNAL_POOL "__AUL_INTERNAL_POOL__"
198 /** AUL internal private key */
199 #define AUL_TEP_PATH "_AUL_TEP_PATH_"
200 /** AUL internal private key */
201 #define AUL_K_COMP_TYPE "__AUL_COMP_TYPE__"
202 /** AUL internal private key */
203 #define AUL_K_LOADER_ID "__AUL_LOADER_ID__"
204 /** AUL internal private key */
205 #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__"
206 /** AUL internal private key */
207 #define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__"
208 /** AUL internal private key */
209 #define AUL_K_LOADER_NAME "__AUL_LOADER_NAME__"
210 /** AUL internal private key */
211 #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__"
212 /** AUL internal private key */
213 #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
214 /** AUL internal private key */
215 #define AUL_K_COM_SENDER_PID "__AUL_COM_SENDER_PID__"
216 /** AUL internal private key */
217 #define AUL_K_COM_ENDPOINT "__AUL_COM_ENDPOINT__"
218 /** AUL internal private key */
219 #define AUL_K_COM_PRIVILEGE "__AUL_COM_PRIVILEGE__"
220 /** AUL internal private key */
221 #define AUL_K_COM_PROPAGATE "__AUL_COM_PROPAGATE__"
222 /** AUL internal private key */
223 #define AUL_K_COM_FILTER "__AUL_COM_FILTER__"
224 /** AUL internal private key */
225 #define AUL_K_COM_RESULT "__AUL_COM_RESULT__"
226 /** AUL internal private key */
227 #define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
228 /** AUL internal private key */
229 #define AUL_K_SEQ_NUM "__AUL_SEQ_NUM__"
230 /** AUL internal private key */
231 #define AUL_K_API_VERSION "__AUL_API_VERSION__"
232 /** AUL internal private key */
233 #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__"
234 /** AUL internal private key */
235 #define AUL_K_OWNER_PID "__AUL_OWNER_PID__"
236 /** AUL internal private key */
237 #define AUL_K_CHILD_PID "__AUL_CHILD_PID__"
238 /** AUL internal private key */
239 #define AUL_K_WIDGET_VIEWER "__AUL_WIDGET_VIEWER__"
240 /** AUL internal private key */
241 #define AUL_K_WIDGET_ID "__AUL_WIDGET_ID__"
242 /** AUL internal private key */
243 #define AUL_K_WIDGET_INSTANCE_ID "__AUL_WIDGET_INSTANCE_ID__"
244 /** AUL internal private key */
245 #define AUL_K_WIDGET_STATUS "__AUL_WIDGET_STATUS__"
246 /** AUL internal private key */
247 #define AUL_K_WIDGET_CONTENT_INFO "__AUL_WIDGET_CONTENT_INFO__"
248 /** AUL internal private key */
249 #define AUL_K_TARGET_PID "__AUL_TARGET_PID__"
250 /** AUL internal private key */
251 #define AUL_K_ALIAS_APPID "__AUL_ALIAS_APPID__"
252 /** AUL internal private key */
253 #define AUL_K_ORG_APPID "__AUL_ORG_APPID__"
254 /** AUL internal private key */
255 #define AUL_K_STATUS "__AUL_STATUS__"
256 /** AUL internal private key */
257 #define AUL_K_IS_SUBAPP "__AUL_IS_SUBAPP__"
258 /** AUL internal private key */
259 #define AUL_K_INSTANCE_ID "__AUL_INSTANCE_ID__"
260 /** AUL internal private key */
261 #define AUL_K_ORG_CALLER_UID "__AUL_ORG_CALLER_UID__"
262 /** AUL internal private key */
263 #define AUL_K_CHECKSUM "__AUL_CHECKSUM__"
266 * @brief This is callback function for aul_launch_init
267 * @param[in] type event's type received from system
268 * @param[in] b In case of RESET events, bundle which is received from peer
269 * @param[in] data user-supplied data
271 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
275 * This API install your AUL handler and setup AUL internal connection.
277 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
278 * This API use to handle the events. \n
279 * @par Typical use case:
280 * In general, you need not use this API.
281 * If you use AppCore, you should NOT use this API.
282 * AppCore will set default aul_handler.
284 * @param[in] handler aul main callback handler function
285 * @param[in] data user-supplied data for start_handler
286 * @return 0 if success, negative value(<0) if fail\n
287 * @retval AUL_R_OK - success
288 * @retval AUL_R_ECANCELD - aul handler was installed already by others
289 * @retval AUL_R_ECOMM - error to create internal ipc
290 * @retval AUL_R_ERROR - error to attach glib main loop
292 * @warning If you use AppCore, you should NOT use this API.\n
293 * You need glib main loop.\n
295 * you must have aul handler to use this API.
296 * aul_luanch_init register aul handler.
299 * #include <bundle.h>
301 * static int aul_handler(aul_type type, bundle *kb,void *data)
306 * // process RESET event
309 * // process RESUME event
311 * case AUL_TERMINATE:
312 * // preocess TERMINATE event
318 * static GMainLoop *mainloop = NULL;
320 * int main(int argc, char **argv)
322 * aul_launch_init(aul_handler,NULL);
323 * aul_launch_argv_handler(argc, argv);
325 * mainloop = g_main_loop_new(NULL, FALSE);
326 * g_main_loop_run(mainloop);
331 * This API is only available in User Session.
333 int aul_launch_init(aul_handler_fn handler, void *data);
337 * This API create internal RESET events with given argc, argv \n
339 * This API's purpose is to generate reset event.
340 * If you want to generate local RESET events with argument vector format, use this API
341 * @par Typical use case:
342 * In general, you need not use this API.
343 * AppCore use this API to create internal reset event.
345 * @param[in] argc # of args
346 * @param[in] argv list of arg strings
347 * @return 0 if success, negative value(<0) if fail
348 * @retval AUL_R_OK - success
349 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
350 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
351 * @retval AUL_R_ERROR - general error
354 * you must have aul handler to use this API.
355 * aul_luanch_init register aul handler.
360 * #include <bundle.h>
362 * int send_local_reset_event()
366 * argv[0] = "local.app";
367 * argv[1] = "event_type";
368 * argv[2] = "my_reset";
370 * aul_launch_argv_handler(argc,argv);
375 * If you use AppCore, you NEED NOT use this API.
376 * This API is only available in User Session.
378 int aul_launch_argv_handler(int argc, char **argv);
382 * This API creates internal RESET events with given bundle \n
384 * This API's purpose is to generate reset event.
385 * If you want to generate local RESET events with argument vector format, first use
386 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
387 * Eventually, this API will replace aul_launch_argv_handler().
388 * @par Typical use case:
389 * In general, you need not use this API.
390 * AppCore use this API to create internal reset event.
392 * @param[in] b bundle
393 * @return 0 if success, negative value(<0) if fail
394 * @retval AUL_R_OK - success
395 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
396 * @retval AUL_R_ERROR - general error
399 * you must have aul handler to use this API.
400 * aul_luanch_init register aul handler.
404 * aul_launch_init, bundle_import_from_argv
407 * #include <bundle.h>
409 * int send_local_reset_event()
414 * argv[0] = "local.app";
415 * argv[1] = "event_type";
416 * argv[2] = "my_reset";
419 * b = bundle_import_from_argv(argc,argv);
420 * aul_launch_local(b);
425 * If you use AppCore, you NEED NOT to use this API.
426 * This API is only available in User Session.
428 int aul_launch_local(bundle *b);
432 * This API launches application with the given bundle.
433 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
434 * If the application is running, this API sends a RESET event to the App.
435 * While the application is running, if the application cannot receive the RESET event,
436 * this API returns a general error(AUL_R_ERROR).\n
438 * This API is for caller.
439 * This API's purpose is to launch/reset application with given bundle.
440 * @par Typical use case:
441 * If you know the target application's pkgname and bundle types,
442 * you can use this API to launch/reset the application.
444 * @param[in] pkgname package name to be run as callee
445 * @param[in] kb bundle to be passed to callee
446 * @return callee's pid if success, negative value(<0) if fail
447 * @retval AUL_R_OK - success
448 * @retval AUL_R_EINVAL - invaild package name
449 * @retval AUL_R_ECOM - internal AUL IPC error
450 * @retval AUL_R_ERROR - general error
456 * #include <bundle.h>
458 * int launch_inhouse_contact_app()
461 * b = bundle_create();
462 * bundle_add(b,"type","SIM");
463 * aul_launch_app("org.tizen.contact",b);
468 * This API is only available in User Session.
470 int aul_launch_app(const char *appid, bundle *kb);
474 * This API launches application with the given bundle.
475 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
476 * If the application is running, this API sends a RESET event to the App.
477 * While the application is running, if the application cannot receive the RESET event,
478 * this API returns a general error(AUL_R_ERROR).\n
480 * This API is for caller.
481 * This API's purpose is to launch/reset application with given bundle.
482 * @par Typical use case:
483 * If you know the target application's pkgname and bundle types,
484 * you can use this API to launch/reset the application.
486 * @param[in] pkgname package name to be run as callee
487 * @param[in] kb bundle to be passed to callee
488 * @param[in] uid User ID to launch
489 * @return callee's pid if success, negative value(<0) if fail
490 * @retval AUL_R_OK - success
491 * @retval AUL_R_EINVAL - invaild package name
492 * @retval AUL_R_ECOM - internal AUL IPC error
493 * @retval AUL_R_ERROR - general error
498 * This API is also available in System Session.
500 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
504 * This API launches application, as menu screen launches the app.
505 * Thus, if the applocation is running, this API sends a RESUME event to the app.
506 * If the application is not running, this API launches the app.
507 * While the application is running, if the application cannot receive the RESUME event,
508 * AUL tries to raise the application's default window.
511 * This API is for caller.
512 * This API's purpose is to resume/launch application
513 * @par Typical use case:
514 * If you only want to show application with previous state or default state, Use this API.
516 * @param[in] pkgname package name to be resume as callee
517 * @return callee's pid if success, negative value(<0) if fail
518 * @retval AUL_R_OK - success
519 * @retval AUL_R_EINVAL - invaild package name
520 * @retval AUL_R_ECOM - internal AUL IPC error
521 * @retval AUL_R_ERROR - general error
524 * aul_launch_app, aul_app_is_running, aul_resume_pid
527 * #include <bundle.h>
529 * int open_inhouse_contact_app()
531 * if(aul_app_is_running("org.tizen.contact"))
532 * aul_open_app("org.tizen.contact");
537 * If you don't want to launch the app,
538 * you should check app's running state with aul_app_is_running.
539 * This API will launch the application if the application is not running.
540 * This API is only available in User Session.
542 int aul_open_app(const char *appid);
546 * This API launches application, as menu screen launches the app.
547 * Thus, if the applocation is running, this API sends a RESUME event to the app.
548 * If the application is not running, this API launches the app.
549 * While the application is running, if the application cannot receive the RESUME event,
550 * AUL tries to raise the application's default window.
553 * This API is for caller.
554 * This API's purpose is to resume/launch application
555 * @par Typical use case:
556 * If you only want to show application with previous state or default state, Use this API.
558 * @param[in] pkgname package name to be resume as callee
559 * @param[in] uid User ID
560 * @return callee's pid if success, negative value(<0) if fail
561 * @retval AUL_R_OK - success
562 * @retval AUL_R_EINVAL - invaild package name
563 * @retval AUL_R_ECOM - internal AUL IPC error
564 * @retval AUL_R_ERROR - general error
567 * If you don't want to launch the app,
568 * you should check app's running state with aul_app_is_running.
569 * This API will launch the application if the application is not running.
570 * This API is only available to System user.
572 int aul_open_app_for_uid(const char *appid, uid_t uid);
576 * This API trigger to resume application
577 * If the application is running, this API send a resume event to the App.
578 * If the application is not running, this API returns fail.
579 * Although the application is running, if the application cannot receive resume event,
580 * AUL try to raise the application's default windows.
582 * This API is for caller.
583 * This API's purpose is to send resume event.
584 * @par Typical use case:
585 * If you only want to show application with previous state or default state, Use this API.
587 * @param[in] pkgname package name to be resume as callee
588 * @return callee's pid if success, negative value(<0) if fail
589 * @retval AUL_R_OK - success
590 * @retval AUL_R_EINVAL - invaild package name
591 * @retval AUL_R_ECOM - internal AUL IPC error
592 * @retval AUL_R_ERROR - general error
595 * aul_launch_app, aul_app_is_running, aul_resume_pid
597 * This function will be deprecated. Use aul_open_add() instead.
600 * #include <bundle.h>
602 * int resume_inhouse_contact_app()
604 * if(aul_app_is_running("org.tizen.contact"))
605 * aul_resume_app("org.tizen.contact");
610 * If you don't want to launch the app,
611 * you should check app's running state with aul_app_is_running.
612 * This API will launch the application if the application is not running.
613 * If you want to only resume without launching in multiple instance application model,
614 * you should use aul_resume_pid.
615 * This API is only available in User Session.
617 int aul_resume_app(const char *appid);
621 * This API trigger to resume application
622 * If the application is running, this API send a resume event to the App.
623 * If the application is not running, this API returns fail.
624 * Although the application is running, if the application cannot receive resume event,
625 * AUL try to raise the application's default windows.
627 * This API is for caller.
628 * This API's purpose is to send resume event.
629 * @par Typical use case:
630 * If you only want to show application with previous state or default state, Use this API.
632 * @param[in] pkgname package name to be resume as callee
633 * @param[in] uid User ID
634 * @return callee's pid if success, negative value(<0) if fail
635 * @retval AUL_R_OK - success
636 * @retval AUL_R_EINVAL - invaild package name
637 * @retval AUL_R_ECOM - internal AUL IPC error
638 * @retval AUL_R_ERROR - general error
641 * If you don't want to launch the app,
642 * you should check app's running state with aul_app_is_running.
643 * This API will launch the application if the application is not running.
644 * If you want to only resume without launching in multiple instance application model,
645 * you should use aul_resume_pid.
646 * This API is only available to System user.
648 int aul_resume_app_for_uid(const char *appid, uid_t uid);
652 * This API trigger to resume application
653 * If the application is running, this API send a resume event to the App.
654 * If the application is not running, this API return AUL_R_ERROR.
655 * Although the application is running, if the application cannot receive resume event,
656 * AUL try to raise the application's default windows.
658 * This API is for caller.
659 * This API's purpose is to send resume event.
660 * @par Typical use case:
661 * In multiple application model, If you want to only resume specific application, Use this API
663 * @param[in] pid application's pid to be resumed
664 * @return 0 if success, negative value(<0) if fail
665 * @retval AUL_R_OK - success
666 * @retval AUL_R_EINVAL - invaild pid
667 * @retval AUL_R_ECOM - internal AUL IPC error
668 * @retval AUL_R_ERROR - general error (include application is not running)
669 * @warning This API need to require root or inhouse permisssion \n
670 * If you have not the permission, this API return AUL_R_ERROR. \n
675 * #include <bundle.h>
677 * int iterfunc(const aul_app_info *info, void *data)
679 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
680 * aul_resume_pid(info->pid);
683 * int iterate_running_apps()
685 * return aul_app_get_running_app_info(iterfunc,NULL);
690 * This API is only available in User Session.
692 int aul_resume_pid(int pid);
696 * This API trigger to resume application
697 * If the application is running, this API send a resume event to the App.
698 * If the application is not running, this API return AUL_R_ERROR.
699 * Although the application is running, if the application cannot receive resume event,
700 * AUL try to raise the application's default windows.
702 * This API is for caller.
703 * This API's purpose is to send resume event.
704 * @par Typical use case:
705 * In multiple application model, If you want to only resume specific application, Use this API
707 * @param[in] pid application's pid to be resumed
708 * @param[in] uid User ID
709 * @return 0 if success, negative value(<0) if fail
710 * @retval AUL_R_OK - success
711 * @retval AUL_R_EINVAL - invaild pid
712 * @retval AUL_R_ECOM - internal AUL IPC error
713 * @retval AUL_R_ERROR - general error (include application is not running)
714 * @warning This API need to require root or inhouse permisssion \n
715 * If you have not the permission, this API return AUL_R_ERROR. \n
717 * This API is only available to System user.
719 int aul_resume_pid_for_uid(int pid, uid_t uid);
723 * This API trigger to terminate application
725 * If the application is running, this API send a terminate event to the App. \n
726 * If the app cannot receive the event, AUL kill forcely the application.\n
728 * This API's purpose is to kill application
729 * @par Typical use case:
730 * In general, Application like Task Manager use this API.
732 * This API need to require root or inhouse permisssion. \n
734 * @param[in] pid application's pid to be terminated
735 * @return 0 if success, negative value(<0) if fail
736 * @retval AUL_R_OK - success
737 * @retval AUL_R_EINVAL - invaild pid
738 * @retval AUL_R_ECOM - internal AUL IPC error
739 * @retval AUL_R_ERROR - general error
740 * @warning This API need to require root or inhouse permisssion. \n
744 * #include <bundle.h>
746 * int iterfunc(const aul_app_info *info, void *data)
748 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
749 * aul_terminate_pid(info->pid);
752 * int iterate_running_apps()
754 * return aul_app_get_running_app_info(iterfunc,NULL);
759 * If you have not the permission, this API return AUL_R_ERROR. \n
760 * This API is only available in User Session.
762 int aul_terminate_pid(int pid);
766 * This API trigger to terminate application
768 * If the application is running, this API send a terminate event to the App. \n
769 * If the app cannot receive the event, AUL kill forcely the application.\n
771 * This API's purpose is to kill application
772 * @par Typical use case:
773 * In general, Application like Task Manager use this API.
775 * This API need to require root or inhouse permisssion. \n
777 * @param[in] pid application's pid to be terminated
778 * @param[in] uid User ID
779 * @return 0 if success, negative value(<0) if fail
780 * @retval AUL_R_OK - success
781 * @retval AUL_R_EINVAL - invaild pid
782 * @retval AUL_R_ECOM - internal AUL IPC error
783 * @retval AUL_R_ERROR - general error
784 * @warning This API need to require root or inhouse permisssion. \n
787 * If you have not the permission, this API return AUL_R_ERROR. \n
788 * This API is only available to System user.
790 int aul_terminate_pid_for_uid(int pid, uid_t uid);
794 * This API trigger to terminate application asynchronously
796 * If the application is running, this API send a terminate event to the App. \n
797 * If the app cannot receive the event, AUL kill forcely the application.\n
799 * This API's purpose is to kill application
800 * @par Typical use case:
801 * In general, Application like Task Manager use this API.
803 * This API need to require root or inhouse permisssion. \n
805 * @param[in] pid application's pid to be terminated
806 * @return 0 if success, negative value(<0) if fail
807 * @retval AUL_R_OK - success
808 * @retval AUL_R_EINVAL - invaild pid
809 * @retval AUL_R_ECOM - internal AUL IPC error
810 * @retval AUL_R_ERROR - general error
811 * @warning This API need to require root or inhouse permisssion. \n
813 * If you have not the permission, this API return AUL_R_ERROR. \n
814 * This API is only available in User Session.
816 int aul_terminate_pid_async(int pid);
820 * This API trigger to terminate application asynchronously
822 * If the application is running, this API send a terminate event to the App. \n
823 * If the app cannot receive the event, AUL kill forcely the application.\n
825 * This API's purpose is to kill application
826 * @par Typical use case:
827 * In general, Application like Task Manager use this API.
829 * This API need to require root or inhouse permisssion. \n
831 * @param[in] pid application's pid to be terminated
832 * @param[in] uid User ID
833 * @return 0 if success, negative value(<0) if fail
834 * @retval AUL_R_OK - success
835 * @retval AUL_R_EINVAL - invaild pid
836 * @retval AUL_R_ECOM - internal AUL IPC error
837 * @retval AUL_R_ERROR - general error
838 * @warning This API need to require root or inhouse permisssion. \n
840 * If you have not the permission, this API return AUL_R_ERROR. \n
841 * This API is only available to System user.
843 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
847 * This API trigger to terminate application synchronously
849 * If the application is running, this API sends a terminate event to the application. \n
850 * And then, this API waits until the application is terminated successfully. \n
851 * If the app cannot receive the event, AUL kill forcely the application. \n
853 * This API's purpose is to kill application
854 * @par Typical use case:
855 * In general, Application like Task Manager use this API.
857 * This API need to require root or platform level permisssion. \n
859 * @param[in] pid application's pid to be terminated
860 * @return 0 if success, negative value(<0) if fail
861 * @retval AUL_R_OK - success
862 * @retval AUL_R_EINVAL - invaild pid
863 * @retval AUL_R_ECOM - internal AUL IPC error
864 * @retval AUL_R_ERROR - general error
865 * @warning This API need to require root or platform level permisssion. \n
867 * If you have not the permission, this API return AUL_R_ERROR. \n
868 * This API is only available in User Session.
870 int aul_terminate_pid_sync(int pid);
874 * This API trigger to terminate application synchronously
876 * If the application is running, this API send a terminate event to the application. \n
877 * And then, this API waits until the application is terminated successfully. \n
878 * If the app cannot receive the event, AUL kill forcely the application. \n
880 * This API's purpose is to kill application
881 * @par Typical use case:
882 * In general, Application like Task Manager use this API.
884 * This API need to require root or platform level permisssion. \n
886 * @param[in] pid application's pid to be terminated
887 * @param[in] uid User ID
888 * @return 0 if success, negative value(<0) if fail
889 * @retval AUL_R_OK - success
890 * @retval AUL_R_EINVAL - invaild pid
891 * @retval AUL_R_ECOM - internal AUL IPC error
892 * @retval AUL_R_ERROR - general error
893 * @warning This API need to require root or platform level permisssion. \n
895 * If you have not the permission, this API return AUL_R_ERROR. \n
896 * This API is only available to System user.
898 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
901 *@brief Running application's information structure retrieved by AUL
903 typedef struct _aul_app_info {
904 int pid; /**< app's pid if running*/
905 char *pkg_name; /**< application id */
906 char *app_path; /**< application excutable path */
908 char *pkgid; /**< package id */
909 int status; /**< app's status */
910 int is_sub_app; /**< state whether sub app of app group */
915 * @brief iterator function running with aul_app_get_running_app_info
916 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
917 * @param[out] data user-supplied data
919 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
923 * This API ask a application is running by application package name.
925 * To know whether some application is running or not, use this API
926 * @par Typical use case:
927 * For example, If you want to know browser application running,
928 * you can check it by using this API.
930 * @param[in] pkgname application package name
931 * @return true / false
932 * @retval 1 app_name is running now.
933 * @retval 0 app_name is NOT running now.
938 * int is_running_browser_app()
940 * return aul_app_is_running("org.tizen.browser");
945 * This API is only available in User Session.
948 int aul_app_is_running(const char *appid);
952 * This API ask a application is running by application package name.
954 * To know whether some application is running or not, use this API
955 * @par Typical use case:
956 * For example, If you want to know browser application running,
957 * you can check it by using this API.
959 * @param[in] pkgname application package name
960 * @param[in] uid User ID
961 * @return true / false
962 * @retval 1 app_name is running now.
963 * @retval 0 app_name is NOT running now.
967 * This API is only available to System User.
969 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
973 * This API use to get running application list.
974 * This API call iter_fn with each aul_app_info of running apps when running application is found.
976 * If you want to get running application list, use this API
977 * @par Typical use case:
978 * In general, this API is used by task manager appllication. (running application list viewer)
980 * @param[in] iter_fn iterator function
981 * @param[in] user_data user-supplied data for iter_fn
982 * @return 0 if success, negative value(<0) if fail
983 * @retval AUL_R_OK - success
984 * @retval AUL_R_ERROR - internal error
989 * int iterfunc(const aul_app_info* info, void* data)
991 * printf("\t==========================\n");
992 * printf("\t pkg_name: %s\n", info->appid);
993 * printf("\t app_path: %s\n", info->app_path);
994 * printf("\t running pid: %d\n", info->pid);
995 * printf("\t==========================\n");
999 * int iterate_running_apps()
1001 * return aul_app_get_running_app_info(iterfunc,NULL);
1006 * This API should use if you want to know running application which has desktop files.
1007 * If you want to get all process list, you must iterate process information by using proc filesystem
1008 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1009 * This API is only available in User Session.
1011 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
1015 * This API use to get running application list.
1016 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1018 * If you want to get running application list, use this API
1019 * @par Typical use case:
1020 * In general, this API is used by task manager appllication. (running application list viewer)
1022 * @param[in] iter_fn iterator function
1023 * @param[in] user_data user-supplied data for iter_fn
1024 * @param[in] uid User ID
1025 * @return 0 if success, negative value(<0) if fail
1026 * @retval AUL_R_OK - success
1027 * @retval AUL_R_ERROR - internal error
1030 * This API should use if you want to know running application which has desktop files.
1031 * If you want to get all process list, you must iterate process information by using proc filesystem
1032 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1033 * This API is only available to System user.
1035 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
1039 * This API use to get all running application list, including sub app.
1040 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1042 * If you want to get all running application list, use this API
1043 * @par Typical use case:
1044 * In general, this API is used by task manager application. (running application list viewer)
1046 * @param[in] iter_fn iterator function
1047 * @param[in] user_data user-supplied data for iter_fn
1048 * @return 0 if success, negative value(<0) if fail
1049 * @retval AUL_R_OK - success
1050 * @retval AUL_R_ERROR - internal error
1055 * int iterfunc_status(const aul_app_info *info, void *data)
1057 * printf("\t==========================\n");
1058 * printf("\t pid: %d\n", info->pid);
1059 * printf("\t appid: %s\n", info->appid);
1060 * printf("\t app_path: %s\n", info->app_path);
1061 * printf("\t pkgid: %s\n", info->pkgid);
1062 * printf("\t status: %d\n", info->status);
1063 * printf("\t is_sub_app : %d\n", info->is_sub_app);
1064 * printf("\t==========================\n");
1068 * int iterate_running_apps()
1070 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
1075 * This API should use if you want to know running application which has desktop files.
1076 * If you want to get all process list, you must iterate process information by using proc filesystem
1077 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1078 * This API is only available in User Session.
1080 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
1084 * This API use to get all running application list, including sub app.
1085 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1087 * If you want to get all running application list, use this API
1088 * @par Typical use case:
1089 * In general, this API is used by task manager application. (running application list viewer)
1091 * @param[in] iter_fn iterator function
1092 * @param[in] user_data user-supplied data for iter_fn
1093 * @param[in] uid User ID
1094 * @return 0 if success, negative value(<0) if fail
1095 * @retval AUL_R_OK - success
1096 * @retval AUL_R_ERROR - internal error
1099 * This API should use if you want to know running application which has desktop files.
1100 * If you want to get all process list, you must iterate process information by using proc filesystem
1101 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1102 * This API is only available to System user.
1104 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
1108 * This API get application package name by pid
1110 * If you want to get package name of running application, use this API
1111 * @par Typical use case:
1112 * In general, You can use this API when you want to know caller's information.
1114 * @param[in] pid given pid
1115 * @param[out] pkgname pkgname to be get
1116 * @param[in] len length of pkgname
1117 * @return 0 if success, negative value(<0) if fail
1118 * @retval AUL_R_OK - success
1119 * @retval AUL_R_ERROR - no such a package name
1122 * #include <bundle.h>
1124 * static int app_reset(bundle *b, void *data)
1127 * char appname[255];
1129 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1130 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
1135 * This API is only available in User Session.
1137 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
1141 * This API get application pkgid by pid
1143 * If you want to get pkgid of running application, use this API
1144 * @par Typical use case:
1145 * In general, You can use this API when you want to know caller's information.
1147 * @param[in] pid given pid
1148 * @param[out] pkgid package id
1149 * @param[in] len length of pkgid
1150 * @return 0 if success, negative value(<0) if fail
1151 * @retval AUL_R_OK - success
1152 * @retval AUL_R_ERROR - no such a appid
1156 * #include <bundle.h>
1158 * static int app_reset(bundle *b, void *data)
1163 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1164 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1169 * This API is only available in User Session.
1171 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1175 * This API get application pkgid by pid
1177 * If you want to get pkgid of running application, use this API
1178 * @par Typical use case:
1179 * In general, You can use this API when you want to know caller's information.
1181 * @param[in] pid given pid
1182 * @param[out] pkgid package id
1183 * @param[in] len length of pkgid
1184 * @param[in] uid User ID
1185 * @return 0 if success, negative value(<0) if fail
1186 * @retval AUL_R_OK - success
1187 * @retval AUL_R_ERROR - no such a appid
1190 * This API is also available to System user.
1192 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1196 * This API get application appid by pid
1198 * If you want to get appid of running application, use this API
1199 * @par Typical use case:
1200 * In general, You can use this API when you want to know caller's information.
1202 * @param[in] pid given pid
1203 * @param[out] appid application id
1204 * @param[in] len length of pkgname
1205 * @return 0 if success, negative value(<0) if fail
1206 * @retval AUL_R_OK - success
1207 * @retval AUL_R_ERROR - no such a appid
1210 * #include <bundle.h>
1212 * static int app_reset(bundle *b, void *data)
1217 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1218 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1223 * This API is only available in User Session.
1225 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1229 * This API get application appid by pid
1231 * If you want to get appid of running application, use this API
1232 * @par Typical use case:
1233 * In general, You can use this API when you want to know caller's information.
1235 * @param[in] pid given pid
1236 * @param[out] appid application id
1237 * @param[in] len length of pkgname
1238 * @param[in] uid User ID
1239 * @return 0 if success, negative value(<0) if fail
1240 * @retval AUL_R_OK - success
1241 * @retval AUL_R_ERROR - no such a appid
1243 * This API is also available to System user.
1245 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1249 * This API launch application associated with given filename
1251 * This API is for caller.
1252 * This API launch application based on mime type.
1253 * This API find mime_type associated with file name,
1254 * and then find default app associated with found mime_type
1255 * and then launch the app with filename argument.
1256 * @par Typical use case:
1257 * You can launch application to process given filename.
1258 * That is, Even if you don't know the specific application's pkgname,
1259 * you can launch the applicaiton processing given filename .
1260 * For example, If you want to process image file, you can simply launch image viewer.
1261 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1263 * @param[in] filename filename
1264 * @return callee's pid or 0 if success, negative value if fail\n
1265 * (when no found default app, return 0)
1266 * @retval AUL_R_OK - success
1267 * @retval AUL_R_EINVAL - invalid argument(filename)
1268 * @retval AUL_R_ECOM - internal AUL IPC error
1269 * @retval AUL_R_ERROR - general error
1274 * int view_image_file(char *filename)
1276 * aul_open_file(filename);
1281 * This API is only available in User Session.
1284 int aul_open_file(const char* filename);
1288 * This API launch application associated with given specific mimetype
1290 * This API is for caller.
1291 * This API launch application based on mime type like aul_open_file API.
1292 * But, This API don't find mime_type associated with file name.
1293 * This API use mimetype given by user. By using given mimetype, find default application.
1294 * and then launch the app with filename argument.
1295 * @par Typical use case:
1296 * Some files cannot extract exact mimetype automatically.
1297 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1298 * In this case, You can use this API.
1299 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1300 * and then, use this API with DRM file and extracted mime type.
1302 * @param[in] filename filename
1303 * @param[in] mimetype specific mimetype
1304 * @return callee's pid or 0 if success, negative value if fail\n
1305 * (when no found default app, return 0)
1306 * @retval AUL_R_OK - success
1307 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1308 * @retval AUL_R_ECOM - internal AUL IPC error
1309 * @retval AUL_R_ERROR - general error
1312 * aul_open_file, aul_get_mime_from_file
1316 * int view_drm_image_file(char *drm_filename)
1319 * // you must implement this function
1320 * mimetype = get_mimetype_from_drmfile(drm_filename);
1322 * aul_open_file_with_mimetype(drm_filename,mimetype);
1327 * This API is only available in User Session.
1329 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1333 * This API launch application associated with content like "http://www.samsung.com"
1335 * This API is for caller.
1336 * This API launch application based on mime type.
1337 * This API find mime_type associated with content,
1338 * and then find default app associated with found mime_type,
1339 * and then launch the app with content argument.
1340 * @par Typical use case:
1341 * You can launch application to process given content.
1342 * That is, Even if you don't know the specific application's pkgname,
1343 * you can launch the applicaiton processing given content.
1344 * For example, If you want to process URL "http://www.samsung.com",
1345 * you can simply launch browser.
1346 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1348 * @param[in] content content
1349 * @return callee's pid or 0 if success, negative value if fail\n
1350 * (when no found default app, return 0)
1351 * @retval AUL_R_OK - success
1352 * @retval AUL_R_EINVAL - invalid argument(content)
1353 * @retval AUL_R_ECOM - internal AUL IPC error
1354 * @retval AUL_R_ERROR - general error or no found mimetype
1359 * int view_url(char *url)
1361 * aul_open_content(url);
1366 * This API is only available in User Session.
1369 int aul_open_content(const char* content);
1373 * This API get the default application(appid) associated with MIME type
1375 * This API use to get default application associteted with mimetype
1376 * In general, Setting Application need this API.
1377 * @par Typical use case:
1378 * Setting Application show mapping of default application / mimetype
1380 * @param[in] mimetype a mime type
1381 * @param[out] defapp a application appid of the app
1382 * @param[in] len length of defapp
1383 * @return 0 if success, negative value if fail
1384 * @retval AUL_R_OK - success
1385 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1386 * @retval AUL_R_ERROR - general error or no found mimetype
1389 * aul_set_defapp_with_mime
1393 * void get_text_html_defapp()
1395 * char appname[255];
1396 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1401 * This API is only available in User Session.
1404 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1408 * This API set the default application(appid) associated with MIME type
1410 * This API use to change default application associteted with mimetype
1411 * In general, Setting Application or Installer need this API.
1412 * @par Typical use case:
1413 * Default Application associated with mimetype can be changed by Setting Application or installer
1414 * So, application to process specific mimetype can be substituted.
1416 * @param[in] mimetype a mime type
1417 * @param[in] defapp a application appid of the app to be set
1418 * @return 0 if success, negative value if fail
1419 * @retval AUL_R_OK - success
1420 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1421 * @retval AUL_R_ERROR - general error
1424 * aul_get_defapp_from_mime
1428 * void set_text_html_defapp()
1430 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1435 * This API is only available in User Session.
1437 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1441 * This API get the mimetype associated with filename
1443 * This API use to get mimetype associteted with given filename
1444 * In general, This API use when you want to know only mimetype given filename.
1445 * @par Typical use case:
1446 * For example, In trasfering data through bluetooth,
1447 * additional information like mimetype should be added.
1448 * In such situation, You can get mimetype by using this API.
1450 * @param[in] filename file name
1451 * @param[out] mimetype a mime type
1452 * @param[in] len length of mimetype
1453 * @return 0 if success, negative value if fail
1454 * @retval AUL_R_OK - success
1455 * @retval AUL_R_EINVAL - invalid argument(filename)
1456 * @retval AUL_R_ERROR - general error
1461 * void get_mimetype()
1463 * char mimetype[255];
1464 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1469 * This API is only available in User Session.
1471 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1475 * This API get the mimetype associated with given content
1477 * This API use to get mimetype associteted with given content
1478 * In general, This API use when you want to know only mimetype given content
1479 * @par Typical use case:
1480 * For example, In trasfering data through bluetooth,
1481 * additional information like mimetype should be added.
1482 * In such situation, You can get mimetype by using this API.
1484 * @param[in] content content string like "011-0000-0000"
1485 * @param[out] mimetype a mime type
1486 * @param[in] len length of mimetype
1487 * @return 0 if success, negative value if fail
1488 * @retval AUL_R_OK - success
1489 * @retval AUL_R_EINVAL - invalid argument(content)
1490 * @retval AUL_R_ERROR - general error
1495 * void get_mimetype()
1497 * char mimetype[255];
1498 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1503 * This API is only available in User Session.
1505 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1509 * This API get the icon's name associated with given mimetype
1511 * This API use to get icon's name associteted with given mimetype
1512 * @par Typical use case:
1513 * If you want to show mimetype's icon, use this API.
1515 * @param[in] mimetype a mime type
1516 * @param[out] iconname icon's name
1517 * @param[in] len length of iconname
1518 * @return 0 if success, negative value if fail
1519 * @retval AUL_R_OK - success
1520 * @retval AUL_R_EINVAL - invalid argument(content)
1521 * @retval AUL_R_ERROR - general error (no such mime type)
1526 * void get_mime_icon()
1529 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1534 * This API is only available in User Session.
1536 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1540 * This API get the extensions associated with given mimetype
1542 * This API use to get extensions associteted with given mimetype
1543 * @par Typical use case:
1544 * In general, user is not familiar with mimetype(text/html),
1545 * user is familiar with extenstions(*.html, *.htm)
1546 * So, To show mimetype information to user, use this API
1548 * @param[in] mimetype a mime type
1549 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1550 * @param[in] len length of extlist
1551 * @return 0 if success, negative value if fail
1552 * @retval AUL_R_OK - success
1553 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1554 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1557 * aul_get_mime_description
1561 * void get_extension()
1563 * char extlist[255];
1564 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1569 * Some mimetype don't have extension.
1570 * In that case, You can use aul_get_mime_description.
1571 * This API is only available in User Session.
1573 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1577 * This API get the description associated with given mimetype
1579 * This API use to get description associteted with given mimetype
1580 * @par Typical use case:
1581 * In general, user is not familiar with mimetype(text/html),
1582 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1583 * But, some mimetype don't have extenstion.
1584 * At that time,to show mimetype information to user, use this API
1586 * @param[in] mimetype a mime type
1587 * @param[out] desc description (ex> Call client)
1588 * @param[in] len length of desc
1589 * @return 0 if success, negative value if fail
1590 * @retval AUL_R_OK - success
1591 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1592 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1595 * aul_get_mime_extension
1599 * void get_information_from_mime()
1602 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1603 * aul_get_mime_description("text/html",info,sizeof(info));
1609 * This API is only available in User Session.
1611 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1615 * This API create service result bundle based on bundle received in reset event.
1617 * This API use to create result bundle to send it to caller.
1618 * @par Typical use case:
1619 * This API is for callee which provide application service.\n
1620 * To send result to caller, You must create result bundle. \n
1621 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1623 * @param[in] inb bundle received in reset event
1624 * @param[out] outb bundle to use for returning result
1625 * @return 0 if success, negative value(<0) if fail
1626 * @retval AUL_R_OK - success
1627 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1628 * @retval AUL_R_ERROR - general error
1631 * To create result bundle, You need received original bundle.
1632 * The original bundle can get from app_reset handler.
1636 * aul_send_service_result
1639 * #include <bundle.h>
1641 * int app_reset(bundle *b, void *data)
1643 * ad->recved_bundle = bundle_dup(b);
1648 * bundle* res_bundle;
1649 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1650 * bundle_add(res_bundle, "result", "1");
1651 * aul_send_service_result(res_bundle);
1655 * This API is only available in User Session.
1658 int aul_create_result_bundle(bundle *inb, bundle **outb);
1662 * This API send service result to caller with bundle
1664 * This API is used to send result bundle to caller.
1665 * @par Typical use case:
1666 * This API is for callee which provide application service.\n
1667 * To send result to caller, You can use this API after creating result bundle. \n
1668 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1670 * @param[in] b Result data in bundle format
1671 * @return 0 if success, negative value(<0) if fail
1672 * @retval AUL_R_OK - success
1673 * @retval AUL_R_EINVAL - invalid result bundle
1674 * @retval AUL_R_ECOMM - internal AUL IPC error
1675 * @retval AUL_R_ERROR - general error
1678 * To send result bundle, You must create result bundle.
1679 * see aul_create_result_bundle
1683 * aul_create_result_bundle
1686 * #include <bundle.h>
1688 * int app_reset(bundle *b, void *data)
1690 * ad->recved_bundle = bundle_dup(b);
1695 * bundle* res_bundle;
1696 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1697 * bundle_add(res_bundle, "result", "1");
1698 * aul_send_service_result(res_bundle);
1702 * This API is only available in User Session.
1705 int aul_send_service_result(bundle *b);
1709 * This API sets callback fuction that will be called when applications die.
1711 * This API's purpose is to listen the application dead event.
1712 * In general, task manager Application need this API.
1714 * @param[in] func callback function
1715 * @param[in] data user data
1716 * @return 0 if success, negative value if fail
1717 * @retval AUL_R_OK - success
1718 * @retval AUL_R_ERROR - general error
1721 * aul_listen_app_launch_signal
1725 * int app_dead_handler(int pid, void *data)
1727 * printf("===> %s : %d\n", __FUNCTION__, pid);
1731 * void dead_listen()
1733 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1738 * This API is only available in User Session.
1741 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1745 * This API sets callback fuction that will be called when applications are launched.
1747 * This API's purpose is to listen the application launching event.
1748 * In general, task manager Application need this API.
1750 * @param[in] func callback function
1751 * @param[in] data user data
1752 * @return 0 if success, negative value if fail
1753 * @retval AUL_R_OK - success
1754 * @retval AUL_R_ERROR - general error
1757 * aul_listen_app_dead_signal
1761 * int app_launch_handler(int pid, void *data)
1763 * printf("===> %s : %d\n", __FUNCTION__, pid);
1767 * void dead_listen()
1769 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1774 * This API is only available in User Session.
1777 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1781 * This API sets callback fuction that will be called when applications are launched.
1783 * This API's purpose is to listen the application launching event.
1784 * In general, task manager Application need this API.
1786 * @param[in] func callback function
1787 * @param[in] data user data
1788 * @return 0 if success, negative value if fail
1789 * @retval AUL_R_OK - success
1790 * @retval AUL_R_ERROR - general error
1793 * aul_listen_app_dead_signal
1797 * int app_launch_handler(int pid, const char *app_id, void *data)
1799 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1803 * void dead_listen()
1805 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1810 * This API is only available in User Session.
1813 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1817 * This API gets status of specified application process id.
1819 * This API's purpose is to get the application's status.
1821 * @param[in] pid pid of application
1822 * @return 0 or greater if success, nagative value if fail
1823 * @retval STATUS_LAUNCHING
1824 * @retval STATUS_VISIBLE
1826 * @retval STATUS_DYING
1827 * @retval STATUS_NORESTART
1833 * int iterfunc(const aul_app_info *info, void *data)
1836 * status = aul_app_get_status_bypid(info->pid);
1837 * if (status == STATUS_VISIBLE) {
1838 * printf("%s has focus", info->app_id);
1839 * (int *)data = info->pid;
1845 * int find_focus_app_pid()
1848 * aul_app_get_running_app_info(iterfunc, &pid);
1853 * This API is only available in User Session.
1855 int aul_app_get_status_bypid(int pid);
1859 * This API gets status of specified application process id.
1861 * This API's purpose is to get the application's status.
1863 * @param[in] pid pid of application
1864 * @param[in] uid User ID
1865 * @return 0 or greater if success, nagative value if fail
1866 * @retval STATUS_LAUNCHING
1867 * @retval STATUS_VISIBLE
1869 * @retval STATUS_DYING
1870 * @retval STATUS_NORESTART
1873 * This API is only available to System user.
1875 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1879 * This API gets the status of specified application id.
1881 * This API's purpose is to get the status of the application.
1883 * @param[in] appid application ID
1884 * @return 0 or greater if success, nagative value if fail
1885 * @retval STATUS_LAUNCHING
1886 * @retval STATUS_FOCUS
1887 * @retval STATUS_VISIBLE
1889 * @retval STATUS_DYING
1890 * @retval STATUS_NORESTART
1900 * status = aul_app_get_status("org.tizen.helloworld");
1901 * if (status == STATUS_FOCUS)
1902 * printf("org.tizen.helloworld has focus");
1909 * This API is only available in User Session.
1911 int aul_app_get_status(const char *appid);
1915 * This API gets the status of specified application id.
1917 * This API's purpose is to get the status of the application
1919 * @param[in] appid application ID
1920 * @param[in] uid User ID
1921 * @return 0 or greater if success, nagative value if fail
1922 * @retval STATUS_LAUNCHING
1923 * @retval STATUS_FOCUS
1924 * @retval STATUS_VISIBLE
1926 * @retval STATUS_DYING
1927 * @retval STATUS_NORESTART
1930 * This API is only available to System user.
1932 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1936 * This API sets callback function that on application status changed.
1938 * This API's purpose is to listen the application's status changed within
1939 * the caller process. In general, a library that required to release resource on
1940 * application's status may use this API.
1942 * @param[in] func callback function
1943 * @param[in] data user data
1944 * @return 0 if success, negative value if fail
1945 * @retval AUL_R_OK - success
1946 * @retval AUL_R_ERROR - general error
1948 * aul_remove_status_local_cb
1952 * int status_changed(int status, void *data)
1954 * if (status == STATUS_VISIBLE)
1955 * printf("%d resume\n", getpid());
1957 * if (status == STATUS_BG)
1958 * printf("%d pause\n", getpid());
1961 * void listen_app_status()
1963 * aul_add_status_local_cb(status_changed, NULL);
1967 * This API is only available in User Session.
1970 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1974 * This API unsets callback function that on application status changed.
1976 * This API's purpose is to remove callback that added by
1977 * aul_add_status_local_cb.
1979 * @param[in] func callback function
1980 * @param[in] data user data
1981 * @return 0 if success, negative value if fail
1982 * @retval AUL_R_OK - success
1983 * @retval AUL_R_ERROR - general error
1986 * aul_add_status_local_cb
1990 * int status_changed(int status, void *data)
1992 * if (status == STATUS_VISIBLE)
1993 * printf("%d resume\n", getpid());
1995 * if (status == STATUS_BG)
1996 * printf("%d pause\n", getpid());
1999 * void listen_app_status()
2001 * aul_add_status_local_cb(status_changed, NULL);
2004 * void ignore_app_status()
2006 * aul_remove_status_local_cb(status_changed, NULL);
2011 * This API is only available in User Session.
2014 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
2017 * This API is only for appfw internally.
2019 int aul_set_process_group(int parent_pid, int child_pid);
2022 * This API is only for Appfw internally.
2024 int aul_terminate_bgapp_pid(int pid);
2027 * This API is only for Appfw internally.
2029 int aul_terminate_pid_without_restart(int pid);
2032 * This API is only for Appfw internally.
2034 int aul_terminate_pid_sync_without_restart(int pid);
2037 * This API is only for Appfw internally.
2039 int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
2042 * This API is only for Appfw internally.
2044 const char *aul_get_app_external_root_path(void);
2047 * This API is only for Appfw internally.
2049 const char *aul_get_app_root_path(void);
2052 * This API is only for Appfw internally.
2054 const char *aul_get_app_data_path(void);
2057 * This API is only for Appfw internally.
2059 const char *aul_get_app_cache_path(void);
2062 * This API is only for Appfw internally.
2064 const char *aul_get_app_resource_path(void);
2067 * This API is only for Appfw internally.
2069 const char *aul_get_app_tep_resource_path(void);
2072 * This API is only for Appfw internally.
2074 int aul_get_app_shared_data_path(char **path);
2077 * This API is only for Appfw internally.
2079 const char *aul_get_app_shared_resource_path(void);
2082 * This API is only for Appfw internally.
2084 const char *aul_get_app_shared_trusted_path(void);
2087 * This API is only for Appfw internally.
2089 const char *aul_get_app_external_data_path(void);
2092 * This API is only for Appfw internally.
2094 const char *aul_get_app_external_cache_path(void);
2097 * This API is only for Appfw internally.
2099 const char *aul_get_app_external_shared_data_path(void);
2102 * This API is only for Appfw internally.
2104 const char *aul_get_app_specific_path(void);
2107 * This API is only for Appfw internally.
2109 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2112 * This API is only for Appfw internally.
2114 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2117 * This API is only for Appfw internally.
2119 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2122 * This API is only for Appfw internally.
2124 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2127 * This API is only for Appfw internally.
2129 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2132 * This API is only for Appfw internally.
2134 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2137 * This API is only for Appfw internally.
2139 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2142 * This API is only for Appfw internally.
2144 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2147 * This type is only for Appfw internally.
2149 typedef int (*subapp_fn)(void *data);
2152 * This API is only for Appfw internally.
2154 int aul_set_subapp(subapp_fn cb, void *data);
2157 * This API is only for Appfw internally.
2159 int aul_subapp_terminate_request_pid(int pid);
2162 * This API is only for Appfw internally.
2164 int aul_is_subapp(void);
2167 * This API is only for Appfw internally.
2169 int aul_kill_pid(int pid);
2172 * This API is only for Appfw internally.
2174 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2177 * This API is only for Appfw internally.
2179 int aul_remove_caller_cb(int pid, void *data);
2182 * This API is only for Appfw internally.
2184 int aul_invoke_caller_cb(void *data);
2187 * This API is only for Appfw internally.
2189 void aul_set_preinit_window(void *evas_object);
2192 * This API is only for Appfw internally.
2194 void* aul_get_preinit_window(const char *win_name);
2197 * This API is only for Appfw internally.
2199 void aul_set_preinit_background(void *evas_object);
2202 * This API is only for Appfw internally.
2204 void* aul_get_preinit_background(void);
2207 * This API is only for Appfw internally.
2209 void aul_set_preinit_conformant(void *evas_object);
2212 * This API is only for Appfw internally.
2214 void* aul_get_preinit_conformant(void);
2217 * This API is only for Appfw internally.
2219 void aul_set_preinit_appid(const char *appid);
2222 * This API is only for Appfw internally.
2224 void aul_set_preinit_pkgid(const char *pkgid);
2227 * This API is only for Appfw internally.
2229 void aul_set_preinit_root_path(const char *root_path);
2232 * This API is only for Appfw internally.
2234 const char *aul_get_preinit_root_path(void);
2237 * This API is only for Appfw internally.
2239 int aul_update_freezer_status(int pid, const char* type);
2242 * This API is only for Appfw internally.
2244 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2247 * This API is only for Appfw internally.
2249 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2252 * This API is only for Appfw internally.
2254 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2257 * This API is only for Appfw internally.
2259 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2262 * This API is only for Appfw internally.
2264 int aul_send_app_terminated_signal(int pid);
2267 * This API is only for Appfw internally.
2269 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2272 * This API is only for Appfw internally.
2274 int aul_invoke_status_local_cb(int status);
2277 * This type is only for Appfw internally.
2279 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2282 * This API is only for Appfw internally.
2284 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2287 * This API is only for Appfw internally.
2289 int aul_unset_data_control_provider_cb(void);
2292 * This API is only for Appfw internally.
2294 int aul_pause_app(const char *appid);
2297 * This API is only for Appfw internally.
2299 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2302 * This API is only for Appfw internally.
2304 int aul_pause_pid(int pid);
2307 * This API is only for Appfw internally.
2309 int aul_pause_pid_for_uid(int pid, uid_t uid);
2312 * This API is only for Appfw internally.
2314 int aul_reload_appinfo(void);
2317 * This API is only for Appfw internally.
2319 int aul_status_update(int status);
2322 * This API is only for Appfw internally.
2324 int aul_running_list_update(char *appid, char *app_path, char *pid);
2327 * This API is only for Appfw internally.
2329 int aul_app_group_get_window(int pid);
2332 * This API is only for Appfw internally.
2334 int aul_app_group_set_window(int wid);
2337 * This API is only for Appfw internally.
2339 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2342 * This API is only for Appfw internally.
2344 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2347 * This API is only for Appfw internally.
2349 int aul_app_group_get_leader_pid(int pid);
2352 * This API is only for Appfw internally.
2354 int aul_app_group_clear_top(void);
2357 * This API is only for Appfw internally.
2359 int aul_app_group_is_top(void);
2362 * This API is only for Appfw internally.
2364 int aul_app_group_get_fg_flag(int pid);
2367 * This API is only for Appfw internally.
2369 void aul_app_group_lower(int *exit);
2372 * This API is only for Appfw internally.
2374 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2378 * This API puts some app below the caller app
2380 * This API's purpose is to reorder window stack limitedly.
2382 * @param[in] below_appid The appid to be reordered below the caller app
2383 * @return 0 success, negative value(<0) if fail
2386 * below_appid should be main app which have been launched before.
2387 * This API is only available in User Session.
2389 int aul_app_group_activate_below(const char *below_appid);
2393 * This API puts some app above the caller app
2395 * This API's purpose is to reorder window stack limitedly.
2397 * @param[in] above_appid The appid to be reordered above the caller app
2398 * @return 0 if success, negative value(<0) if fail
2401 * above_appid should be main app which have been launched before.
2402 * This API is only available in User Session.
2404 int aul_app_group_activate_above(const char *above_appid);
2407 * This API is only for Appfw internally.
2409 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2411 * This API is only for Appfw internally.
2413 int aul_request_message_port_socket_pair(int *fd);
2415 * This API is only for Appfw internally.
2417 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2420 * This API is only for Appfw internally.
2422 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2426 * This API registers a callback function that will be called when the
2427 * status of the application is changed.
2429 * This API is for monitoring the status of all applications.
2431 * @param[in] func callback function
2432 * @param[in] data user data
2433 * @return 0 if success, negative value if fail
2434 * @retval AUL_R_OK - success
2435 * @retval AUL_R_ERROR - general error
2440 * int app_status_handler(int pid, int status, void *data)
2442 * const char *app_status;
2446 * app_status = "STATUS_LAUNCHING";
2449 * app_status = "STATUS_VISIBLE";
2452 * app_status = "STATUS_BACKGROUND";
2455 * app_status = "STATUS_FOCUS";
2458 * app_status = "STATUS_UNKNOWN";
2461 * printf("pid: %d, status: %s", pid, status);
2465 * int main(int argc, char **argv)
2469 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2470 * if (ret != AUL_R_OK) {
2471 * printf("Failed to add status handler");
2481 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2484 * This API is only for Appfw internally.
2486 int aul_check_tep_mount(const char *tep_path);
2489 * This API is only for Appfw internally.
2491 int aul_is_tep_mount_dbus_done(const char *tep_string);
2494 * This API is only for Appfw internally.
2496 int aul_forward_app(const char *appid, bundle *kb);
2500 * This API create custom launchpad-loader
2502 * This API's purpose is to make a slot for custom loader.
2503 * Once it is made, added loader will make a candidate process to use.
2505 * @param[in] loader_path The file name of the custom loader binary including full path
2506 * @param[in] extra A bundle to be passed to the custom loader
2507 * @return Loader ID if success, negative value(<0) if fail
2510 * This API is only for Appfw internally.
2511 * This API is only available in User Session.
2513 int aul_add_loader(const char *loader_path, bundle *extra);
2517 * This API create custom launchpad-loader
2519 * This API's purpose is to make a slot for custom loader.
2520 * Once it is made, added loader will make a candidate process to use.
2522 * @param[in] loader_path The file name of the custom loader binary including full path
2523 * @param[in] extra A bundle to be passed to the custom loader
2524 * @param[in] uid User ID
2525 * @return Loader ID if success, negative value(<0) if fail
2528 * This API is only for Appfw internally.
2529 * This API is only available to System user.
2531 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2536 * This API destroy custom launchpad-loader
2538 * This API's purpose is to remove a slot for custom loader.
2539 * Once it is removed, the prepared process will be removed as well.
2541 * @param[in] loader_id Loader ID
2542 * @return 0 if success, negative value(<0) if fail
2545 * This API is only for Appfw internally.
2546 * This API is only available in User Session.
2548 int aul_remove_loader(int loader_id);
2552 * This API destroy custom launchpad-loader
2554 * This API's purpose is to remove a slot for custom loader.
2555 * Once it is removed, the prepared process will be removed as well.
2557 * @param[in] loader_id Loader ID
2558 * @param[in] uid User ID
2559 * @return 0 if success, negative value(<0) if fail
2562 * This API is only for Appfw internally.
2563 * This API is only available to System user.
2565 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2569 * This API gets specified application process id.
2571 * The purpose of this API is to get the pid of specified application.
2573 * @param[in] appid application name
2574 * @return callee's pid if success, negative value(<0) if fail
2577 * This API is only available in User Session.
2579 int aul_app_get_pid(const char *appid);
2583 * This API gets specified application process id.
2585 * The purpose of this API is to get the pid of specified application.
2587 * @param[in] appid application name
2588 * @param[in] uid User ID
2589 * @return callee's pid if success, negative value(<0) if fail
2592 * This API is only available to System user.
2594 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2598 * This function update rua stat.
2600 * @param[in] b Bundle object contains caller and tag information.
2601 * @param[in] uid Target uid
2603 * @return 0 if success, negative value(<0) if fail
2605 * @remarks This API is only for Appfw internally.
2614 bundle *b = bundle_create();
2615 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2616 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2618 r = aul_update_rua_stat_for_uid(b);
2623 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2627 * This function add rua history.
2629 * @param[in] b Bundle object Target Package name or app path.
2630 * @param[in] uid Target uid
2632 * @return 0 if success, negative value(<0) if fail
2634 * @remarks This API is only for Appfw internally.
2643 bundle *b = bundle_create();
2645 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2647 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2649 r = aul_add_rua_history_for_uid(b);
2654 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2658 * This function delete rua history.
2660 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2661 * @param[in] uid Target uid
2663 * @return 0 if success, negative value(<0) if fail
2665 * @remarks This API is only for Appfw internally.
2676 b = bundle_create();
2677 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2679 r = aul_delete_rua_history_for_uid(b, getuid());
2684 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2689 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2691 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2693 * @return 0 if success, negative value(<0) if fail
2695 * @remarks This API is only for Appfw internally.
2700 #include <aul_svc.h>
2705 bundle *b = bundle_create();
2707 const char *appid = "org.tizen.test";
2708 const char *operation = "test_operation";
2709 const char *mime_type = "test_mime";
2710 const char *uri = "test_uri";
2712 aul_svc_set_operation(b, operation);
2713 aul_svc_set_mime(b, mime_type);
2714 aul_svc_set_uri(b, uri);
2716 aul_svc_set_appid(b, appid)
2718 r = aul_set_default_app_by_operation(b);
2723 int aul_set_default_app_by_operation(bundle *b);
2727 * This API unset the default application(application id) associated with operation, uri and mime-type.
2729 * @param[in] app_id The ID of the application
2731 * @return 0 if success, negative value(<0) if fail
2744 aul_unset_default_app_by_operation("org.tizen.test");
2749 int aul_unset_default_app_by_operation(const char *app_id);
2753 * This API launches application with the given bundle asynchronously.
2754 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2755 * If the application is running, this API sends a RESET event to the App.
2756 * While the application is running, if the application cannot receive the RESET event,
2757 * this API returns a general error(AUL_R_ERROR).\n
2759 * This API is for caller.
2760 * This API's purpose is to launch/reset application with given bundle.
2761 * @par Typical use case:
2762 * If you know the target application's pkgname and bundle types,
2763 * you can use this API to launch/reset the application.
2765 * @param[in] pkgname package name to be run as callee
2766 * @param[in] kb bundle to be passed to callee
2767 * @return 0 if success, negative value(<0) if fail
2768 * @retval AUL_R_OK - success
2769 * @retval AUL_R_EINVAL - invaild package name
2770 * @retval AUL_R_ECOM - internal AUL IPC error
2771 * @retval AUL_R_ERROR - general error
2774 * This API is only available in User Session.
2775 * This API doesn't check whether the callee application is executed successfully.
2777 int aul_launch_app_async(const char *appid, bundle *kb);
2781 * This API launches application with the given bundle asynchronously.
2782 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2783 * If the application is running, this API sends a RESET event to the App.
2784 * While the application is running, if the application cannot receive the RESET event,
2785 * this API returns a general error(AUL_R_ERROR).\n
2787 * This API is for caller.
2788 * This API's purpose is to launch/reset application with given bundle.
2789 * @par Typical use case:
2790 * If you know the target application's pkgname and bundle types,
2791 * you can use this API to launch/reset the application.
2793 * @param[in] pkgname package name to be run as callee
2794 * @param[in] kb bundle to be passed to callee
2795 * @param[in] uid User ID
2796 * @return 0 if success, negative value(<0) if fail
2797 * @retval AUL_R_OK - success
2798 * @retval AUL_R_EINVAL - invaild package name
2799 * @retval AUL_R_ECOM - internal AUL IPC error
2800 * @retval AUL_R_ERROR - general error
2803 * This API is only available to System user.
2804 * This API doesn't check whether the callee application is executed successfully.
2806 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2810 * This API request launchpad to make candidate processes.
2812 * @return 0 if success, negative value(<0) if fail
2815 * This API is only available in User Session.
2817 int aul_prepare_candidate_process(void);
2820 * This API is only for Appfw internally.
2822 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2825 * This API is only for Appfw internally.
2827 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2830 * This API is only for Appfw internally.
2832 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2835 * This API is only for Appfw internally.
2837 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2840 * This API is only for Appfw internally.
2842 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2845 * This API is only for Appfw internally.
2847 int aul_widget_instance_count(const char *widget_id);
2851 * This API gets the last caller process id of specified application process id.
2853 * This API's purpose is to get the application's last caller process id.
2855 * @param[in] pid pid of application
2856 * @return caller pid if success, nagative value if fail
2859 * This API is only available in User Session.
2861 int aul_app_get_last_caller_pid(int pid);
2865 * This API gets the last caller process id of specified application process id.
2867 * This API's purpose is to get the last caller process id of the application.
2869 * @param[in] pid pid of application
2870 * @param[in] uid User ID
2871 * @return caller pid if success, nagative value if fail
2874 * This API is only available in System users.
2876 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2880 * This API trigger to resume application asynchronously.
2881 * If the application is running, this API send a resume event to the App.
2882 * If the application is not running, this API return AUL_R_ERROR.
2883 * Although the application is running, if the application cannot receive resume event,
2884 * AUL try to raise the application's default windows.
2886 * This API is for caller.
2887 * This API's purpose is to send resume event.
2888 * @par Typical use case:
2889 * In multiple application model, If you want to only resume specific application, Use this API
2891 * @param[in] pid application's pid to be resumed
2892 * @return 0 if success, negative value(<0) if fail
2893 * @retval AUL_R_OK - success
2894 * @retval AUL_R_EINVAL - invaild pid
2895 * @retval AUL_R_ECOM - internal AUL IPC error
2896 * @retval AUL_R_ERROR - general error (include application is not running)
2897 * @warning This API need to require root or inhouse permisssion \n
2898 * If you have not the permission, this API return AUL_R_ERROR. \n
2900 * This API is only available to User Session.
2902 int aul_resume_pid_async(int pid);
2906 * This API trigger to resume application asynchronously.
2907 * If the application is running, this API send a resume event to the App.
2908 * If the application is not running, this API return AUL_R_ERROR.
2909 * Although the application is running, if the application cannot receive resume event,
2910 * AUL try to raise the application's default windows.
2912 * This API is for caller.
2913 * This API's purpose is to send resume event.
2914 * @par Typical use case:
2915 * In multiple application model, If you want to only resume specific application, Use this API
2917 * @param[in] pid application's pid to be resumed
2918 * @param[in] uid User ID
2919 * @return 0 if success, negative value(<0) if fail
2920 * @retval AUL_R_OK - success
2921 * @retval AUL_R_EINVAL - invaild pid
2922 * @retval AUL_R_ECOM - internal AUL IPC error
2923 * @retval AUL_R_ERROR - general error (include application is not running)
2924 * @warning This API need to require root or inhouse permisssion \n
2925 * If you have not the permission, this API return AUL_R_ERROR. \n
2927 * This API is only available to System user.
2929 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2933 * This API set the alias appid.
2934 * The alias appid is only available for the aul_svc_set_appid() API.
2935 * If the appid is not available, this API returns an error.
2937 * @privlevel platform
2938 * @privilege %http://tizen.org/privilege/systemsettings.admin
2939 * @param[in] alias_appid an alias application ID
2940 * @param[in] appid an application ID
2941 * @return 0 if success, negative value(<0) if fail
2944 * This API is only available to User Session.
2946 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2950 * This API unset the alias appid.
2952 * @privlevel platform
2953 * @privilege %http://tizen.org/privilege/systemsettings.admin
2954 * @param[in] alias_appid an alias application ID
2955 * @return 0 if success, negative value(<0) if fail
2958 * This API is only available to User Session.
2960 int aul_unset_alias_appid(const char *alias_appid);
2964 * This API activates the alias information based on the given appid.
2966 * @privlevel platform
2967 * @privilege %http://tizen.org/privilege/systemsettings.admin
2968 * @param[in] appid an application ID
2969 * @return 0 if success, negative value(<0) if fail
2972 * This API is only available to User Session.
2974 int aul_enable_alias_info(const char *appid);
2978 * This API deactivates the alias information based on the given appid.
2980 * @privlebel platform
2981 * @privilege %http://tizen.org/privilege/systemsettings.admin
2982 * @param[in] appid an application ID
2983 * @return 0 if success, negative value(<0) if fail
2986 * This API is only available to User Session.
2988 int aul_disable_alias_info(const char *appid);
2991 * This API is only for Appfw internally.
2993 API int aul_listen_app_status(const char *appid,
2994 int (*aul_handler)(const char *appid, const char *pkgid,
2995 int pid, int status, int is_subapp, void *data),
2999 * This API is only for Appfw internally.
3001 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);
3005 * Gets running application instance info
3006 * This API calls the iter_fn with the aul_app_info when running app instance info is found.
3008 * @param[in] iter_fn iterative function
3009 * @param[in] user_data User data
3010 * @return 0 if success, negative value(<0) if fail
3011 * @retval AUL_R_OK Successful
3012 * @retval AUL_R_ERROR General error
3013 * @retval AUL_R_EINVAL Invalid parameter
3015 int aul_app_get_running_app_instance_info(aul_app_info_iter_fn iter_fn,
3017 int aul_app_get_running_app_instance_info_for_uid(aul_app_info_iter_fn iter_fn,
3018 void *user_data, uid_t uid);
3021 * This API is only for Appfw internally.
3023 int aul_app_get_instance_id_bypid(int pid, char *instance_id, int len);
3024 int aul_app_get_instance_id_bypid_for_uid(int pid, char *instance_id,
3025 int len, uid_t uid);
3028 * This API is only for Appfw internally.
3030 int aul_resume_app_by_instance_id(const char *appid, const char *instance_id);
3031 int aul_resume_app_by_instance_id_for_uid(const char *appid,
3032 const char *instance_id, uid_t uid);