*/
EXPORT_API int ime_request_hide();
+/**
+ * @brief Explicitly request IME to initialize
+ *
+ * @details When using ime_run API, the initialize / prepare / finalize procedures
+ * are processed automatically inside the IME application loop.
+ * But in case of not using ime_run API, which means the IME application has
+ * its own main loop, these procedures need to be requested explicitly.
+ *
+ * @since_tizen 4.0
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @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
+ */
+EXPORT_API int ime_initialize();
+
+/**
+ * @brief Request IME to prepare resources such as IME window and socket connection
+ *
+ * @details Like ime_initialize() function, this procedure is automatically processed
+ * when using ime_run() API. Call this function only when ime_run() is not used and
+ * the IME application has to handle main loop by itself.
+ *
+ * @since_tizen 4.0
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @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_OPERATION_FAILED Operation failed
+ */
+EXPORT_API int ime_prepare();
+
+/**
+ * @brief Explicitly request IME to finalize
+ *
+ * @since_tizen 4.0
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @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
+ */
+EXPORT_API int ime_finalize();
+
#ifdef __cplusplus
}
#endif
return IME_ERROR_NONE;
}
+int ime_initialize()
+{
+ ime_error_e retVal = IME_ERROR_NONE;
+
+ retVal = _check_privilege();
+ if (retVal != IME_ERROR_NONE) {
+ LOGE("_check_privilege returned %d.", retVal);
+ return retVal;
+ }
+
+ g_core.init();
+
+ return retVal;
+}
+
+int ime_prepare()
+{
+ ime_error_e retVal = IME_ERROR_NONE;
+
+ if (g_running) {
+ LOGE("inputmethod main loop is already running.");
+ return IME_ERROR_OPERATION_FAILED;
+ }
+
+ retVal = _check_privilege();
+ if (retVal != IME_ERROR_NONE) {
+ LOGE("_check_privilege returned %d.", retVal);
+ return retVal;
+ }
+
+ g_core.prepare();
+
+ g_running = true;
+
+ return retVal;
+}
+
+int ime_finalize()
+{
+ ime_error_e retVal = IME_ERROR_NONE;
+
+ retVal = _check_privilege();
+ if (retVal != IME_ERROR_NONE) {
+ LOGE("_check_privilege returned %d.", retVal);
+ return retVal;
+ }
+
+ g_core.fini();
+
+ return retVal;
+}
+
int ime_select_candidate(unsigned int index)
{
ime_error_e retVal = IME_ERROR_NONE;