From ab043fc6e8262d23dccc9d253a9a3d5cc00879e4 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 10 Aug 2020 19:36:06 +0900 Subject: [PATCH] Add ime_set_engine_loader_flag() interface Change-Id: I628e522feaf6942d059331076bfed28e4ac0538a --- inputmethod/include/inputmethod_internal.h | 15 +++++++++++++++ inputmethod/src/inputmethod.cpp | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/inputmethod/include/inputmethod_internal.h b/inputmethod/include/inputmethod_internal.h index 7ba5673..4978646 100644 --- a/inputmethod/include/inputmethod_internal.h +++ b/inputmethod/include/inputmethod_internal.h @@ -1072,6 +1072,21 @@ int ime_contract_candidate(void); */ int ime_set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode); +/** + * @brief Sets flag whether IMEngine is loaded by engine_laoder. + * + * @since_tizen 5.5 + * + * @privilege %http://tizen.org/privilege/ime + * + * @param[in] flag Set with Engine Loader mode + * @return 0 on success, otherwise a negative error value + * @retval #IME_ERROR_NONE No error + * @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 + */ +int ime_set_engine_loader_flag(bool flag); + #ifdef __cplusplus } #endif diff --git a/inputmethod/src/inputmethod.cpp b/inputmethod/src/inputmethod.cpp index e24db10..4706d71 100644 --- a/inputmethod/src/inputmethod.cpp +++ b/inputmethod/src/inputmethod.cpp @@ -2902,6 +2902,23 @@ EXPORT_API int ime_set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portr return IME_ERROR_NONE; } + +EXPORT_API int ime_set_engine_loader_flag(bool flag) +{ + 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.set_engine_loader_flag(flag); + + return IME_ERROR_NONE; +} //LCOV_EXCL_STOP EXPORT_API int ime_update_input_panel_event(ime_event_type_e type, unsigned int value) -- 2.34.1