[NUI] Add WebView.SetTtsFocus(bool) method (#3310)
authorJiyun Yang <ji.yang@samsung.com>
Thu, 15 Jul 2021 07:54:31 +0000 (16:54 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 19 Jul 2021 09:01:03 +0000 (18:01 +0900)
This API sets/unsets the tts focus to the webview.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs
src/Tizen.NUI/src/internal/WebView/WebView.cs

index 26ecbe3..9fdbd50 100755 (executable)
@@ -250,6 +250,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SWIGUpcast")]
             public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SetTtsFocus")]
+            public static extern void SetTtsFocus(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WebViewPageLoadSignal_PageLoadStarted")]
             public static extern global::System.IntPtr NewWebViewPageLoadSignalPageLoadStarted(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index 35fc19e..52bafc4 100755 (executable)
@@ -2029,6 +2029,18 @@ namespace Tizen.NUI.BaseComponents
             CookieManager.ClearCookies();
         }
 
+        /// <summary>
+        /// Sets the tts focus to the webview.
+        /// Please note that it only works when the webview does not have keyinput focus.
+        /// If the webview has a keyinput focus, it also has tts focus so calling SetTtsFocus(false) is ignored.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetTtsFocus(bool focused)
+        {
+            Interop.WebView.SetTtsFocus(SwigCPtr, focused);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         internal static WebView DownCast(BaseHandle handle)
         {
             WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);