Add API to launch IME on on-demand mode 27/179927/2
authorInHong Han <inhong1.han@samsung.com>
Wed, 23 May 2018 10:42:51 +0000 (19:42 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 23 May 2018 10:47:06 +0000 (19:47 +0900)
Change-Id: Ia011c0c92a19539f52b8a98e0df9006a3924d99d

include/inputmethod_manager.h
src/inputmethod_manager.cpp

index 11f0a4b..06f88c2 100755 (executable)
@@ -133,6 +133,20 @@ EXPORT_API int ime_manager_get_active_ime(char **app_id);
  */
 EXPORT_API int ime_manager_get_enabled_ime_count(void);
 
+/**
+ * @brief Requests to pre-launch the IME.
+ * @details The developers can use this function to launch IME on On-demand mode.
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/imemanager
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #IME_MANAGER_ERROR_NONE No error
+ * @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
+ */
+EXPORT_API int ime_manager_prelaunch_ime(void);
+
 
 /**
  * @}
index 3105996..63fdab7 100755 (executable)
@@ -151,3 +151,20 @@ int ime_manager_get_enabled_ime_count(void)
 
     return enable_ime_count;
 }
+
+int ime_manager_prelaunch_ime(void)
+{
+    ime_manager_error_e retVal = IME_MANAGER_ERROR_NONE;
+
+    retVal = _check_privilege();
+    if (retVal != IME_MANAGER_ERROR_NONE) {
+        return retVal;
+    }
+
+    int ret = isf_control_prelaunch_ise();
+    if (ret < 0) {
+        return IME_MANAGER_ERROR_OPERATION_FAILED;
+    }
+
+    return IME_MANAGER_ERROR_NONE;
+}