From: Inhong Han Date: Tue, 6 Nov 2018 04:27:09 +0000 (+0900) Subject: Add a new API to update input panel event X-Git-Tag: submit/tizen/20181114.073023~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a667f1ba4c434625a25bbd0cbab0635fff2c3454;p=platform%2Fcore%2Fapi%2Finputmethod.git Add a new API to update input panel event Change-Id: I5d6b655c75f456950a5183802a789fd7387a3a99 --- diff --git a/include/inputmethod.h b/include/inputmethod.h index 83fbd0f..0710aff 100644 --- a/include/inputmethod.h +++ b/include/inputmethod.h @@ -99,6 +99,19 @@ typedef enum { IME_ATTR_FONTSTYLE, /**< A font style attribute, e.g., underline, etc. */ } ime_attribute_type; +/** + * @brief Enumeration containing input panel events. + * + * @since_tizen 5.5 + * + * @see ime_update_input_panel_event() + */ +typedef enum { + IME_EVENT_TYPE_LANGUAGE = 1, /**< The language of the input panel */ + IME_EVENT_TYPE_SHIFT_MODE, /**< The shift key state of the input panel */ + IME_EVENT_TYPE_GEOMETRY, /**< The size of the input panel */ +} ime_event_type_e; + /** * @brief Value for #IME_ATTR_FONTSTYLE. Draw a line under the text. * @since_tizen @if MOBILE 2.4 @else 3.0 @endif @@ -2429,6 +2442,28 @@ int ime_event_set_prediction_hint_data_set_cb(ime_prediction_hint_data_set_cb ca */ int ime_request_hide(void); +/** + * @brief Updates the state of input panel event. + * + * @since_tizen 5.5 + * + * @privlevel public + * + * @privilege %http://tizen.org/privilege/ime + * + * @param[in] type The input panel event type + * @param[in] value The value of event type + * + * @return 0 on success, otherwise a negative error value + * @retval #IME_ERROR_NONE No error + * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function + * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet + * + * @see ime_event_type_e + */ +int ime_update_input_panel_event(ime_event_type_e type, unsigned int value); + /** * @} */ diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 930dc40..bfb4650 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -2064,4 +2064,26 @@ EXPORT_API int ime_event_set_optimization_hint_set_cb(ime_optimization_hint_set_ return IME_ERROR_NONE; } -//LCOV_EXCL_STOP \ No newline at end of file +//LCOV_EXCL_STOP + +EXPORT_API int ime_update_input_panel_event(ime_event_type_e type, unsigned int value) +{ + ime_error_e retVal = IME_ERROR_NONE; + + if (type >= IME_EVENT_TYPE_LANGUAGE && type <= IME_EVENT_TYPE_GEOMETRY) { + LOGW("IME_ERROR_INVALID_PARAMETER"); + return IME_ERROR_INVALID_PARAMETER; + } + + 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.update_input_context(type, value); + + return IME_ERROR_NONE; +}