From: Jihoon Kim Date: Thu, 24 Oct 2019 08:31:36 +0000 (+0900) Subject: Add internal API to send an event to IMEngine X-Git-Tag: submit/tizen_5.0/20191104.023203~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c3e65962021976518e8b2f898781cc2ae12f99e;p=platform%2Fcore%2Fapi%2Finputmethod.git Add internal API to send an event to IMEngine Change-Id: Ie3d28fd16a9d35e764cd64a870fa6c3b8e5b5998 Signed-off-by: Jihoon Kim --- diff --git a/include/inputmethod_internal.h b/include/inputmethod_internal.h index e21b103..fff9fec 100644 --- a/include/inputmethod_internal.h +++ b/include/inputmethod_internal.h @@ -249,7 +249,20 @@ int ime_flush_imengine(); int ime_reset_imengine(); /** - * @brief Send the selected item index in the candidate list. + * @brief Send an Event to IMEngine + * + * @since_tizen 5.5 + * + * @privilege %http://tizen.org/privilege/ime + * + * @return 0 on success, otherwise a negative error value + * @param[in] command The command to be sent. + * @param[in] value The value corresponding to the command. + */ +int ime_send_imengine_event(int command, unsigned int value); + +/** + * @brief Sends the selected item index in the candidate list. * * @since_tizen 3.0 * diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 829f76d..3010ade 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -1353,7 +1353,24 @@ EXPORT_API int ime_flush_imengine() return IME_ERROR_NONE; } -EXPORT_API int ime_reset_imengine() +EXPORT_API int ime_send_imengine_event(int command, unsigned int value) +{ + ime_error_e retVal = IME_ERROR_NONE; + + if (!g_running) { + LOGW("IME_ERROR_NOT_RUNNING"); + return IME_ERROR_NOT_RUNNING; + } + + retVal = _check_privilege(); + if (retVal != IME_ERROR_NONE) return retVal; + + g_core.send_imengine_event(-1, NULL, command, value); + + return IME_ERROR_NONE; +} + +EXPORT_API int ime_reset_imengine(void) { ime_error_e retVal = IME_ERROR_NONE;