Component based application API.
Required Header
#include <component_based_app.h>
Overview
The Component Based Application API provides functions for starting and exiting Tizen component based application. Tizen component based application can consist of frame_component and service_component. This API supports making multiple frame_components and service_components per an application.
Registering Callbacks for Application State Change Events
As for Tizen component based application states, it is very simple and somewhat similar to Tizen widget application states.
Callback | Description |
component_based_app_create_cb() | The callback function is called before the main loop of the application starts. In this callback, you can initialize resources which can be shared among component instances. This function should return the handle for component class so that it will be used for making instances of component. |
component_based_app_terminate_cb() | This callback function is called once after the main loop of the application exits. You should release the resources of the application in this function. |
Typedef Documentation
Called when the application starts.
The callback function is called before the main loop of the application starts. In this callback, you can initialize resources which can be shared among component instances. This function should return the handle for component class so that it will be used for making instances of component.
- Since :
- 5.5
- Parameters:
-
[in] | user_data | The user data to be passed from the callback registration function |
- Returns:
- The object of component class
- See also:
- component_based_app_main()
-
component_based_app_add_frame_component()
-
component_based_app_add_service_component()
Called when the main loop of the application exits.
This callback function is called once after the main loop of the application exits. You should release the resources of the application in this function.
- Since :
- 5.5
- Parameters:
-
[in] | user_data | The user data to be passed from the callback registration function |
- See also:
- component_based_app_main()
Function Documentation
Adds a new frame component to comp_class.
Adds a new frame component with comp_id to comp_class. If comp_class is null, the platform creates a component_class_h and adds a new frame component with comp_id and then return the component_class_h.
- Since :
- 5.5
- Parameters:
-
[in] | comp_class | The component class |
[in] | comp_id | The ID of the frame component |
[in] | callback | The set of lifecycle callbacks of the frame component |
[in] | user_data | The user data to be passed to the callback functions |
- Returns:
- comp_class on success, otherwise NULL
- Exceptions:
-
- See also:
- get_last_result()
Adds a service component to comp_class.
Adds a new service component with comp_id to comp_class. If comp_class is null, the platform creates a component_class_h and adds a new service component with comp_id and then return the component_class_h.
- Since :
- 5.5
- Parameters:
-
[in] | comp_class | The component class |
[in] | comp_id | The ID of the service component |
[in] | callback | The set of lifecycle callbacks of the service component |
[in] | user_data | The user data to be passed to the callback functions |
- Returns:
- comp_class on success, otherwise NULL
- Exceptions:
-
- See also:
- get_last_result()
Exits the main loop of the application.
- Since :
- 5.5
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Runs the main loop of the application until component_based_app_exit() is called.
- Since :
- 5.5
- Parameters:
-
[in] | argc | The argument count |
[in] | argv | The argument vector |
[in] | callback | The set of callback functions to handle application events |
[in] | user_data | The user data to be passed to the callback function |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- component_based_app_exit()