[NUI] Add WebView.SetTtsFocus API (#3295)
authorJiyun Yang <ji.yang@samsung.com>
Mon, 12 Jul 2021 04:42:48 +0000 (13:42 +0900)
committerGitHub <noreply@github.com>
Mon, 12 Jul 2021 04:42:48 +0000 (13:42 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs
src/Tizen.NUI/src/internal/WebView.cs

index e9a28e9..efb06bc 100755 (executable)
@@ -111,6 +111,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ClearHistory")]
             public static extern void WebView_ClearHistory(global::System.Runtime.InteropServices.HandleRef 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_WebView_SWIGUpcast")]
             public static extern global::System.IntPtr WebView_SWIGUpcast(global::System.IntPtr jarg1);
 
index c94156f..116334f 100755 (executable)
@@ -859,5 +859,17 @@ namespace Tizen.NUI
         {
             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();
+        }
     }
 }