From 11bd2d222ec377be7dc7207a25462cdcab5c6bb1 Mon Sep 17 00:00:00 2001 From: Inhong Date: Fri, 15 Jun 2018 15:17:02 +0900 Subject: [PATCH] [Inputmethod Manager][TCSACR-147] Add API to launch IME (#273) * Add API to launch IME * Update InputMethodManager.cs --- .../Interop/Interop.InputMethodManager.cs | 5 ++++- .../InputMethodManager.cs | 25 +++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs b/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs index fe9598f..3407f3b 100755 --- a/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs +++ b/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs @@ -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 +} diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs index 82a0d46..85e3ce7 100755 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs +++ b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs @@ -160,5 +160,28 @@ namespace Tizen.Uix.InputMethodManager return activeIME; } + + /// + /// Requests to pre-launch the IME. + /// The developers can use this function to launch IME in On-demand mode. + /// + /// + /// http://tizen.org/privilege/imemanager + /// + /// + /// This exception can occur if: + /// 1) The application does not have the privilege to call this function. + /// 2) Operation failed. + /// + /// 5 + 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 +} -- 2.7.4