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

index feb2c0b..b0dfb9a 100644 (file)
@@ -249,6 +249,19 @@ int ime_flush_imengine(void);
 int ime_reset_imengine(void);
 
 /**
+ * @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 bd83dd2..113aa3e 100644 (file)
@@ -1402,6 +1402,23 @@ EXPORT_API int ime_flush_imengine(void)
     return IME_ERROR_NONE;
 }
 
+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;