Add a new api to update geometry of input panel 37/192537/9
authorInhong Han <inhong1.han@samsung.com>
Tue, 6 Nov 2018 07:58:38 +0000 (16:58 +0900)
committerInhong Han <inhong1.han@samsung.com>
Wed, 14 Nov 2018 07:02:54 +0000 (16:02 +0900)
Change-Id: I432eddb5b8dd60236db46cc7558ac47a652663cc

include/inputmethod.h
src/inputmethod.cpp

index 0710aff..e098c29 100644 (file)
@@ -2465,6 +2465,28 @@ int ime_request_hide(void);
 int ime_update_input_panel_event(ime_event_type_e type, unsigned int value);
 
 /**
+ * @brief Updates a custom geometry of input panel window.
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @privilege %http://tizen.org/privilege/ime
+ *
+ * @param[in] x The x position in screen
+ * @param[in] y The y position in screen
+ * @param[in] width The window width
+ * @param[in] height The window height
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #IME_ERROR_NONE No error
+ * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
+ * @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_update_custom_geometry(int x, int y, int width, int height);
+
+/**
  * @}
  */
 
index bfb4650..5ce480f 100644 (file)
@@ -2087,3 +2087,25 @@ EXPORT_API int ime_update_input_panel_event(ime_event_type_e type, unsigned int
 
     return IME_ERROR_NONE;
 }
+
+EXPORT_API int ime_update_custom_geometry(int x, int y, int width, int height)
+{
+    ime_error_e retVal = IME_ERROR_NONE;
+
+    if (x < 0 || y < 0 || width < 0 || height < 0) {
+        LOGW("IME_ERROR_INVALID_PARAMETER");
+        return IME_ERROR_INVALID_PARAMETER;
+    }
+
+    retVal = _check_privilege();
+    if (retVal != IME_ERROR_NONE) return retVal;
+
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
+        return IME_ERROR_NOT_RUNNING;
+    }
+
+    g_core.update_geometry(x, y, width, height);
+
+    return IME_ERROR_NONE;
+}