Add API to set floating mode 09/132409/4
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 5 Jun 2017 02:40:46 +0000 (11:40 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 19 Jun 2017 09:36:49 +0000 (18:36 +0900)
Change-Id: I471ba6b2537077a97f0966c4b1e47940a276f917
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
include/inputmethod.h
src/inputmethod.cpp

index 961332c..25ae89b 100644 (file)
@@ -2255,6 +2255,24 @@ EXPORT_API int ime_send_private_command(const char *command);
 EXPORT_API int ime_commit_content(const char *content, const char *description, const char *mime_types);
 
 /**
+ * @brief Request to set floating mode or not.
+ *
+ * @since_tizen 4.0
+ *
+ * @privlevel public
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @param[in] floating_mode Floating mode 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
+ */
+EXPORT_API int ime_set_floating_mode(bool floating_mode);
+
+/**
  * @}
  */
 
index 1841ff9..4f0b754 100644 (file)
@@ -2033,3 +2033,23 @@ int ime_event_set_mime_type_cb(ime_mime_type_set_cb callback_func, void *user_da
 
     return IME_ERROR_NONE;
 }
+
+int ime_set_floating_mode(bool floating_mode)
+{
+    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) {
+        LOGE("_check_privilege returned %d.", retVal);
+        return retVal;
+    }
+
+    g_core.set_floating_mode(floating_mode);
+
+    return IME_ERROR_NONE;
+}