From: Jihoon Kim Date: Mon, 5 Jun 2017 02:40:46 +0000 (+0900) Subject: Add API to set floating mode X-Git-Tag: submit/tizen/20170621.060002~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9292a8886f45a50143cb06932c01d7331adf6b1c;p=platform%2Fcore%2Fapi%2Finputmethod.git Add API to set floating mode Change-Id: I471ba6b2537077a97f0966c4b1e47940a276f917 Signed-off-by: Jihoon Kim --- diff --git a/include/inputmethod.h b/include/inputmethod.h index 961332c..25ae89b 100644 --- a/include/inputmethod.h +++ b/include/inputmethod.h @@ -2254,6 +2254,24 @@ EXPORT_API int ime_send_private_command(const char *command); */ EXPORT_API int ime_commit_content(const char *content, const char *description, const char *mime_types); +/** + * @brief Request to set floating mode or not. + * + * @since_tizen 4.0 + * + * @privlevel public + * + * @privilege %http://tizen.org/privilege/ime + * + * @param[in] floating_mode Floating mode or not + * + * @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 + */ +EXPORT_API int ime_set_floating_mode(bool floating_mode); + /** * @} */ diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 1841ff9..4f0b754 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -2033,3 +2033,23 @@ int ime_event_set_mime_type_cb(ime_mime_type_set_cb callback_func, void *user_da return IME_ERROR_NONE; } + +int ime_set_floating_mode(bool floating_mode) +{ + 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) { + LOGE("_check_privilege returned %d.", retVal); + return retVal; + } + + g_core.set_floating_mode(floating_mode); + + return IME_ERROR_NONE; +}