From: InHong Han Date: Wed, 23 May 2018 10:42:51 +0000 (+0900) Subject: Add API to launch IME on on-demand mode X-Git-Tag: submit/tizen/20180531.083916~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa1a82eafcd4d9503430c52e2f53bfc1d04f2148;p=platform%2Fcore%2Fapi%2Finputmethod-manager.git Add API to launch IME on on-demand mode Change-Id: Ia011c0c92a19539f52b8a98e0df9006a3924d99d --- diff --git a/include/inputmethod_manager.h b/include/inputmethod_manager.h index 11f0a4b..06f88c2 100755 --- a/include/inputmethod_manager.h +++ b/include/inputmethod_manager.h @@ -133,6 +133,20 @@ EXPORT_API int ime_manager_get_active_ime(char **app_id); */ EXPORT_API int ime_manager_get_enabled_ime_count(void); +/** + * @brief Requests to pre-launch the IME. + * @details The developers can use this function to launch IME on On-demand mode. + * @since_tizen 5.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/imemanager + * @return @c 0 on success, + * otherwise a negative error value + * @retval #IME_MANAGER_ERROR_NONE No error + * @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function + * @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed + */ +EXPORT_API int ime_manager_prelaunch_ime(void); + /** * @} diff --git a/src/inputmethod_manager.cpp b/src/inputmethod_manager.cpp index 3105996..63fdab7 100755 --- a/src/inputmethod_manager.cpp +++ b/src/inputmethod_manager.cpp @@ -151,3 +151,20 @@ int ime_manager_get_enabled_ime_count(void) return enable_ime_count; } + +int ime_manager_prelaunch_ime(void) +{ + ime_manager_error_e retVal = IME_MANAGER_ERROR_NONE; + + retVal = _check_privilege(); + if (retVal != IME_MANAGER_ERROR_NONE) { + return retVal; + } + + int ret = isf_control_prelaunch_ise(); + if (ret < 0) { + return IME_MANAGER_ERROR_OPERATION_FAILED; + } + + return IME_MANAGER_ERROR_NONE; +}