Add internal API to send an event to IMEngine 00/216500/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 24 Oct 2019 08:31:36 +0000 (17:31 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Sat, 26 Oct 2019 05:23:44 +0000 (14:23 +0900)
Change-Id: Ie3d28fd16a9d35e764cd64a870fa6c3b8e5b5998
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
include/inputmethod_internal.h
src/inputmethod.cpp

index e21b10317264507ff1b9acc253bdaea32dfe4234..fff9fecf0f6f94914f6d0bb5f2baff5dbd0b7eec 100644 (file)
@@ -249,7 +249,20 @@ int ime_flush_imengine();
 int ime_reset_imengine();
 
 /**
- * @brief Send the selected item index in the candidate list.
+ * @brief Send an Event to IMEngine
+ *
+ * @since_tizen 5.5
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @param[in] command The command to be sent.
+ * @param[in] value The value corresponding to the command.
+ */
+int ime_send_imengine_event(int command, unsigned int value);
+
+/**
+ * @brief Sends the selected item index in the candidate list.
  *
  * @since_tizen 3.0
  *
index 829f76d3864d6834d074e78a14a4a51d6d2fd77b..3010ade844b6af676fa585ac2cb93c7d14ff7e73 100644 (file)
@@ -1353,7 +1353,24 @@ EXPORT_API int ime_flush_imengine()
     return IME_ERROR_NONE;
 }
 
-EXPORT_API int ime_reset_imengine()
+EXPORT_API int ime_send_imengine_event(int command, unsigned int value)
+{
+    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.send_imengine_event(-1, NULL, command, value);
+
+    return IME_ERROR_NONE;
+}
+
+EXPORT_API int ime_reset_imengine(void)
 {
     ime_error_e retVal = IME_ERROR_NONE;