Tizen Native API  5.5
Component Based Common

The Component Based Common Registering action for Application Control and Launching request for Application Control.

Required Header

#include <component_common.h>

Overview

The Component Based Common API provides functions for registering and deregistering action for app-control and provides functions for launching request with the app-control synchronous or asynchronous.

Functions

int component_get_id (component_h context, char **id)
 Gets the ID of the component.
int component_get_instance_id (component_h context, char **instance_id)
 Gets the instance ID of the component.
int component_register_action (component_h context, const char *action)
 Registers the app_control action.
int component_deregister_action (component_h context, const char *action)
 Deregisters the registered app_control action.
int component_send_launch_request_async (component_h context, app_control_h app_control, app_control_result_cb result_cb, app_control_reply_cb reply_cb, void *user_data)
 Sends the launch request asynchronously.
int component_send_launch_request_sync (component_h context, app_control_h app_control, app_control_h *reply, app_control_result_e *result)
 Sends the launch request synchronously.
int component_finish (component_h context)
 Finishes the component instance.

Typedefs

typedef void * component_class_h
 The component class handle.
typedef void * component_h
 The component context handle.

Typedef Documentation

typedef void* component_class_h

The component class handle.

Since :
5.5
typedef void* component_h

The component context handle.

Since :
5.5

Enumeration Type Documentation

Enumeration for device orientation.

Since :
5.5
Enumerator:
COMPONENT_DEVICE_ORIENTATION_0 

The device is oriented in a natural position

COMPONENT_DEVICE_ORIENTATION_90 

The device's left side is at the top

COMPONENT_DEVICE_ORIENTATION_180 

The device is upside down

COMPONENT_DEVICE_ORIENTATION_270 

The device's right side is at the top

Enumeration for display status.

Since :
5.5
Enumerator:
COMPONENT_DISPLAY_STATUS_ON 

The display status is on

COMPONENT_DISPLAY_STATUS_OFF 

The display status is off

Enumeration for component error.

Since :
5.5
Enumerator:
COMPONENT_ERROR_NONE 

Successful

COMPONENT_ERROR_INVALID_PARAMETER 

Invalid parameter

COMPONENT_ERROR_OUT_OF_MEMORY 

Out of memory

COMPONENT_ERROR_INVALID_CONTEXT 

Invalid component context

COMPONENT_ERROR_NOT_SUPPORTED 

Not supported

COMPONENT_ERROR_NOT_FOUND 

Not found

COMPONENT_ERROR_LAUNCH_REJECTED 

The application cannot be launched now

COMPONENT_ERROR_LAUNCH_FAILED 

Internal launch error

COMPONENT_ERROR_TIMED_OUT 

Time out

COMPONENT_ERROR_PERMISSION_DENIED 

Permission denied

Enumeration for battery status.

Since :
5.5
Enumerator:
COMPONENT_LOW_BATTERY_NONE 

None

COMPONENT_LOW_BATTERY_POWER_OFF 

The battery status is under 1%

COMPONENT_LOW_BATTERY_CRITICAL_LOW 

The battery status is under 5%

Enumeration for low memory status.

Since :
5.5
Enumerator:
COMPONENT_LOW_MEMORY_NONE 

None

COMPONENT_LOW_MEMORY_NORMAL 

Normal status

COMPONENT_LOW_MEMORY_SOFT_WARNING 

Soft warning status

COMPONENT_LOW_MEMORY_HARD_WARNING 

Hard warning status

Enumeration for suspended state.

Since :
5.5
Enumerator:
COMPONENT_SUSPENDED_STATE_WILL_ENTER 

The component will enter the suspended state

COMPONENT_SUSPENDED_STATE_DID_EXIT 

The component did exit from the suspended state


Function Documentation

int component_deregister_action ( component_h  context,
const char *  action 
)

Deregisters the registered app_control action.

Since :
5.5
Parameters:
[in]contextThe context of the component instance
[in]actionThe name of the app_control action
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
int component_finish ( component_h  context)

Finishes the component instance.

Since :
5.5
Parameters:
[in]contextThe context of the component instance
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
See also:
frame_component_destroy_cb()
service_component_destroy_cb()
int component_get_id ( component_h  context,
char **  id 
)

Gets the ID of the component.

Since :
5.5
Remarks:
id must be released using free().
Parameters:
[in]contextThe context of the component instance
[out]idThe ID of the component
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_ERROR_OUT_OF_MEMORYOut of memory
int component_get_instance_id ( component_h  context,
char **  instance_id 
)

Gets the instance ID of the component.

Since :
5.5
Remarks:
instance_id must be released using free().
Parameters:
[in]contextThe context of the component instance
[out]instance_idThe instance ID of the component
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_ERROR_OUT_OF_MEMORYOut of memory
int component_register_action ( component_h  context,
const char *  action 
)

Registers the app_control action.

This function is for handling each application control action. action must match id attribute of app_control element in the tizen-manifest.xml.

Since :
5.5
Parameters:
[in]contextThe context of the component instance
[in]actionThe name of the app_control action
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
See also:
frame_component_action_cb()
component_deregister_action()
int component_send_launch_request_async ( component_h  context,
app_control_h  app_control,
app_control_result_cb  result_cb,
app_control_reply_cb  reply_cb,
void *  user_data 
)

Sends the launch request asynchronously.

To use group mode, you must use this function instead of app_control_send_launch_request_async().

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/appmanager.launch
Parameters:
[in]contextThe context of the component instance
[in]app_controlThe app_control handle
[in]result_cbThe callback function to be called when the result is delivered
[in]reply_cbThe callback function to be called when the reply is delivered
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_PERMISSION_DENIEDPermission denied
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_ERROR_OUT_OF_MEMORYOut of memory
COMPONENT_ERROR_NOT_FOUNDThe application to run the given launch request is not found
COMPONENT_ERROR_LAUNCH_REJECTEDThe application cannot be launched in current context
COMPONENT_ERROR_LAUNCH_FAILEDFailed to launch the application
COMPONENT_ERROR_TIMED_OUTFailed due to timeout. The application that handles app_control may be busy
See also:
app_control_result_cb()
app_control_reply_to_launch_request()
app_control_reply_cb()
app_control_enable_app_started_result_event()
app_control_send_launch_request_async()
int component_send_launch_request_sync ( component_h  context,
app_control_h  app_control,
app_control_h reply,
app_control_result_e result 
)

Sends the launch request synchronously.

To use group mode, you must use this function instead of app_control_send_launch_request_sync().

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/appmanager.launch
Remarks:
The reply must be released using app_control_destroy().
Parameters:
[in]contextThe context of the component instance
[in]app_controlThe app_control handle
[out]replyThe app_control handle in which the results of the callee are contained
[out]resultThe result code of the launch request
Returns:
0 on success, otherwise a negative error value
Return values:
COMPONENT_ERROR_NONESuccessful
COMPONENT_ERROR_PERMISSION_DENIEDPermission denied
COMPONENT_ERROR_INVALID_PARAMETERInvalid parameter
COMPONENT_ERROR_OUT_OF_MEMORYOut of memory
COMPONENT_ERROR_NOT_FOUNDThe application to run the given launch request is not found
COMPONENT_ERROR_LAUNCH_REJECTEDThe application cannot be launched in current context
COMPONENT_ERROR_LAUNCH_FAILEDFailed to launch the application
COMPONENT_ERROR_TIMED_OUTFailed due to timeout. The application that handles app_control may be busy
See also:
app_control_destroy()
app_control_send_launch_request_sync()