* This callback is invoked after _create callback (just after app enters main loop)
* or after "re-launch".
*
-* @param service [in] The launching arguments.
+* @param app_control [in] The launching arguments.
* @param data [in] The function specific data passed by app_efl_main.
* @return void.
*/
-static void _service(service_h service, void *data)
+static void _app_control(app_control_h app_control, void *data)
{
struct _appdata *ad;
struct setting_mgr *mgr;
param = NULL;
if (ad->service) {
- service_get_extra_data(service, PARAM_SETTINGS_ITEM, ¶m);
+ app_control_get_extra_data(app_control, PARAM_SETTINGS_ITEM, ¶m);
if ((!param && !ad->item) ||
(param && ad->item &&
!strcmp(ad->item, param))) {
if (!mgr)
app_efl_exit();
- r = service_get_extra_data(service, PARAM_SETTINGS_ITEM, ¶m);
- if (r == SERVICE_ERROR_NONE && param) {
+ r = app_control_get_extra_data(app_control, PARAM_SETTINGS_ITEM, ¶m);
+ if (r == APP_CONTROL_ERROR_NONE && param) {
r = settingmgr_launch_item(mgr, param);
if (r != 0) {
_ERR("the item is not exist.");
int main(int argc, char **argv)
{
struct _appdata ad;
- app_event_callback_s cbs = {
- .create = _create,
- .terminate = _terminate,
- .pause = _pause,
- .resume = _resume,
- .service = _service,
- .low_memory = NULL,
- .low_battery = NULL,
- .device_orientation = NULL,
- .language_changed = _lang_changed,
- .region_format_changed = _region_changed,
- };
+
+ ui_app_lifecycle_callback_s event_callback = { 0, };
+ app_event_handler_h handlers[5] = { NULL, };
+
+ event_callback.create = _create;
+ event_callback.terminate = _terminate;
+ event_callback.pause = _pause;
+ event_callback.resume = _resume;
+ event_callback.app_control = _app_control;
+
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED],
+ APP_EVENT_LANGUAGE_CHANGED, _lang_changed, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED],
+ APP_EVENT_REGION_FORMAT_CHANGED, _region_changed, &ad);
memset(&ad, 0x00, sizeof(ad));
ad.name = PACKAGE;
i18n_init();
- app_efl_main(&argc, &argv, &cbs, &ad);
+ ui_app_main(argc, argv, &event_callback, &ad);
return 0;
}
* @param priv [in] The function specific data passed by UG caller.
* @return void.
*/
-static void _ug_result_cb(ui_gadget_h ug, service_h result, void *priv)
+static void _ug_result_cb(ui_gadget_h ug, app_control_h result, void *priv)
{
}
*
* @param[in] ug: The channel ui gadget object being created
* @param[in] mode: Mode of UI gadget (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
-* @param[in] service: The handler to the service.
-* Each operation will receive this service type data, and the argument service
+* @param[in] app_control: The handler to the app_control.
+* Each operation will receive this app_control type data, and the argument app_control
* is automatically released by UI gadget manager after the UI gadget
* is destroyed.
* @priv[in] priv: The user data passed from the callback registration function.
* @return the base layout
*/
static void *_on_create(ui_gadget_h ug, enum ug_mode mode,
- service_h service, void *priv)
+ app_control_h app_control, void *priv)
{
Evas_Object *win;
struct _ugdata *ugd;
* so just describe additional job you need to do in this operation.
*
* @param[in] ug: The channel ui gadget object being created
-* @param[in] service: The handler to the service.
-* Each operation will receive this service type data, and the argument service
+* @param[in] app_control: The handler to the app_control.
+* Each operation will receive this app_control type data, and the argument app_control
* is automatically released by UI gadget manager after the UI gadget
* is destroyed.
* @priv[in] priv: The user data passed from the callback registration function.
*
* There is no action in this function.
*/
-static void _on_start(ui_gadget_h ug, service_h service, void *priv)
+static void _on_start(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Pause channel ug.
*
* @param[in] ug: The channel ui gadget object being created
-* @param[in] service: The handler to the service.
+* @param[in] app_control: The handler to the app_control.
* @priv[in] priv: The user data passed from the callback registration function.
*
* There is no action in this function.
*/
-static void _on_pause(ui_gadget_h ug, service_h service, void *priv)
+static void _on_pause(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Resume channel ug.
*
* @param[in] ug: The channel ui gadget object being created
-* @param[in] service: The handler to the service.
+* @param[in] app_control: The handler to the app_control.
* @priv[in] priv: The user data passed from the callback registration function.
*
* There is no action in this function.
*/
-static void _on_resume(ui_gadget_h ug, service_h service, void *priv)
+static void _on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* the viewmgr will be released.
*
* @param[in] ug: The channel ui gadget object
-* @param[in] service: The handler to the service.
+* @param[in] app_control: The handler to the app_control.
* @priv[in] priv: The user data passed from the callback registration function.
*/
-static void _on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void _on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
{
struct _ugdata *ugd;
* the message operation on_message is invoked.
*
* @param[in] ug: The channel ui gadget object
-* @param[in] msg: The handler to the service data.
-* Each operation will receive this service type data,
-* And the argument service is automatically released by UI gadget manager
+* @param[in] msg: The handler to the app_control data.
+* Each operation will receive this app_control type data,
+* And the argument app_control is automatically released by UI gadget manager
* after the UI gadget is destroyed
-* @param[in] service: The handler to the service.
+* @param[in] app_control: The handler to the app_control.
* @priv[in] priv: The user data passed from the callback registration function.
*
* There is no action in this function.
*/
-static void _on_message(ui_gadget_h ug, service_h msg,
- service_h service, void *priv)
+static void _on_message(ui_gadget_h ug, app_control_h msg,
+ app_control_h app_control, void *priv)
{
}
*
* @param[in] ug: The channel ui gadget object
* @param[in] event: The event for channel ui gadget
-* @param[in] service: The handler to the service.
+* @param[in] app_control: The handler to the app_control.
* @priv[in] priv: The user data passed from the callback registration function.
*/
static void _on_event(ui_gadget_h ug, enum ug_event event,
- service_h service, void *priv)
+ app_control_h app_control, void *priv)
{
if (!ug || !priv)
return;
*
* @param[in] ug The network ui gadget object being created
* @param[in] mode Mode of UI gadget (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* @return the base layout
*/
static void *_on_create(ui_gadget_h ug, enum ug_mode mode,
- service_h service, void *priv)
+ app_control_h app_control, void *priv)
{
struct _ug_data *ugd;
Evas_Object *base;
* so just describe additional job you need to do in this operation.
*
* @param[in] ug The network ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
-static void _on_start(ui_gadget_h ug, service_h service, void *priv)
+static void _on_start(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Pause network ug.
*
* @param[in] ug The network ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
-static void _on_pause(ui_gadget_h ug, service_h service, void *priv)
+static void _on_pause(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Resume network ug.
*
* @param[in] ug The network ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
-static void _on_resume(ui_gadget_h ug, service_h service, void *priv)
+static void _on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* the viewmgr will be released.
*
* @param[in] ug the network ui gadget object
-* @param[in] service each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv the data structure
*/
-static void _on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void _on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
{
struct _ug_data *ugd = priv;
* the message operation on_message is invoked.
*
* @param[in] ug The network ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
static void _on_message(ui_gadget_h ug,
- service_h msg, service_h service, void *priv)
+ app_control_h msg, app_control_h app_control, void *priv)
{
}
*
* @param[in] ug the network ui gadget object
* @param[in] event the network ui gadget object
-* @param[in] service each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv the data structure
*/
static void _on_event(ui_gadget_h ug,
- enum ug_event event, service_h service, void *priv)
+ enum ug_event event, app_control_h app_control, void *priv)
{
if (!ug || !priv) {
_ERR("Parameter error!");
*
* @param[in] ug The proxy ui gadget object being created
* @param[in] mode Mode of UI gadget (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* @return the base layout
*/
static void *_on_create(ui_gadget_h ug, enum ug_mode mode,
- service_h service, void *priv)
+ app_control_h app_control, void *priv)
{
struct _ug_data *ugd;
Evas_Object *base;
* so just describe additional job you need to do in this operation.
*
* @param[in] ug The proxy ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
-static void _on_start(ui_gadget_h ug, service_h service, void *priv)
+static void _on_start(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Pause proxy ug.
*
* @param[in] ug The proxy ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
-static void _on_pause(ui_gadget_h ug, service_h service, void *priv)
+static void _on_pause(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Resume proxy ug.
*
* @param[in] ug The proxy ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
-static void _on_resume(ui_gadget_h ug, service_h service, void *priv)
+static void _on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* the viewmgr will be released.
*
* @param[in] ug the proxy ui gadget object
-* @param[in] service each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv the data structure
*/
-static void _on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void _on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
{
struct _ug_data *ugd = priv;
* the message operation on_message is invoked.
*
* @param[in] ug The proxy ui gadget object being created
-* @param[in] service Each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control Each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv The data structure
*
* There is no action in this function.
*/
static void _on_message(ui_gadget_h ug,
- service_h msg, service_h service, void *priv)
+ app_control_h msg, app_control_h app_control, void *priv)
{
}
*
* @param[in] ug the proxy ui gadget object
* @param[in] event the proxy ui gadget object
-* @param[in] service each operation will receive this service type data,
-* (see \ref service_PG "Tizen Managed APi Reference Guide >
-* Application Framework -> Application") And the argument <i>service</i> is
+* @param[in] app_control each operation will receive this app_control type data,
+* (see \ref app_control_PG "Tizen Managed APi Reference Guide >
+* Application Framework -> Application") And the argument <i>app_control</i> is
* automatically released by UI gadget manager after the UI gadget is destroyed.
* @priv[in] priv the data structure
*/
static void _on_event(ui_gadget_h ug,
- enum ug_event event, service_h service, void *priv)
+ enum ug_event event, app_control_h app_control, void *priv)
{
if (!ug || !priv) {
_ERR("Parameter error!");
*
* @param[in]: ug : the UI gadget created by ug_create().
* @param[in]: mode : the mode of ug, fullview or frameview.
-* @param[in]: service : argument for the UI gadget.
+* @param[in]: app_control : argument for the UI gadget.
* @param[in]: priv : the user data.
*
* @return: The base layout of this UI gadget.
*/
static void *_on_create(ui_gadget_h ug,
- enum ug_mode mode, service_h service, void *priv)
+ enum ug_mode mode, app_control_h app_control, void *priv)
{
struct _ug_data *data;
Evas_Object *win;
* This function destroyes all the UI components of this UI gadget.
*
* @param[in]: ug : UI gadget.
-* @param[in]: service : argument of this UI gadget.
+* @param[in]: app_control : argument of this UI gadget.
* @param[in]: priv : the user data.
*
* @return: void.
*/
-static void _on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void _on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
{
struct _ug_data *data;
*
* @param[in] ug UI gadget object
* @param[in] mode mode of UI gadget
-* @param[in] service the handler to the service
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*/
static void *_on_create(ui_gadget_h ug, enum ug_mode mode,
- service_h service, void *priv)
+ app_control_h app_control, void *priv)
{
struct _ug_data *ugd;
Evas_Object *base;
* Called when wifi direct ug starts.
*
* @param[in] ug UI gadget object
-* @param[in] service the handler to the service
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*
* There is no action in this function.
*/
-static void _on_start(ui_gadget_h ug, service_h service, void *priv)
+static void _on_start(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Invoked on pause state of UI Gadget
*
* @param[in] ug UI gadget object
-* @param[in] service the handler to the service
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*
* There is no action in this application
*/
-static void _on_pause(ui_gadget_h ug, service_h service, void *priv)
+static void _on_pause(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Invoked on resume state of UI Gadget
*
* @param[in] ug UI gadget object
-* @param[in] service the handler to the service
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*
* There is no action in this application
*/
-static void _on_resume(ui_gadget_h ug, service_h service, void *priv)
+static void _on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Invoked on destroy state of UI Gadget
*
* @param[in] ug UI gadget object
-* @param[in] service the handler to the service
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*
* There is no action in this application
*/
-static void _on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void _on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
* Called When an UI gadget received message from its caller ug_send_message()
*
* @param[in] ug UI gadget object
-* @param[in] msg the handler to the service
-* @param[in] service the handler to the service
+* @param[in] msg the handler to the app_control
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*
* There is no action in this function
*/
-static void _on_message(ui_gadget_h ug, service_h msg,
- service_h service, void *priv)
+static void _on_message(ui_gadget_h ug, app_control_h msg,
+ app_control_h app_control, void *priv)
{
}
*
* @param[in] ug UI gadget
* @param[in] event event information
-* @param[in] service the handler to the service
+* @param[in] app_control the handler to the app_control
* @param[in] priv _priv object
*/
static void _on_event(ui_gadget_h ug, enum ug_event event,
- service_h service, void *priv)
+ app_control_h app_control, void *priv)
{
if (!ug || !priv) {
_ERR("Parameter error!");