* @param[in] key The key event of the keyboard
* @param[in] user_data User data to be passed from the callback registration function
*/
-typedef bool (*ime_process_key_event_with_imengine_cb)(scim::KeyEvent &key, void *user_data);
+typedef void (*ime_process_key_event_with_imengine_cb)(scim::KeyEvent &key, uint32_t serial, void *user_data);
/**
* @brief Called when a autocapital type is set.
*/
int ime_set_engine_loader_flag(bool flag);
+/**
+ * @brief Sends the key event processing result.
+ *
+ * @since_tizen 6.0
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @param[in] is_success The result value to be sent, indicating whether the key event processing succeeded 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
+ */
+int ime_send_key_event_processing_result(scim::KeyEvent &key, uint32_t serial, bool is_success);
+
#ifdef __cplusplus
}
#endif
void on_set_mime_type(const sclchar *mime_type);
void on_set_prediction_hint_data(const sclchar *key, const sclchar *value);
void on_set_optimization_hint(sclu32 hint);
- void on_process_key_event_with_imengine(scim::KeyEvent &key, sclu32 *ret);
+ void on_process_key_event_with_imengine(scim::KeyEvent &key, sclu32 serial);
void on_set_autocapital_type(sclu32 type);
void on_set_prediction_allow(sclu32 prediction_allow);
void on_trigger_property(const sclchar *property);
}
}
-void CCoreEventCallback::on_process_key_event_with_imengine(scim::KeyEvent &key, sclu32 *ret)
+void CCoreEventCallback::on_process_key_event_with_imengine(scim::KeyEvent &key, sclu32 serial)
{
if (g_event_callback.process_key_event_with_imengine) {
- bool processed = g_event_callback.process_key_event_with_imengine(key, g_event_callback.process_key_event_with_imengine_user_data);
-
- if (ret)
- *ret = processed ? 1 : 0;
- } else {
- if (ret) *ret = 0;
+ g_event_callback.process_key_event_with_imengine(key, serial, g_event_callback.process_key_event_with_imengine_user_data);
}
}
return IME_ERROR_NONE;
}
+
+EXPORT_API int ime_send_key_event_processing_result(scim::KeyEvent &key, uint32_t serial, bool is_success)
+{
+ 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_key_event_processing_result(key, serial, is_success);
+
+ return IME_ERROR_NONE;
+}
//LCOV_EXCL_STOP
EXPORT_API int ime_update_input_panel_event(ime_event_type_e type, unsigned int value)