From 7f74b95776373d0d9c5b4986a374163fe98b8f9c Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 31 Aug 2017 19:56:20 +0900 Subject: [PATCH] [UTC][capi-ui-inputmethod][ACR-1047][Add APIs for moving the floating input panel] Change-Id: Ibc18fe9ff333233b3cf2452b87c0a1473b89469e --- src/utc/capi-ui-inputmethod/public.list | 3 + .../tct-capi-ui-inputmethod-core_mobile.h | 12 +++ .../tct-capi-ui-inputmethod-core_wearable.h | 12 +++ .../capi-ui-inputmethod/utc-capi-ui-inputmethod.c | 93 ++++++++++++++++++++++ 4 files changed, 120 insertions(+) diff --git a/src/utc/capi-ui-inputmethod/public.list b/src/utc/capi-ui-inputmethod/public.list index 8b4e945..7e16204 100755 --- a/src/utc/capi-ui-inputmethod/public.list +++ b/src/utc/capi-ui-inputmethod/public.list @@ -51,3 +51,6 @@ ime_event_set_prediction_hint_set_cb ime_send_private_command ime_event_set_mime_type_set_request_cb ime_commit_content +ime_set_floating_mode +ime_set_floating_drag_start +ime_set_floating_drag_end \ No newline at end of file diff --git a/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_mobile.h b/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_mobile.h index 3b66357..442a172 100755 --- a/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_mobile.h +++ b/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_mobile.h @@ -59,6 +59,9 @@ extern int utc_ime_event_set_prediction_hint_set_cb_p(void); extern int utc_ime_send_private_command_p(void); extern int utc_ime_event_set_mime_type_set_request_cb_p(void); extern int utc_ime_commit_content_p(void); +extern int utc_ime_set_floating_mode_p(void); +extern int utc_ime_set_floating_drag_start_p(void); +extern int utc_ime_set_floating_drag_end_p(void); extern int utc_ime_run_n(void); extern int utc_ime_run_n2(void); extern int utc_ime_event_set_focus_in_cb_n(void); @@ -135,6 +138,9 @@ extern int utc_ime_send_private_command_n2(void); extern int utc_ime_event_set_mime_type_set_request_cb_n(void); extern int utc_ime_commit_content_n(void); extern int utc_ime_commit_content_n2(void); +extern int utc_ime_set_floating_mode_n(void); +extern int utc_ime_set_floating_drag_start_n(void); +extern int utc_ime_set_floating_drag_end_n(void); testcase tc_array[] = { {"utc_ime_run_p",utc_ime_run_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, @@ -174,6 +180,9 @@ testcase tc_array[] = { {"utc_ime_send_private_command_p",utc_ime_send_private_command_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_event_set_mime_type_set_request_cb_p",utc_ime_event_set_mime_type_set_request_cb_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_commit_content_p",utc_ime_commit_content_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_mode_p",utc_ime_set_floating_mode_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_start_p",utc_ime_set_floating_drag_start_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_end_p",utc_ime_set_floating_drag_end_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_run_n",utc_ime_run_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_run_n2",utc_ime_run_n2,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_event_set_focus_in_cb_n",utc_ime_event_set_focus_in_cb_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, @@ -250,6 +259,9 @@ testcase tc_array[] = { {"utc_ime_event_set_mime_type_set_request_cb_n",utc_ime_event_set_mime_type_set_request_cb_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_commit_content_n",utc_ime_commit_content_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_commit_content_n2",utc_ime_commit_content_n2,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_mode_n",utc_ime_set_floating_mode_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_start_n",utc_ime_set_floating_drag_start_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_end_n",utc_ime_set_floating_drag_end_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {NULL, NULL} }; diff --git a/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_wearable.h b/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_wearable.h index eb92e64..271ed73 100755 --- a/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_wearable.h +++ b/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core_wearable.h @@ -59,6 +59,9 @@ extern int utc_ime_event_set_prediction_hint_set_cb_p(void); extern int utc_ime_send_private_command_p(void); extern int utc_ime_event_set_mime_type_set_request_cb_p(void); extern int utc_ime_commit_content_p(void); +extern int utc_ime_set_floating_mode_p(void); +extern int utc_ime_set_floating_drag_start_p(void); +extern int utc_ime_set_floating_drag_end_p(void); extern int utc_ime_run_n(void); extern int utc_ime_run_n2(void); extern int utc_ime_event_set_focus_in_cb_n(void); @@ -137,6 +140,9 @@ extern int utc_ime_send_private_command_n2(void); extern int utc_ime_event_set_mime_type_set_request_cb_n(void); extern int utc_ime_commit_content_n(void); extern int utc_ime_commit_content_n2(void); +extern int utc_ime_set_floating_mode_n(void); +extern int utc_ime_set_floating_drag_start_n(void); +extern int utc_ime_set_floating_drag_end_n(void); testcase tc_array[] = { {"utc_ime_run_p",utc_ime_run_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, @@ -176,6 +182,9 @@ testcase tc_array[] = { {"utc_ime_send_private_command_p",utc_ime_send_private_command_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_event_set_mime_type_set_request_cb_p",utc_ime_event_set_mime_type_set_request_cb_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_commit_content_p",utc_ime_commit_content_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_mode_p",utc_ime_set_floating_mode_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_start_p",utc_ime_set_floating_drag_start_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_end_p",utc_ime_set_floating_drag_end_p,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_run_n",utc_ime_run_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_run_n2",utc_ime_run_n2,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_event_set_focus_in_cb_n",utc_ime_event_set_focus_in_cb_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, @@ -254,6 +263,9 @@ testcase tc_array[] = { {"utc_ime_event_set_mime_type_set_request_cb_n",utc_ime_event_set_mime_type_set_request_cb_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_commit_content_n",utc_ime_commit_content_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {"utc_ime_commit_content_n2",utc_ime_commit_content_n2,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_mode_n",utc_ime_set_floating_mode_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_start_n",utc_ime_set_floating_drag_start_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, + {"utc_ime_set_floating_drag_end_n",utc_ime_set_floating_drag_end_n,utc_capi_ui_inputmethod_startup,utc_capi_ui_inputmethod_cleanup}, {NULL, NULL} }; diff --git a/src/utc/capi-ui-inputmethod/utc-capi-ui-inputmethod.c b/src/utc/capi-ui-inputmethod/utc-capi-ui-inputmethod.c index 56a4871..af9f929 100755 --- a/src/utc/capi-ui-inputmethod/utc-capi-ui-inputmethod.c +++ b/src/utc/capi-ui-inputmethod/utc-capi-ui-inputmethod.c @@ -193,6 +193,24 @@ static gboolean _ime_commit_content(gpointer user_data) elm_exit(); return FALSE; } +static gboolean _ime_set_floating_mode(gpointer user_data) +{ + g_ret = ime_set_floating_mode(true); + elm_exit(); + return FALSE; +} +static gboolean _ime_set_floating_drag_start(gpointer user_data) +{ + g_ret = ime_set_floating_drag_start(); + elm_exit(); + return FALSE; +} +static gboolean _ime_set_floating_drag_end(gpointer user_data) +{ + g_ret = ime_set_floating_drag_end(); + elm_exit(); + return FALSE; +} static void _create_cb(void *user_data) { @@ -726,6 +744,45 @@ int utc_ime_commit_content_p(void) return 0; } +/** + * @testcase utc_ime_set_floating_mode_p + * @since_tizen 4.0 + * @description Positive UTC of the function that sets the floating mode of input panel window. + */ +int utc_ime_set_floating_mode_p(void) +{ + int ret = ime_run(&basic_callback, (void *)_ime_set_floating_mode); + assert_eq(ret, IME_ERROR_NONE); + assert_eq(g_ret, IME_ERROR_NONE); + return 0; +} + +/** + * @testcase utc_ime_set_floating_drag_start_p + * @since_tizen 4.0 + * @description Positive UTC of the function that allows the movement of the floating input panel window. + */ +int utc_ime_set_floating_drag_start_p(void) +{ + int ret = ime_run(&basic_callback, (void *)_ime_set_floating_drag_start); + assert_eq(ret, IME_ERROR_NONE); + assert_eq(g_ret, IME_ERROR_NONE); + return 0; +} + +/** + * @testcase utc_ime_set_floating_drag_end_p + * @since_tizen 4.0 + * @description Positive UTC of the function that disallows the movement of the floating input panel window. + */ +int utc_ime_set_floating_drag_end_p(void) +{ + int ret = ime_run(&basic_callback, (void *)_ime_set_floating_drag_end); + assert_eq(ret, IME_ERROR_NONE); + assert_eq(g_ret, IME_ERROR_NONE); + return 0; +} + //& purpose: A purpose of a first negative TC. /** @@ -1671,6 +1728,42 @@ int utc_ime_commit_content_n2(void) return 0; } +/** + * @testcase utc_ime_set_floating_mode_n + * @since_tizen 4.0 + * @description Negative UTC of the function that sets the floating mode of input panel window. + */ +int utc_ime_set_floating_mode_n(void) +{ + int ret = ime_set_floating_mode(true); + assert_eq(ret, IME_ERROR_NOT_RUNNING); + return 0; +} + +/** + * @testcase utc_ime_set_floating_drag_start_n + * @since_tizen 4.0 + * @description Negative UTC of the function that allows the movement of the floating input panel window. + */ +int utc_ime_set_floating_drag_start_n(void) +{ + int ret = ime_set_floating_drag_start(); + assert_eq(ret, IME_ERROR_NOT_RUNNING); + return 0; +} + +/** + * @testcase utc_ime_set_floating_drag_end_n + * @since_tizen 4.0 + * @description Negative UTC of the function that disallows the movement of the floating input panel window. + */ +int utc_ime_set_floating_drag_end_n(void) +{ + int ret = ime_set_floating_drag_end(); + assert_eq(ret, IME_ERROR_NOT_RUNNING); + return 0; +} + #ifdef WEARABLE /** * @testcase utc_ime_event_set_process_input_device_event_cb_n -- 2.7.4