Tizen Native API  7.0
Component Context

The Component Context API contains functions for obtaining information about running components.

Required Header

#include <component_manager.h>

Overview

Remarks:
The Component Context API provides information about running components.

Functions

int component_context_destroy (component_context_h handle)
 Destroys the component context handle and releases all its resources.
int component_context_get_app_id (component_context_h handle, char **app_id)
 Gets the application ID of the component.
int component_context_get_component_id (component_context_h handle, char **component_id)
 Gets the ID of the component.
int component_context_get_instance_id (component_context_h handle, char **instance_id)
 Gets the instance ID of the component.
int component_context_get_component_state (component_context_h handle, component_state_e *state)
 Gets the state of the component.
int component_context_is_terminated (component_context_h handle, bool *terminated)
 Checks whether the component is terminated or not.
int component_context_is_subcomponent (component_context_h handle, bool *is_subcomponent)
 Checks whether the component is running as sub component of the group.
int component_context_clone (component_context_h *clone, component_context_h handle)
 Clones the component context handle.

Typedefs

typedef void * component_context_h
 Component context handle.

Typedef Documentation

typedef void* component_context_h

Component context handle.

Since :
5.5

Enumeration Type Documentation

Enumeration for the component state.

Since :
5.5
Enumerator:
COMPONENT_STATE_INITIALIZED 

The initialized state. The state that the component is constructed but the callback for creating a component is not called yet.

COMPONENT_STATE_CREATED 

The created state. The state that the creating callback is called.

COMPONENT_STATE_STARTED 

The started state. The state that the starting callback is called.

COMPONENT_STATE_RESUMED 

The resumed state. The state that the resuming callback is called.

COMPONENT_STATE_PAUSED 

The paused state. The state that the pausing callback is called.

COMPONENT_STATE_DESTROYED 

The destroyed state. The state that right before the destroying callback is called.


Function Documentation

Clones the component context handle.

Since :
5.5
Remarks:
The clone should be released using component_context_destroy().
Parameters:
[out]cloneA newly created component context handle, if cloning is successful
[in]handleThe component context handle
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_MANAGER_ERROR_OUT_OF_MEMORYOut of memory

Destroys the component context handle and releases all its resources.

Since :
5.5
Parameters:
[in]handleThe component context handle
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
int component_context_get_app_id ( component_context_h  handle,
char **  app_id 
)

Gets the application ID of the component.

Since :
5.5
Remarks:
You MUST release app_id using free().
Parameters:
[in]handleThe component context handle
[out]app_idThe application ID
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int component_context_get_component_id ( component_context_h  handle,
char **  component_id 
)

Gets the ID of the component.

Since :
5.5
Remarks:
You MUST release comp_id using free().
Parameters:
[in]handleThe component context handle
[out]component_idThe component ID
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_MANAGER_ERROR_OUT_OF_MEMORYOut of memory

Gets the state of the component.

Since :
5.5
Parameters:
[in]handleThe component context handle
[out]stateThe component state
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
int component_context_get_instance_id ( component_context_h  handle,
char **  instance_id 
)

Gets the instance ID of the component.

Since :
5.5
Remarks:
You MUST release instance_id using free().
Parameters:
[in]handleThe component context handle
[out]instance_idThe instance ID
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int component_context_is_subcomponent ( component_context_h  handle,
bool *  is_subcomponent 
)

Checks whether the component is running as sub component of the group.

Since :
5.5
Parameters:
[in]handleThe component context handle
[out]is_subcomponenttrue if the sub component of the group,
otherwise false if the main component of the group
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
int component_context_is_terminated ( component_context_h  handle,
bool *  terminated 
)

Checks whether the component is terminated or not.

Since :
5.5
Parameters:
[in]handleThe component context handle
[out]terminatedtrue if the component is terminated,
otherwise false if the component is running
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_MANAGER_ERROR_NONESuccessful
COMPONENT_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
COMPONENT_MANAGER_ERROR_IO_ERRORI/O error