change service_cb to app_control_cb in ui_app_lifecycle_s.
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 14 Jan 2015 05:01:24 +0000 (14:01 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Wed, 21 Jan 2015 01:50:13 +0000 (10:50 +0900)
JIRA ticket : TC-2314

Change-Id: Icd443dac75bf84ffea81364b5645ccb62e3dd5e7
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
include/app.h
src/app_main.c

index 35d29398167c8df52da95ad874845fde8e5c6834..bd8d68e6b4d31642a13d8ef796fa15933994757e 100755 (executable)
@@ -139,6 +139,30 @@ typedef void (*app_terminate_cb) (void *user_data);
 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.
  *
@@ -234,7 +258,7 @@ typedef struct
  * @see app_pause_cb()
  * @see app_resume_cb()
  * @see app_terminate_cb()
- * @see service_cb()
+ * @see app_control_cb()
  */
 typedef struct
 {
@@ -242,7 +266,7 @@ 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;
 
 
@@ -683,7 +707,7 @@ void app_set_reclaiming_system_cache_on_pause(bool enable);
  *
  * @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.
  *
@@ -702,7 +726,7 @@ void app_set_reclaiming_system_cache_on_pause(bool enable);
  * @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
  */
index 24079a2eabc2b37645123c923a57a3aec61268f9..46ab839b36a34d2c47a0f8fa16ae7878ac04fafc 100755 (executable)
@@ -33,6 +33,7 @@
 
 #include <app_private.h>
 #include <app_service_private.h>
+#include <app_control_internal.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -627,21 +628,21 @@ static int _ui_app_appcore_reset(bundle *appcore_bundle, void *data)
 {
        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;
 }