Add API to set candidate visibility state 01/203101/4
authorInhong Han <inhong1.han@samsung.com>
Wed, 10 Apr 2019 02:00:16 +0000 (11:00 +0900)
committerInhong Han <inhong1.han@samsung.com>
Tue, 16 Apr 2019 11:04:09 +0000 (20:04 +0900)
Change-Id: I8fc7539cb7d1e33db72061f4a388ca1f5b55c536

include/inputmethod.h
src/inputmethod.cpp

index d972539431ea1cbda8e657e70f41b4760dad97a9..0eb468b050125348cd793efca996945f832d4400 100644 (file)
@@ -771,7 +771,7 @@ typedef void (*ime_mime_type_set_request_cb)(const char *mime_type, void *user_d
  *
  * @privilege %http://tizen.org/privilege/ime
  *
- * @remarks @a value is valid only in the callback. To use outside the callback, make a copy.
+ * @remarks @a key and @a value is valid only in the callback. To use outside the callback, make a copy.
  * This function is used by the applications to deliver the prediction hint data message to the input panel.
  *
  * @param[in] key The prediction hint key to be set to the input panel
@@ -2530,6 +2530,24 @@ int ime_request_hide(void);
  */
 int ime_update_input_panel_event(ime_event_type_e type, unsigned int value);
 
+/**
+ * @brief Sets the candidate visibility state.
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @param[in] visible @c true - show candidate string, @c false - hide candidate string
+ *
+ * @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_candidate_visibility_state(bool visible);
+
 /**
  * @}
  */
index af09eb6ebb06dc84bc238f394b4de035bcb47c6b..e5fb4463e4b400de1ab09b9778454bed3f284862 100644 (file)
@@ -2131,3 +2131,23 @@ EXPORT_API int ime_update_input_panel_event(ime_event_type_e type, unsigned int
 
     return IME_ERROR_NONE;
 }
+
+EXPORT_API int ime_set_candidate_visibility_state(bool visible)
+{
+    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;
+
+    if (visible)
+        g_core.show_candidate_string();
+    else
+        g_core.hide_candidate_string();
+
+    return IME_ERROR_NONE;
+}