Tizen(Headed) Native API
6.5
|
The Component Manager API provides functions to get information about installed or running components and manage the components.
Required Header
#include <component_manager.h>
Overview
The Component Manager API provides functions to retrieve components information and to manager components. There are two iterator functions that retrieve components. One is component_manager_foreach_component_context(), which gets the information of running components, the other is component_manager_foreach_component_info(), which gets the information of installed components. The registered callback function is called as much as components exist in the list. An application can get the component's properties such as a name, a type, an icon path in the callback function. Resuming components or terminating background components are also supported to handle components.
Functions | |
int | component_manager_foreach_component_context (component_manager_component_context_cb callback, void *user_data) |
Retrieves all component contexts of running components. | |
int | component_manager_foreach_component_info (component_manager_component_info_cb callback, void *user_data) |
Retrieves all installed components information. | |
int | component_manager_get_component_context (const char *comp_id, component_context_h *handle) |
Gets the component context for the given component ID. | |
int | component_manager_get_component_info (const char *comp_id, component_info_h *handle) |
Gets the component information for the given component ID. | |
int | component_manager_is_running (const char *comp_id, bool *running) |
Checks whether the component is running or not. | |
int | component_manager_resume_component (component_context_h handle) |
Resumes the component. | |
int | component_manager_terminate_bg_component (component_context_h handle) |
Terminates the background component. | |
Typedefs | |
typedef bool(* | component_manager_component_context_cb )(component_context_h handle, void *user_data) |
Called whenever the application retrieves the context of running components. | |
typedef bool(* | component_manager_component_info_cb )(component_info_h handle, void *user_data) |
Called whenever the application retrieves the information of installed components. |
Typedef Documentation
typedef bool(* component_manager_component_context_cb)(component_context_h handle, void *user_data) |
Called whenever the application retrieves the context of running components.
- Since :
- 5.5
- Remarks:
- The handle should not be released. The handle can be used only in the callback. To use outside, make a copy using component_context_clone().
- Parameters:
-
[in] handle The component context of each running component [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop,
otherwisefalse
to break out of the loop
- Precondition:
- component_manager_foreach_component_context() will invoke this callback.
typedef bool(* component_manager_component_info_cb)(component_info_h handle, void *user_data) |
Called whenever the application retrieves the information of installed components.
- Since :
- 5.5
- Remarks:
- The handle should not be released. The handle can be used only in the callback. To use outside, make a copy using component_info_clone().
- Parameters:
-
[in] handle The component information of each installed component [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop,
otherwisefalse
to break out of the loop
- Precondition:
- component_manager_foreach_component_info() will invoke this callback.
Enumeration Type Documentation
Enumerations for Component Manager Error.
- Since :
- 5.5
- Enumerator:
Function Documentation
int component_manager_foreach_component_context | ( | component_manager_component_context_cb | callback, |
void * | user_data | ||
) |
Retrieves all component contexts of running components.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/packagemanager.info
- Parameters:
-
[in] callback The callback function to invoke [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
int component_manager_foreach_component_info | ( | component_manager_component_info_cb | callback, |
void * | user_data | ||
) |
Retrieves all installed components information.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/packagemanager.info
- Parameters:
-
[in] callback The callback function to invoke [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
int component_manager_get_component_context | ( | const char * | comp_id, |
component_context_h * | handle | ||
) |
Gets the component context for the given component ID.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/packagemanager.info
- Remarks:
- This function returns COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT if the component with the given component ID is not running.
You MUST releasehandle
using component_context_destroy().
- Parameters:
-
[in] comp_id The component ID [out] handle The component context of the given component ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
int component_manager_get_component_info | ( | const char * | comp_id, |
component_info_h * | handle | ||
) |
Gets the component information for the given component ID.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/packagemanager.info
- Remarks:
- You MUST release
handle
using component_info_destroy().
- Parameters:
-
[in] comp_id The component ID [out] handle The component information of the given component ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
int component_manager_is_running | ( | const char * | comp_id, |
bool * | running | ||
) |
Checks whether the component is running or not.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/packagemanager.info
- Parameters:
-
[in] comp_id The component ID [out] running true
if the component is running,
otherwisefalse
if not running
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_IO_ERROR I/O error COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
int component_manager_resume_component | ( | component_context_h | handle | ) |
Resumes the component.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/appmanager.launch
- Parameters:
-
[in] handle The component context handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_IO_ERROR I/O error COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
int component_manager_terminate_bg_component | ( | component_context_h | handle | ) |
Terminates the background component.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/appmanager.kill.bgapp
- Remarks:
- This function returns after it just sends a request for terminating a background component. Platform will decide if the target component could be terminated or not according to the state of the target component.
- Parameters:
-
[in] handle The component context handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
COMPONENT_MANAGER_ERROR_NONE Successful COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter COMPONENT_MANAGER_ERROR_IO_ERROR I/O error COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component