Support Remote Input interface 49/213149/9
authorInHong Han <inhong1.han@samsung.com>
Mon, 2 Sep 2019 05:12:32 +0000 (14:12 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 4 Sep 2019 01:31:08 +0000 (10:31 +0900)
Change-Id: Icbcd0daac6e06f056783f33f20f2bfcda281eb0d

15 files changed:
AUTHORS
CMakeLists.txt
capi-ui-remote-input.pc.in [new file with mode: 0644]
inputmethod/include/inputmethod.h [moved from include/inputmethod.h with 100% similarity]
inputmethod/include/inputmethod_device_event.h [moved from include/inputmethod_device_event.h with 100% similarity]
inputmethod/include/inputmethod_internal.h [moved from include/inputmethod_internal.h with 100% similarity]
inputmethod/include/inputmethod_keydef.h [moved from include/inputmethod_keydef.h with 100% similarity]
inputmethod/include/inputmethod_private.h [moved from include/inputmethod_private.h with 100% similarity]
inputmethod/include/privilege_checker_private.h [moved from include/privilege_checker_private.h with 100% similarity]
inputmethod/src/inputmethod.cpp [moved from src/inputmethod.cpp with 100% similarity]
inputmethod/src/privilege_checker.cpp [moved from src/privilege_checker.cpp with 100% similarity]
packaging/capi-ui-inputmethod.spec
remote_input/include/remote_input.h [new file with mode: 0644]
remote_input/include/remote_input_private.h [new file with mode: 0644]
remote_input/src/remote_input.cpp [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index 6fbb84d..3718db6 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,3 +2,4 @@ Sungmin Kwak <sungmin.kwak@samsung.com>
 Ji-hoon Lee <dalton.lee@samsung.com>
 Jihoon Kim <jihoon48.kim@samsung.com>
 Jae Yong Lee <jaeyong911.lee@samsung.com>
+Inhong Han <inhong1.han@samsung.com>
\ No newline at end of file
index de97864..1994c9a 100644 (file)
@@ -7,7 +7,9 @@ SET(maintainer "Ji-hoon Lee <dalton.lee@samsung.com>")
 SET(description "Input Method APIs")
 SET(service "ui")
 SET(submodule "inputmethod")
+SET(remote_submodule "remote-input")
 SET(dependents "capi-base-common dlog evas eina ecore-imf libscl-core isf cynara-client cynara-session")
+SET(remote_dependents "capi-base-common dlog ecore-imf isf cynara-client cynara-session")
 SET(LIBDIR ${LIB_INSTALL_DIR})
 
 SET(Services
@@ -45,15 +47,19 @@ IF( ${sfind} EQUAL -1 )
 ENDIF( ${sfind} EQUAL -1 )
 
 SET(fw_name "${project_prefix}-${service}-${submodule}")
+SET(remote_fw_name "${project_prefix}-${service}-${remote_submodule}")
 
 PROJECT(${fw_name} CXX)
+PROJECT(${remote_fw_name} CXX)
 
 SET(CMAKE_INSTALL_PREFIX ${prefix})
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(VERSION ${version})
 
-SET(INC_DIR include)
-INCLUDE_DIRECTORIES(${INC_DIR})
+SET(INC_DIR inputmethod/include)
+SET(REMOTE_INC_DIR remote_input/include)
+INCLUDE_DIRECTORIES(${INC_DIR}
+                    ${REMOTE_INC_DIR})
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
@@ -61,6 +67,11 @@ FOREACH(flag ${${fw_name}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
+pkg_check_modules(${remote_fw_name} REQUIRED ${remote_dependents})
+FOREACH(flag ${${remote_fw_name}_CFLAGS})
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -fpermissive")
 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
 
@@ -73,11 +84,18 @@ ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
 
-aux_source_directory(src SOURCES)
+aux_source_directory(inputmethod/src SOURCES)
 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
-
 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
 
+SET(REMOTE-SRCS
+    remote_input/src/remote_input.cpp
+    inputmethod/src/privilege_checker.cpp
+)
+
+ADD_LIBRARY(${remote_fw_name} SHARED ${REMOTE-SRCS})
+TARGET_LINK_LIBRARIES(${remote_fw_name} ${${remote_fw_name}_LDFLAGS})
+
 SET_TARGET_PROPERTIES(${fw_name}
      PROPERTIES
      VERSION ${FULLVER}
@@ -85,6 +103,13 @@ SET_TARGET_PROPERTIES(${fw_name}
      CLEAN_DIRECT_OUTPUT 1
 )
 
+SET_TARGET_PROPERTIES(${remote_fw_name}
+     PROPERTIES
+     VERSION ${FULLVER}
+     SOVERSION ${MAJORVER}
+     CLEAN_DIRECT_OUTPUT 1
+)
+
 INSTALL(TARGETS ${fw_name} DESTINATION ${LIBDIR})
 INSTALL(
         DIRECTORY ${INC_DIR}/ DESTINATION include
@@ -93,6 +118,14 @@ INSTALL(
         PATTERN "${INC_DIR}/*.h"
         )
 
+INSTALL(TARGETS ${remote_fw_name} DESTINATION ${LIBDIR})
+INSTALL(
+        DIRECTORY ${REMOTE_INC_DIR}/ DESTINATION include
+        FILES_MATCHING
+        PATTERN "*_private.h" EXCLUDE
+        PATTERN "${REMOTE_INC_DIR}/*.h"
+        )
+
 SET(PC_NAME ${fw_name})
 SET(PC_REQUIRED ${dependents})
 SET(PC_LDFLAGS -l${fw_name})
@@ -104,6 +137,18 @@ CONFIGURE_FILE(
 )
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIBDIR}/pkgconfig)
 
+SET(REMOTE_PC_NAME ${remote_fw_name})
+SET(REMOTE_PC_DESCRIPTION "Remote Input APIs")
+SET(REMOTE_PC_REQUIRED ${remote_dependents})
+SET(REMOTE_PC_LDFLAGS -l${remote_fw_name})
+
+CONFIGURE_FILE(
+    capi-ui-remote-input.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${remote_fw_name}.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${remote_fw_name}.pc DESTINATION ${LIBDIR}/pkgconfig)
+
 IF(UNIX)
 
 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
diff --git a/capi-ui-remote-input.pc.in b/capi-ui-remote-input.pc.in
new file mode 100644 (file)
index 0000000..496e105
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIBDIR@
+includedir=/usr/include
+
+Name: @REMOTE_PC_NAME@
+Description: @REMOTE_PC_DESCRIPTION@
+Version: @VERSION@
+Requires: @REMOTE_PC_REQUIRED@
+Libs: -L${libdir} @REMOTE_PC_LDFLAGS@
+Cflags: -I${includedir}
index b0afb60..ce10fe1 100644 (file)
@@ -21,7 +21,6 @@ Requires(postun): /sbin/ldconfig
 %description
 Input Method Library
 
-
 %package devel
 Summary:  Input Method Library (Development)
 Group:    Development/Libraries
@@ -30,6 +29,22 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 Input Method Library (Development)
 
+%package -n capi-ui-remote-input
+Summary:    Remote Input Library
+Group:      Graphics & UI Framework/Input
+Requires: %{name} = %{version}-%{release}
+
+%description -n capi-ui-remote-input
+Remote Input Library
+
+%package -n capi-ui-remote-input-devel
+Summary:    Remote Input Library (Development)
+Group:      Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n capi-ui-remote-input-devel
+Remote Input Library (Development)
+
 %if 0%{?gcov:1}
 %package gcov
 Summary:  Input Method (gcov)
@@ -89,9 +104,19 @@ install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
 
 %files devel
 %{_includedir}/inputmethod*.h
-%{_libdir}/pkgconfig/*.pc
+%{_libdir}/pkgconfig/capi-ui-inputmethod.pc
 %{_libdir}/libcapi-ui-inputmethod.so
 
+%files -n capi-ui-remote-input
+%manifest capi-ui-inputmethod.manifest
+%{_libdir}/libcapi-ui-remote-input.so.*
+%license LICENSE
+
+%files -n capi-ui-remote-input-devel
+%{_includedir}/remote_input*.h
+%{_libdir}/pkgconfig/capi-ui-remote-input.pc
+%{_libdir}/libcapi-ui-remote-input.so
+
 %if 0%{?gcov:1}
 %files gcov
 %{_datadir}/gcov/obj/*
diff --git a/remote_input/include/remote_input.h b/remote_input/include/remote_input.h
new file mode 100644 (file)
index 0000000..98eb12c
--- /dev/null
@@ -0,0 +1,492 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TIZEN_UIX_REMOTE_INPUT_H__
+#define __TIZEN_UIX_REMOTE_INPUT_H__
+
+
+/**
+ * @file remote_input.h
+ * @brief This file contains remote input APIs and related enumeration.
+ */
+
+#include <tizen.h>
+#include <Ecore_IMF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup CAPI_UIX_INPUTMETHOD_MODULE
+ * @{
+ */
+
+
+/**
+ * @platform
+ * @brief Enumeration for remote input function error.
+ * @since_tizen 5.5
+ */
+typedef enum {
+    REMOTE_INPUT_ERROR_NONE = TIZEN_ERROR_NONE,                     /**< Successful */
+    REMOTE_INPUT_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+    REMOTE_INPUT_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+    REMOTE_INPUT_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,         /**< Out of Memory */
+    REMOTE_INPUT_OPERATION_FAILED,                                  /**< Operation failed */
+} remote_input_error_e;
+
+/**
+ * @platform
+ * @brief Enumeration for key types.
+ * @since_tizen 5.5
+ * @see remote_input_send_key_event()
+ */
+typedef enum {
+    REMOTE_INPUT_KEY_ENTER = 0, /**< Enter key */
+    REMOTE_INPUT_KEY_SPACE,     /**< Space key */
+    REMOTE_INPUT_KEY_BACKSPACE, /**< Backspace key */
+    REMOTE_INPUT_KEY_ESC,       /**< Escape key */
+    REMOTE_INPUT_KEY_UP,        /**< Up key */
+    REMOTE_INPUT_KEY_DOWN,      /**< Down key */
+    REMOTE_INPUT_KEY_LEFT,      /**< LEFT key */
+    REMOTE_INPUT_KEY_RIGHT,     /**< Right key */
+    REMOTE_INPUT_KEY_PAGE_UP,   /**< Page up key */
+    REMOTE_INPUT_KEY_PAGE_DOWN, /**< Page down key */
+    REMOTE_INPUT_KEY_SELECT,    /**< Select key */
+    REMOTE_INPUT_KEY_CANCEL,    /**< Cancel key */
+} remote_input_key_type_e;
+
+/**
+ * @platform
+ * @brief Enumeration for input resources.
+ * @since_tizen 5.5
+ * @see remote_input_resource_changed_cb()
+ */
+typedef enum {
+    REMOTE_INPUT_RESOURCE_LOCAL = 0, /**< Input event from IME, H/W keyboard */
+    REMOTE_INPUT_RESOURCE_REMOTE,    /**< Input event from remote input API */
+} remote_input_resource_e;
+
+/**
+ * @platform
+ * @brief Handle of the remote input.
+ * @since_tizen 5.5
+ */
+typedef struct remote_input_s *remote_input_h;
+
+/**
+ * @platform
+ * @brief Called when an associated text field has focus.
+ * @since_tizen 5.5
+ * @param[in] user_data User data to be passed to the callback function
+ * @pre The callback can be registered using remote_input_focus_in_callback_set() function.
+ * @see remote_input_focus_in_callback_set()
+ * @see remote_input_focus_in_callback_unset()
+ */
+typedef void (*remote_input_focus_in_cb)(void *user_data);
+
+/**
+ * @platform
+ * @brief Called when an associated text field loses focus.
+ * @since_tizen 5.5
+ * @param[in] user_data User data to be passed to the callback function
+ * @pre The callback can be registered using remote_input_focus_out_callback_set() function.
+ * @see remote_input_focus_out_callback_set()
+ * @see remote_input_focus_out_callback_unset()
+ */
+typedef void (*remote_input_focus_out_cb)(void *user_data);
+
+/**
+ * @platform
+ * @brief Called when an associated text field requests the input panel to set its attributes.
+ * @since_tizen 5.5
+ * @remarks This callback will be called after remote_input_focus_in_cb().
+ *          It can be called again when the associated text field's attributes are changed.
+ *          Remote IME application should configure its input panel with various attributes.
+ * @param[in] user_data User data to be passed to the callback function
+ * @pre The callback can be registered using remote_input_metadata_updated_callback_set() function.
+ * @see remote_input_metadata_updated_callback_set()
+ * @see remote_input_metadata_updated_callback_unset()
+ * @see remote_input_get_input_hint()
+ * @see remote_input_get_layout()
+ * @see remote_input_get_layout_variation()
+ * @see remote_input_get_autocapital_type()
+ * @see remote_input_get_return_key_state()
+ * @see remote_input_get_return_key_type()
+ */
+typedef void (*remote_input_metadata_updated_cb)(void *user_data);
+
+/**
+ * @platform
+ * @brief Called when an associated text field responds to a request with the surrounding text.
+ * @since_tizen 5.5
+ * @remarks This callback will be called after remote_input_metadata_updated_cb().
+ *          It can be called again when the text or the cursor position in the associated text field is changed.
+ *          @a text can be used only in the callback. To use outside, make a copy.
+ * @param[in] text The UTF-8 string requested
+ * @param[in] cursor_pos The cursor position
+ * @param[in] user_data User data to be passed to the callback function
+ * @pre The callback can be registered using remote_input_text_updated_callback_set() function.
+ * @see remote_input_text_updated_callback_set()
+ * @see remote_input_text_updated_callback_unset()
+ */
+typedef void (*remote_input_text_updated_cb)(const char *text, int cursor_pos, void *user_data);
+
+/**
+ * @platform
+ * @brief Called when the input resource is changed.
+ * @since_tizen 5.5
+ * @param[in] resource The input resource
+ * @param[in] user_data User data to be passed to the callback function
+ * @pre The callback can be registered using remote_input_resource_changed_callback_set() function.
+ * @see remote_input_resource_changed_callback_set()
+ * @see remote_input_resource_changed_callback_unset()
+ */
+typedef void (*remote_input_resource_changed_cb)(remote_input_resource_e resource, void *user_data);
+
+/**
+ * @platform
+ * @brief Creates a remote input handle.
+ * @since_tizen 5.5
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/remoteinput
+ * @remarks If the function succeeds, @a remote_handle must be released with remote_input_destroy().
+ * @param[out] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @retval #REMOTE_INPUT_PERMISSION_DENIED Permission denied
+ * @retval #REMOTE_INPUT_OUT_OF_MEMORY Out of memory
+ * @retval #REMOTE_INPUT_OPERATION_FAILED Operation failure
+ * @see remote_input_destroy()
+ */
+int remote_input_create(remote_input_h *remote_handle);
+
+/**
+ * @platform
+ * @brief Destroys a remote input handle.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @retval #REMOTE_INPUT_OPERATION_FAILED Operation failed
+ * @see remote_input_create()
+ */
+int remote_input_destroy(remote_input_h remote_handle);
+
+/**
+ * @platform
+ * @brief Sets a callback function to be called when an associated text field has focus.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data User data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_focus_in_callback_unset()
+ */
+int remote_input_focus_in_callback_set(remote_input_h remote_handle, remote_input_focus_in_cb callback, void *user_data);
+
+/**
+ * @platform
+ * @brief Unsets the callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_focus_in_callback_set()
+ */
+int remote_input_focus_in_callback_unset(remote_input_h remote_handle);
+
+/**
+ * @platform
+ * @brief Sets a callback function to be called when an associated text field loses focus.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data User data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_focus_out_callback_unset()
+ */
+int remote_input_focus_out_callback_set(remote_input_h remote_handle, remote_input_focus_out_cb callback, void *user_data);
+
+/**
+ * @platform
+ * @brief Unsets the callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_focus_out_callback_set()
+ */
+int remote_input_focus_out_callback_unset(remote_input_h remote_handle);
+
+/**
+ * @platform
+ * @brief Sets a callback function to be called when an associated text field requests the input panel to set its attributes.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data User data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_metadata_updated_callback_unset()
+ */
+int remote_input_metadata_updated_callback_set(remote_input_h remote_handle, remote_input_metadata_updated_cb callback, void *user_data);
+
+/**
+ * @platform
+ * @brief Unsets the callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_metadata_updated_callback_set()
+ */
+int remote_input_metadata_updated_callback_unset(remote_input_h remote_handle);
+
+/**
+ * @platform
+ * @brief Sets a callback function to be called when an associated text field responds to a request with the surrounding text.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data User data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_inputl_text_updated_callback_unset()
+ */
+int remote_input_text_updated_callback_set(remote_input_h remote_handle, remote_input_text_updated_cb callback, void *user_data);
+
+/**
+ * @platform
+ * @brief Unsets the callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_inputl_text_updated_callback_set()
+ */
+int remote_input_text_updated_callback_unset(remote_input_h remote_handle);
+
+/**
+ * @platform
+ * @brief Sets a callback function to be called when the input resource is changed.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data User data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_resource_changed_callback_unset()
+ */
+int remote_input_resource_changed_callback_set(remote_input_h remote_handle, remote_input_resource_changed_cb callback, void *user_data);
+
+/**
+ * @platform
+ * @brief Unsets the callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @see remote_input_resource_changed_callback_set()
+ */
+int remote_input_resource_changed_callback_unset(remote_input_h remote_handle);
+
+/**
+ * @platform
+ * @brief Gets the input hint information.
+ * @details Each edit field has various attributes for input panel.
+ *          This function can be called to get the input hint information in remote_input_metadata_updated_cb() callback function.
+ * @since_tizen 5.5
+ * @remarks @a input_hint is a bit-wise value which recommends the input panel provide an auto completion and so on
+ *          if it is capable of supporting such features.
+ * @param[in] remote_handle The remote input handle
+ * @param[out] input_hint Input hint information
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @post Remote input panel UI should be drawn or operated by this information accordingly.
+ * @see remote_input_metadata_updated_cb()
+ */
+int remote_input_get_input_hint(remote_input_h remote_handle, Ecore_IMF_Input_Hints *input_hint);
+
+/**
+ * @platform
+ * @brief Gets the layout information.
+ * @details Each edit field has various attributes for input panel.
+ *          This function can be called to get the layout information in remote_input_metadata_updated_cb() callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[out] layout Layout information
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @post Remote input panel UI should be drawn or operated by this information accordingly.
+ * @see remote_input_metadata_updated_cb()
+ */
+int remote_input_get_layout(remote_input_h remote_handle, Ecore_IMF_Input_Panel_Layout *layout);
+
+/**
+ * @platform
+ * @brief Gets the layout variation information.
+ * @details Each edit field has various attributes for input panel.
+ *          This function can be called to get the layout variation information in remote_input_metadata_updated_cb() callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[out] variation The layout variation
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @post Remote input panel UI should be drawn or operated by this information accordingly.
+ * @see remote_input_metadata_updated_cb()
+ */
+int remote_input_get_layout_variation(remote_input_h remote_handle, int *variation);
+
+/**
+ * @platform
+ * @brief Gets the autocapital type information.
+ * @details Each edit field has various attributes for input panel.
+ *          This function can be called to get the autocapital type information in remote_input_metadata_updated_cb() callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[out] autocapital_type autocapital_type Autocapital type information
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @post Remote input panel UI should be drawn or operated by this information accordingly.
+ * @see remote_input_metadata_updated_cb()
+ */
+int remote_input_get_autocapital_type(remote_input_h remote_handle, Ecore_IMF_Autocapital_Type *autocapital_type);
+
+/**
+ * @platform
+ * @brief Gets the return key state information.
+ * @details Each edit field has various attributes for input panel.
+ *          This function can be called to get the return key state information in remote_input_metadata_updated_cb() callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[out] return_key_state The return key state information \n @c true to enable return key button, @c false to disable return key button
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @post Remote input panel UI should be drawn or operated by this information accordingly.
+ * @see remote_input_metadata_updated_cb()
+ */
+int remote_input_get_return_key_state(remote_input_h remote_handle, bool *return_key_state);
+
+/**
+ * @platform
+ * @brief Gets the return key label type information.
+ * @details Each edit field has various attributes for input panel.
+ *          This function can be called to get the return key label type information in remote_input_metadata_updated_cb() callback function.
+ * @since_tizen 5.5
+ * @param[in] remote_handle The remote input handle
+ * @param[out] return_key_type The return key label type information
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @post Remote input panel UI should be drawn or operated by this information accordingly.
+ * @see remote_input_metadata_updated_cb()
+ */
+int remote_input_get_return_key_type(remote_input_h remote_handle, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type);
+
+/**
+ * @platform
+ * @brief Sends a key event to the associated text field.
+ * @since_tizen 5.5
+ * @remarks This function must be used if an associated text field has focus.
+ *          Otherwise, #REMOTE_INPUT_OPERATION_FAILED will be returned.
+ * @param[in] remote_handle The remote input handle
+ * @param[in] key The key type
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @retval #REMOTE_INPUT_OPERATION_FAILED Operation failure
+ */
+int remote_input_send_key_event(remote_input_h remote_handle, remote_input_key_type_e key);
+
+/**
+ * @platform
+ * @brief Sends a commit string to the associated text field.
+ * @since_tizen 5.5
+ * @remarks This function must be used if an associated text field has focus.
+ *          Otherwise, #REMOTE_INPUT_OPERATION_FAILED will be returned.
+ * @param[in] remote_handle The remote input handle
+ * @param[in] text The UTF-8 string to be committed
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @retval #REMOTE_INPUT_OPERATION_FAILED Operation failure
+ */
+int remote_input_send_commit_string(remote_input_h remote_handle, const char *text);
+
+/**
+ * @platform
+ * @brief Updates a preedit string to the associated text field.
+ * @since_tizen 5.5
+ * @remarks This function must be used if an associated text field has focus.
+ *          Otherwise, #REMOTE_INPUT_OPERATION_FAILED will be returned.
+ * @param[in] remote_handle The remote input handle
+ * @param[in] text The UTF-8 string to be committed
+ * @param[in] cursor_pos The cursor position; -1 means at the end of line
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @retval #REMOTE_INPUT_OPERATION_FAILED Operation failure
+ */
+int remote_input_update_preedit_string(remote_input_h remote_handle, const char *text, int cursor_pos);
+
+/**
+ * @platform
+ * @brief Requests to delete surrounding text.
+ * @since_tizen 5.5
+ * @remarks This function must be used if an associated text field has focus.
+ *          Otherwise, #REMOTE_INPUT_OPERATION_FAILED will be returned.
+ * @param[in] remote_handle The remote input handle
+ * @param[in] offset The offset value from the cursor position
+ * @param[in] len The length of the text to delete
+ * @return 0 on success, otherwise a negative error value
+ * @retval #REMOTE_INPUT_ERROR_NONE Successful
+ * @retval #REMOTE_INPUT_INVALID_PARAMETER Invalid parameter
+ * @retval #REMOTE_INPUT_OPERATION_FAILED Operation failure
+ */
+int remote_input_delete_surrounding_text(remote_input_h remote_handle, int offset, int len);
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_UIX_REMOTE_INPUT_H__ */
+
diff --git a/remote_input/include/remote_input_private.h b/remote_input/include/remote_input_private.h
new file mode 100644 (file)
index 0000000..0c369eb
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TIZEN_UIX_REMOTE_INPUT_PRIVATE_H__
+#define __TIZEN_UIX_REMOTE_INPUT_PRIVATE_H__
+
+#include <Ecore_IMF.h>
+#include <isf_remote_control.h>
+#include <remote_input.h>
+
+struct remote_input_s {
+    remote_control_client *remote_client;
+    Ecore_IMF_Input_Hints hint;
+    Ecore_IMF_Input_Panel_Layout layout;
+    int variation;
+    Ecore_IMF_Autocapital_Type autocapital_type;
+    bool return_key_disabled;
+    Ecore_IMF_Input_Panel_Return_Key_Type return_key_type;
+    remote_input_metadata_updated_cb metadata_updated_cb;
+    void *metadata_updated_cb_user_data;
+    remote_input_text_updated_cb text_updated_cb;
+    void *text_updated_cb_user_data;
+    remote_input_resource_changed_cb resource_changed_cb;
+    void *resource_changed_cb_user_data;
+};
+
+#endif /* __TIZEN_UIX_REMOTE_INPUT_PRIVATE_H__ */
+
diff --git a/remote_input/src/remote_input.cpp b/remote_input/src/remote_input.cpp
new file mode 100644 (file)
index 0000000..8713e76
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <dlog.h>
+#include <remote_input.h>
+#include <remote_input_private.h>
+#include "privilege_checker_private.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "REMOTE_INPUT"
+
+#define REMOTE_PRIVILEGE "http://tizen.org/privilege/remoteinput"
+
+static remote_input_error_e _remote_check_privilege() {
+    char uid[16];
+    remote_input_error_e ret = REMOTE_INPUT_ERROR_NONE;
+
+    if (inputmethod_cynara_initialize() == false) {
+        LOGE("cynara_initialize () == false");
+        return REMOTE_INPUT_PERMISSION_DENIED;
+    }
+
+    snprintf(uid, 16, "%d", getuid());
+    if (check_privilege(uid, REMOTE_PRIVILEGE) == false) {
+        LOGE("check_privilege(uid, REMOTE_PRIVILEGE) == false. uid : %s", uid);
+        ret = REMOTE_INPUT_PERMISSION_DENIED;
+    }
+
+    inputmethod_cynara_finish();
+
+    return ret;
+}
+
+static void _metadata_updated_cb(void *user_data, remote_control_entry_metadata_s *data)
+{
+    remote_input_h remote_handle = (remote_input_h)user_data;
+
+    if (remote_handle == NULL) {
+        LOGE("remote handle is not available");
+        return;
+    }
+
+    remote_handle->hint = data->hint;
+    remote_handle->layout = data->layout;
+    remote_handle->variation = data->variation;
+    remote_handle->autocapital_type = data->autocapital_type;
+    remote_handle->return_key_disabled = data->return_key_disabled;
+    remote_handle->return_key_type = data->return_key_type;
+
+    if (remote_handle->metadata_updated_cb) {
+        remote_handle->metadata_updated_cb(remote_handle->metadata_updated_cb_user_data);
+    }
+}
+
+static void _text_updated_cb(void *user_data, const char *text, int cursor_pos)
+{
+    remote_input_h remote_handle = (remote_input_h)user_data;
+
+    if (remote_handle == NULL) {
+        LOGE("remote handle is not available");
+        return;
+    }
+
+    if (remote_handle->text_updated_cb) {
+        remote_handle->text_updated_cb(text, cursor_pos, remote_handle->text_updated_cb_user_data);
+    }
+}
+
+static void _resource_updated_cb(void *user_data, remote_control_input_resource resource)
+{
+    remote_input_h remote_handle = (remote_input_h)user_data;
+
+    if (remote_handle == NULL) {
+        LOGE("remote handle is not available");
+        return;
+    }
+
+    if (remote_handle->resource_changed_cb) {
+        remote_handle->resource_changed_cb(resource == REMOTE_CONTROL_INPUT_RESOURCE_LOCAL ? REMOTE_INPUT_RESOURCE_LOCAL : REMOTE_INPUT_RESOURCE_REMOTE,
+                                           remote_handle->resource_changed_cb_user_data);
+    }
+}
+
+EXPORT_API int remote_input_create(remote_input_h *remote_handle)
+{
+    remote_input_error_e ret = REMOTE_INPUT_ERROR_NONE;
+
+    if (!remote_handle) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    ret = _remote_check_privilege();
+    if (ret != REMOTE_INPUT_ERROR_NONE) {
+        LOGE("REMOTE_INPUT_PERMISSION_DENIED");
+        return ret;
+    }
+
+    struct remote_input_s *remote_input = (remote_input_h)calloc(1, sizeof(struct remote_input_s));
+    if (!remote_input) {
+        LOGE("REMOTE_INPUT_OUT_OF_MEMORY");
+        return REMOTE_INPUT_OUT_OF_MEMORY;
+    }
+
+    remote_input->remote_client = remote_control_connect();
+    if (!remote_input->remote_client) {
+        LOGE("REMOTE_INPUT_OPERATION_FAILED");
+        free(remote_input);
+        remote_input = NULL;
+        return REMOTE_INPUT_OPERATION_FAILED;
+    }
+
+    *remote_handle = (remote_input_h)remote_input;
+
+    return ret;
+}
+
+EXPORT_API int remote_input_destroy(remote_input_h remote_handle)
+{
+    if (!remote_handle || !remote_handle->remote_client) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    if (remote_control_disconnect(remote_handle->remote_client) != REMOTE_CONTROL_ERROR_NONE) {
+        LOGE("REMOTE_INPUT_OPERATION_FAILED");
+        return REMOTE_INPUT_OPERATION_FAILED;
+    } else {
+        remote_handle->remote_client = NULL;
+    }
+
+    free(remote_handle);
+    remote_handle = NULL;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_focus_in_callback_set(remote_input_h remote_handle, remote_input_focus_in_cb callback, void *user_data)
+{
+    if (!remote_handle || !remote_handle->remote_client || !callback) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_focus_in_callback_set(remote_handle->remote_client, callback, user_data);
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_focus_in_callback_unset(remote_input_h remote_handle)
+{
+    if (!remote_handle || !remote_handle->remote_client) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_focus_in_callback_unset(remote_handle->remote_client);
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_focus_out_callback_set(remote_input_h remote_handle, remote_input_focus_out_cb callback, void *user_data)
+{
+    if (!remote_handle || !remote_handle->remote_client || !callback) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_focus_out_callback_set(remote_handle->remote_client, callback, user_data);
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_focus_out_callback_unset(remote_input_h remote_handle)
+{
+    if (!remote_handle || !remote_handle->remote_client) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_focus_out_callback_unset(remote_handle->remote_client);
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_metadata_updated_callback_set(remote_input_h remote_handle, remote_input_metadata_updated_cb callback, void *user_data)
+{
+    if (!remote_handle || !remote_handle->remote_client || !callback) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_entry_metadata_callback_set(remote_handle->remote_client, _metadata_updated_cb, (void *)remote_handle);
+    remote_handle->metadata_updated_cb = callback;
+    remote_handle->metadata_updated_cb_user_data = user_data;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_metadata_updated_callback_unset(remote_input_h remote_handle)
+{
+    if (!remote_handle || !remote_handle->remote_client) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_entry_metadata_callback_unset(remote_handle->remote_client);
+    remote_handle->metadata_updated_cb = NULL;
+    remote_handle->metadata_updated_cb_user_data = NULL;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_text_updated_callback_set(remote_input_h remote_handle, remote_input_text_updated_cb callback, void *user_data)
+{
+    if (!remote_handle || !remote_handle->remote_client || !callback) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_text_updated_callback_set(remote_handle->remote_client, _text_updated_cb, (void *)remote_handle);
+    remote_handle->text_updated_cb = callback;
+    remote_handle->text_updated_cb_user_data = user_data;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_text_updated_callback_unset(remote_input_h remote_handle)
+{
+    if (!remote_handle || !remote_handle->remote_client) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_text_updated_callback_unset(remote_handle->remote_client);
+    remote_handle->text_updated_cb = NULL;
+    remote_handle->text_updated_cb_user_data = NULL;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_resource_changed_callback_set(remote_input_h remote_handle, remote_input_resource_changed_cb callback, void *user_data)
+{
+    if (!remote_handle || !remote_handle->remote_client || !callback) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_input_resource_changed_callback_set(remote_handle->remote_client, _resource_updated_cb, (void *)remote_handle);
+    remote_handle->resource_changed_cb = callback;
+    remote_handle->resource_changed_cb_user_data = user_data;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_resource_changed_callback_unset(remote_input_h remote_handle)
+{
+    if (!remote_handle || !remote_handle->remote_client) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    remote_control_input_resource_changed_callback_unset(remote_handle->remote_client);
+    remote_handle->resource_changed_cb = NULL;
+    remote_handle->resource_changed_cb_user_data = NULL;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_get_input_hint(remote_input_h remote_handle, Ecore_IMF_Input_Hints *input_hint)
+{
+    if (!remote_handle || !input_hint) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    *input_hint = remote_handle->hint;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_get_layout(remote_input_h remote_handle, Ecore_IMF_Input_Panel_Layout *layout)
+{
+    if (!remote_handle || !layout) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    *layout = remote_handle->layout;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_get_layout_variation(remote_input_h remote_handle, int *variation)
+{
+    if (!remote_handle || !variation) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    *variation = remote_handle->variation;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_get_autocapital_type(remote_input_h remote_handle, Ecore_IMF_Autocapital_Type *autocapital_type)
+{
+    if (!remote_handle || !autocapital_type) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    *autocapital_type = remote_handle->autocapital_type;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_get_return_key_state(remote_input_h remote_handle, bool *return_key_state)
+{
+    if (!remote_handle || !return_key_state) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    *return_key_state = remote_handle->return_key_disabled;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_get_return_key_type(remote_input_h remote_handle, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type)
+{
+    if (!remote_handle || !return_key_type) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    *return_key_type = remote_handle->return_key_type;
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_send_key_event(remote_input_h remote_handle, remote_input_key_type_e key)
+{
+    if (!remote_handle || key > REMOTE_INPUT_KEY_CANCEL) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    if (remote_control_send_key_event(remote_handle->remote_client, (remote_control_key_type_e)key) != REMOTE_CONTROL_ERROR_NONE) {
+        LOGE("REMOTE_INPUT_OPERATION_FAILED");
+        return REMOTE_INPUT_OPERATION_FAILED;
+    }
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_send_commit_string(remote_input_h remote_handle, const char *text)
+{
+    if (!remote_handle || !text) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    if (remote_control_send_commit_string(remote_handle->remote_client, text) != REMOTE_CONTROL_ERROR_NONE) {
+        LOGE("REMOTE_INPUT_OPERATION_FAILED");
+        return REMOTE_INPUT_OPERATION_FAILED;
+    }
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_update_preedit_string(remote_input_h remote_handle, const char *text, int cursor_pos)
+{
+    if (!remote_handle || !text || cursor_pos < -1) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    if (remote_control_update_preedit_string(remote_handle->remote_client, text, NULL, cursor_pos) != REMOTE_CONTROL_ERROR_NONE) {
+        LOGE("REMOTE_INPUT_OPERATION_FAILED");
+        return REMOTE_INPUT_OPERATION_FAILED;
+    }
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
+
+EXPORT_API int remote_input_delete_surrounding_text(remote_input_h remote_handle, int offset, int len)
+{
+    if (!remote_handle || len <= 0) {
+        LOGE("REMOTE_INPUT_INVALID_PARAMETER");
+        return REMOTE_INPUT_INVALID_PARAMETER;
+    }
+
+    if (remote_control_delete_surrounding_text(remote_handle->remote_client, offset, len) != REMOTE_CONTROL_ERROR_NONE) {
+        LOGE("REMOTE_INPUT_OPERATION_FAILED");
+        return REMOTE_INPUT_OPERATION_FAILED;
+    }
+
+    return REMOTE_INPUT_ERROR_NONE;
+}
\ No newline at end of file