From: Jihoon Kim Date: Tue, 7 Feb 2017 08:56:43 +0000 (+0900) Subject: Add ime_context_get_caps_mode in internal header X-Git-Tag: submit/tizen_3.0/20170207.052757~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df5ef126c84c970a3b9571ce7b1bc17da637a0ce;p=platform%2Fcore%2Fapi%2Finputmethod.git Add ime_context_get_caps_mode in internal header Change-Id: I65250d023970f563a1be2c7e95e411cfc464053b Signed-off-by: Jihoon Kim --- diff --git a/include/inputmethod_internal.h b/include/inputmethod_internal.h index 910562a..207c176 100644 --- a/include/inputmethod_internal.h +++ b/include/inputmethod_internal.h @@ -28,6 +28,8 @@ extern "C" { #endif +typedef struct _ime_context *ime_context_h; + /** * @brief Called when an caps mode is changed. * @@ -153,6 +155,32 @@ EXPORT_API int ime_event_set_candidate_hide_cb(ime_candidate_hide_cb callback_fu */ EXPORT_API int ime_event_set_lookup_table_changed_cb(ime_lookup_table_changed_cb callback_func, void *user_data); +/** + * @brief Gets the caps mode information from the given input context. + * + * @details Each edit field has various attributes for input panel. This function can be + * called to get the caps mode information in ime_show_cb() callback function. + * + * @since_tizen 3.0 + * + * @privilege %http://tizen.org/privilege/ime + * + * @param[in] context The input context information of an associated text input UI control + * @param[out] caps_mode Caps mode information \n @c true to turn on shift mode + * text feature if available, @c false to disable the predictive text feature + * + * @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 + * + * @post Input panel UI should be drawn or operated by this information accordingly. + * + * @see ime_show_cb() + */ +EXPORT_API int ime_context_get_caps_mode(ime_context_h context, bool *caps_mode); + /** * @brief Set keyboard engine. * @@ -164,6 +192,7 @@ EXPORT_API int ime_event_set_lookup_table_changed_cb(ime_lookup_table_changed_cb * * @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 */ diff --git a/include/inputmethod_private.h b/include/inputmethod_private.h index 8aad9a7..b30bb44 100644 --- a/include/inputmethod_private.h +++ b/include/inputmethod_private.h @@ -31,6 +31,7 @@ struct _ime_context { Ecore_IMF_BiDi_Direction bidi_direction;/**< Bidirectional mode */ Ecore_IMF_Input_Panel_Lang language; /**< Preferred input language */ unsigned int client_window; /**< Client application window object */ + Eina_Bool caps_mode; /**< Caps mode */ }; struct _ime_device_info { diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 3c39f31..ac1b49c 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -214,6 +214,7 @@ void CCoreEventCallback::on_ise_show(sclint ic, const int degree, Ise_Context &c input_context.bidi_direction = context.bidi_direction; input_context.language = context.language; input_context.client_window = context.client_window; + input_context.caps_mode = context.caps_mode; g_basic_callback.show(ic, static_cast(&input_context), g_user_data); } @@ -1842,6 +1843,31 @@ int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang * return IME_ERROR_NONE; } +int ime_context_get_caps_mode(ime_context_h context, bool *caps_mode) +{ + ime_error_e retVal = IME_ERROR_NONE; + + if (!context || !caps_mode) { + 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) { + LOGE("_check_privilege returned %d.", retVal); + return retVal; + } + + *caps_mode = static_cast(context->caps_mode); + + return IME_ERROR_NONE; +} + int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name) { ime_error_e retVal = IME_ERROR_NONE;