[Inputmethod Manager][TCSACR-147] Add API to launch IME (#273)
authorInhong <tukkong123@naver.com>
Fri, 15 Jun 2018 06:17:02 +0000 (15:17 +0900)
committerGitHub <noreply@github.com>
Fri, 15 Jun 2018 06:17:02 +0000 (15:17 +0900)
* Add API to launch IME

* Update InputMethodManager.cs

src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs
src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs

index fe9598f..3407f3b 100755 (executable)
@@ -54,5 +54,8 @@ internal static partial class Interop
 
         [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_enabled_ime_count")]
         internal static extern int ImeManagerGetEnabledImeCount();
+
+        [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_prelaunch_ime")]
+        internal static extern ErrorCode ImeManagerPrelaunchIme();
     }
-}
\ No newline at end of file
+}
index 82a0d46..85e3ce7 100755 (executable)
@@ -160,5 +160,28 @@ namespace Tizen.Uix.InputMethodManager
 
             return activeIME;
         }
+
+        /// <summary>
+        /// Requests to pre-launch the IME.
+        /// The developers can use this function to launch IME in On-demand mode.
+        /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/imemanager
+        /// </privilege>
+        /// <exception cref="InvalidOperationException">
+        /// This exception can occur if:
+        /// 1) The application does not have the privilege to call this function.
+        /// 2) Operation failed.
+        /// </exception>
+        /// <since_tizen> 5 </since_tizen>
+        public static void PrelaunchIME()
+        {
+            ErrorCode error = ImeManagerPrelaunchIme();
+            if (error != ErrorCode.None)
+            {
+                Log.Error(LogTag, "PrelaunchIME Failed with error " + error);
+                throw InputMethodManagerExceptionFactory.CreateException(error);
+            }
+        }
     }
-}
\ No newline at end of file
+}