[Inputmethod][TCSACR-161] Add API to hide IME (#345)
authorInhong <tukkong123@naver.com>
Tue, 24 Jul 2018 10:40:18 +0000 (19:40 +0900)
committerGitHub <noreply@github.com>
Tue, 24 Jul 2018 10:40:18 +0000 (19:40 +0900)
src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs
src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs

index cf90bac..ca8468d 100755 (executable)
@@ -188,6 +188,9 @@ internal static partial class Interop
         [DllImport(Libraries.InputMethod, EntryPoint = "ime_get_main_window")]
         internal static extern IntPtr ImeGetMainWindow();
 
+        [DllImport(Libraries.InputMethod, EntryPoint = "ime_request_hide")]
+        internal static extern ErrorCode ImeRequestHide();
+
         [DllImport(Libraries.InputMethod, EntryPoint = "ime_prepare")]
         internal static extern ErrorCode ImePrepare();
 
index 24deca0..8d4a7f9 100755 (executable)
@@ -1990,6 +1990,28 @@ namespace Tizen.Uix.InputMethod
         }
 
         /// <summary>
+        /// Sends the request to hide IME.
+        /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/ime
+        /// </privilege>
+        /// <exception cref="InvalidOperationException">
+        /// This can occur due to the following reasons:
+        /// 1) The application does not have the privilege to call this function.
+        /// 2) The IME main loop isn't started yet.
+        /// </exception>
+        /// <since_tizen> 5 </since_tizen>
+        public static void RequestHide()
+        {
+            ErrorCode error = ImeRequestHide();
+            if (error != ErrorCode.None)
+            {
+                Log.Error(LogTag, "RequestHide Failed with error " + error);
+                throw InputMethodExceptionFactory.CreateException(error);
+            }
+        }
+
+        /// <summary>
         /// This API requests the InputMethodEditor to initialize.
         /// </summary>
         /// <privilege>