Add ime_set_engine_loader_flag() interface 26/242226/3
authorInHong Han <inhong1.han@samsung.com>
Mon, 10 Aug 2020 10:36:06 +0000 (19:36 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 27 Aug 2020 07:49:59 +0000 (16:49 +0900)
Change-Id: I628e522feaf6942d059331076bfed28e4ac0538a

include/inputmethod_internal.h
src/inputmethod.cpp

index 8d357ef684eb99e459eda1fbb9de19f5acafba08..b7c692b7514eb23b11d91ac36b639bdc7f7c004b 100644 (file)
@@ -1072,6 +1072,21 @@ int ime_contract_candidate(void);
  */
 int ime_set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode);
 
+/**
+ * @brief Sets flag whether IMEngine is loaded by engine_laoder.
+ *
+ * @since_tizen 5.5
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @param[in] flag Set with Engine Loader mode
+ * @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_set_engine_loader_flag(bool flag);
+
 #ifdef __cplusplus
 }
 #endif
index db30fa495440f6acd10c936a3a6d358abf4050f0..7a174b5cf63dc3074bb1aefc9a94ffc80c58dc29 100644 (file)
@@ -2721,6 +2721,23 @@ EXPORT_API int ime_set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portr
 
     return IME_ERROR_NONE;
 }
+
+EXPORT_API int ime_set_engine_loader_flag(bool flag)
+{
+    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.set_engine_loader_flag(flag);
+
+    return IME_ERROR_NONE;
+}
 //LCOV_EXCL_STOP
 
 EXPORT_API int ime_set_candidate_visibility_state(bool visible)