EXPORT_API int ime_get_surrounding_text(int maxlen_before, int maxlen_after, char **text, int *cursor_pos);
/**
+ * @brief Requests to set selection.
+ *
+ * @since_tizen 3.0
+ *
+ * @privlevel public
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @param[in] start The start cursor position in text (in characters not bytes)
+ * @param[in] end The end cursor position in text (in characters not bytes)
+ *
+ * @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
+ */
+EXPORT_API int ime_set_selection(int start, int end);
+
+/**
* @brief This API returns the pointer of input panel main window.
*
* @remarks The specific error code can be obtained using the get_last_result() method if this function returns NULL.
return IME_ERROR_NONE;
}
+int ime_set_selection(int start, int end)
+{
+ ime_error_e retVal = IME_ERROR_NONE;
+
+ if (start < 0) {
+ 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;
+ }
+
+ g_core.set_selection(start, end);
+
+ return IME_ERROR_NONE;
+}
+
Evas_Object* ime_get_main_window(void)
{
ime_error_e retVal = IME_ERROR_NONE;