The Service Component API provides functions for handling Service Component state changes or system events.
Required Header
#include <service_component.h>
Overview
The Service Component API provides functions for handling Service Component of Component Based Application state changes or system events.
Registering Callbacks for Service Component State Change Events
The service component state change events include the following:
Please refer to the following state diagram to see the possible transitions and callbacks that are called while transition.
Service Component States
Typedefs |
typedef bool(* | service_component_create_cb )(component_h context, void *user_data) |
| Called when the service component instance is created.
|
typedef void(* | service_component_start_command_cb )(component_h context, app_control_h app_control, bool restarted, void *user_data) |
| Called when the service component instance is started.
|
typedef void(* | service_component_destroy_cb )(component_h context, void *user_data) |
| Called before the service component instance is destroyed.
|
typedef void(* | service_component_restore_content_cb )(component_h context, bundle *content, void *user_data) |
| Called after the content information of the service component instance is restored.
|
typedef void(* | service_component_save_content_cb )(component_h context, bundle *content, void *user_data) |
| Called before the content information of the service component instance is saved.
|
typedef void(* | service_component_action_cb )(component_h context, const char *action, app_control_h app_control, void *user_data) |
| Called when another application sends a launch request to the component.
|
typedef void(* | service_component_device_orientation_changed_cb )(component_h context, component_device_orientation_e orientation, void *user_data) |
| Called when the device orientation is changed.
|
typedef void(* | service_component_language_changed_cb )(component_h context, const char *language, void *user_data) |
| Called when the system language is changed.
|
typedef void(* | service_component_region_format_changed_cb )(component_h context, const char *region, void *user_data) |
| Called when the system region format is changed.
|
typedef void(* | service_component_low_battery_cb )(component_h context, component_low_battery_status_e status, void *user_data) |
| Called when the battery status is changed.
|
typedef void(* | service_component_low_memory_cb )(component_h context, component_low_memory_status_e status, void *user_data) |
| Called when the memory status is changed.
|
typedef void(* | service_component_suspended_state_changed_cb )(component_h context, component_suspended_state_e state, void *user_data) |
| Called when the suspended state of the service component is changed.
|
Typedef Documentation
Called when another application sends a launch request to the component.
Before calling service_component_start_command_cb(), this callback function is called.
- Since :
- 5.5
- Parameters:
-
[in] | context | The context of the service component instance |
[in] | action | The name of the app_control action |
[in] | app_control | The handle of the app_control |
[in] | user_data | The user data passed from component_based_app_add_service_component() function |
- See also:
- service_component_register_action()
-
service_component_deregister_action()
Called when the service component instance is created.
- Since :
- 5.5
- Parameters:
-
- Returns:
true
on success, otherwise false
on failure.
Called before the service component instance is destroyed.
- Since :
- 5.5
- Parameters:
-
Called when the device orientation is changed.
- Since :
- 5.5
- Parameters:
-
Called when the system language is changed.
- Since :
- 5.5
- Parameters:
-
Called when the battery status is changed.
- Since :
- 5.5
- Parameters:
-
Called when the memory status is changed.
- Since :
- 5.5
- Parameters:
-
Called when the system region format is changed.
- Since :
- 5.5
- Parameters:
-
Called after the content information of the service component instance is restored.
- Since :
- 5.5
- Parameters:
-
Called before the content information of the service component instance is saved.
- Since :
- 5.5
- Parameters:
-
Called when the service component instance is started.
- Since :
- 5.5
- Parameters:
-
[in] | context | The context of the service component instance |
[in] | app_control | The app control handle |
[in] | restarted | true , if the instance is restarted |
[in] | user_data | The user data passed from component_based_app_add_service_component() function |
Called when the suspended state of the service component is changed.
- Since :
- 5.5
- Parameters:
-