typedef void (*app_service_cb) (service_h service, void *user_data);
+/**
+ * @brief Called when other application send the launch request to the application.
+ *
+ * @details When the application is launched, this callback function is called after the main loop of application starts up.
+ * The passed app_control handle describes the launch request and contains the information about why the application is launched.
+ * If the launch request is sent to the application on running or pause state,
+ * this callback function can be called again to notify that the application is asked to be launched.
+ *
+ * The application could be explicitly launched by the user from the application launcher or be launched to perform the specific operation by the other application.
+ * The application is responsible for handling each launch request and responding accordingly.
+ * Using the app_control API, the application can get the information it needs to perform.
+ * If the application is launched from the application launcher or explicitly launched by other application,
+ * the passed app_control handle may include only the default operation (#APP_CONTROL_OPERATION_DEFAULT) without any data
+ * For more information, see The @ref CAPI_APP_CONTROL_MODULE API description.
+ *
+ * @param[in] app_control_h The handle to the app_control
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see app_efl_main()
+ * @see #app_event_callback_s
+ * @see @ref CAPI_APP_CONTROL_MODULE API
+ */
+typedef void (*app_control_cb) (app_control_h app_control, void *user_data);
+
+
/**
* @brief Called when the system memory is running low.
*
* @see app_pause_cb()
* @see app_resume_cb()
* @see app_terminate_cb()
- * @see service_cb()
+ * @see app_control_cb()
*/
typedef struct
{
app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */
app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
app_resume_cb resume; /**< This callback function is called each time the application becomes visible to the user. */
- app_service_cb service; /**< This callback function is called when another application sends the launch request to the application. */
+ app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
} ui_app_lifecycle_callback_s;
*
* @details This function is the main entry point of the Tizen application.
* The app_create_cb() callback function is called to initialize the application before the main loop of application starts up.
- * After the app_create_cb() callback function returns true, the main loop starts up and the service_cb() callback function is subsequently called.
+ * After the app_create_cb() callback function returns true, the main loop starts up and the app_control_cb() callback function is subsequently called.
* If the app_create_cb() callback function returns false, the main loop doesn't start up and app_terminate_cb() callback function is called.
* This main loop supports event handling for the Ecore Main Loop.
*
* @see app_terminate_cb()
* @see app_pause_cb()
* @see app_resume_cb()
- * @see app_service_cb()
+ * @see app_control_cb()
* @see ui_app_exit()
* @see #ui_app_lifecycle_callback_s
*/
#include <app_private.h>
#include <app_service_private.h>
+#include <app_control_internal.h>
#ifdef LOG_TAG
#undef LOG_TAG
{
LOGI("app_appcore_reset");
struct ui_app_context *app_context = data;
- app_service_cb callback;
- service_h service;
+ app_control_cb callback;
+ app_control_h app_control;
if (app_context == NULL)
return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
- if (service_create_event(appcore_bundle, &service) != APP_ERROR_NONE)
- return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create a service handle from the bundle");
+ if (app_control_create_event(appcore_bundle, &app_control) != APP_ERROR_NONE)
+ return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create an app_control handle from the bundle");
- callback = app_context->callback->service;
+ callback = app_context->callback->app_control;
if (callback != NULL)
- callback(service, app_context->data);
+ callback(app_control, app_context->data);
- service_destroy(service);
+ app_control_destroy(app_control);
return APP_ERROR_NONE;
}