From: huayong.xu Date: Fri, 9 Apr 2021 06:49:33 +0000 (+0800) Subject: [NUI] Implement some new APIs of web view. X-Git-Tag: citest_t1~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcb9040f0e0b2f4416cf08ef06ef7ac56c0bbddd;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Implement some new APIs of web view. This patch is to add some new APIs such as PageZoomFactor, GetScreenshotAsynchronously, etc --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs index 43f8cc1..d357a94 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs @@ -81,6 +81,30 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_KEY_EVENTS_ENABLED_get")] public static extern int KeyEventsEnabledGet(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_DOCUMENT_BACKGROUND_COLOR_get")] + public static extern int DocumentBackgroundColorGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_TILES_CLEARED_WHEN_HIDDEN_get")] + public static extern int TilesClearedWhenHiddenGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_TILE_COVER_AREA_MULTIPLIER_get")] + public static extern int TileCoverAreaMultiplierGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_CURSOR_ENABLED_BY_CLIENT_get")] + public static extern int CursorEnabledByClientGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_SELECTED_TEXT_get")] + public static extern int SelectedTextGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_PAGE_ZOOM_FACTOR_get")] + public static extern int PageZoomFactorGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_TEXT_ZOOM_FACTOR_get")] + public static extern int TextZoomFactorGet(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Property_LOAD_PROGRESS_PERCENTAGE_get")] + public static extern int LoadProgressPercentageGet(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetFavicon")] public static extern global::System.IntPtr GetFavicon(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -90,9 +114,18 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_LoadHtmlString")] public static extern void LoadHtmlString(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_LoadHtmlStringOverrideCurrentEntry")] + public static extern bool LoadHtmlStringOverrideCurrentEntry(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, string jarg4); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_LoadContents")] + public static extern bool LoadContents(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, uint jarg3, string jarg4, string jarg5, string jarg6); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Reload")] public static extern void Reload(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ReloadWithoutCache")] + public static extern bool ReloadWithoutCache(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_StopLoading")] public static extern void StopLoading(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -102,9 +135,30 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_Resume")] public static extern void Resume(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SuspendNetworkLoading")] + public static extern void SuspendNetworkLoading(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ResumeNetworkLoading")] + public static extern void ResumeNetworkLoading(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_AddCustomHeader")] + public static extern bool AddCustomHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RemoveCustomHeader")] + public static extern bool RemoveCustomHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_StartInspectorServer")] + public static extern uint StartInspectorServer(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_StopInspectorServer")] + public static extern bool StopInspectorServer(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ScrollBy")] public static extern void ScrollBy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ScrollEdgeBy")] + public static extern bool ScrollEdgeBy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GoBack")] public static extern void GoBack(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -147,6 +201,33 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ClearHistory")] public static extern void ClearHistory(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SetScaleFactor")] + public static extern void SetScaleFactor(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetScaleFactor")] + public static extern float GetScaleFactor(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ActivateAccessibility")] + public static extern void ActivateAccessibility(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_HighlightText")] + public static extern bool HighlightText(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, uint jarg4); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_AddDynamicCertificatePath")] + public static extern void AddDynamicCertificatePath(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetScreenshot")] + public static extern global::System.IntPtr GetScreenshot(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetScreenshotAsynchronously")] + public static extern bool GetScreenshotAsynchronously(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3, global::System.Runtime.InteropServices.HandleRef jarg4); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_CheckVideoPlayingAsynchronously")] + public static extern bool CheckVideoPlayingAsynchronously(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterGeolocationPermissionCallback")] + public static extern void RegisterGeolocationPermissionCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SWIGUpcast")] public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1); diff --git a/src/Tizen.NUI/src/internal/WebView/WebView.cs b/src/Tizen.NUI/src/internal/WebView/WebView.cs index 4e0cdf9..70408c1 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebView.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebView.cs @@ -30,6 +30,11 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public class WebView : View { + private Vector4 documentBackgroundColor; + private bool tilesClearedWhenHidden; + private float tileCoverAreaMultiplier; + private bool cursorEnabledByClient; + private readonly WebViewPageLoadSignal pageLoadStartedSignal; private EventHandler pageLoadStartedEventHandler; private WebViewPageLoadCallbackDelegate pageLoadStartedCallback; @@ -181,6 +186,27 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public delegate void JavaScriptPromptCallback(string message1, string message2); + /// + /// The callback function that is invoked when screen shot is captured. + /// + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [EditorBrowsable(EditorBrowsableState.Never)] + public delegate void ScreenshotCapturedCallback(ImageView image); + + /// + /// The callback function that is invoked when video playing is checked. + /// + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [EditorBrowsable(EditorBrowsableState.Never)] + public delegate void VideoPlayingCallback(bool isPlaying); + + /// + /// The callback function that is invoked when geolocation permission is requested. + /// + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [EditorBrowsable(EditorBrowsableState.Never)] + public delegate void GeolocationPermissionCallback(string host, string protocol); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WebViewPageLoadCallbackDelegate(IntPtr data, string pageUrl); @@ -408,6 +434,67 @@ namespace Tizen.NUI } /// + /// Options for searching texts. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum FindOption + { + /// + /// No search flags + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None = 0, + + /// + /// Case insensitive search + /// + [EditorBrowsable(EditorBrowsableState.Never)] + CaseInsensitive = 1 << 0, + + /// + /// Search text only at the beginning of the words + /// + [EditorBrowsable(EditorBrowsableState.Never)] + AtWordStarts = 1 << 1, + + /// + /// Treat capital letters in the middle of words as word start + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TreatMediaCapitalAsWordStart = 1 << 2, + + /// + /// Search backwards + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Backwards = 1 << 3, + + /// + /// If not present the search stops at the end of the document + /// + [EditorBrowsable(EditorBrowsableState.Never)] + WrapAround = 1 << 4, + + /// + /// Show overlay + /// + [EditorBrowsable(EditorBrowsableState.Never)] + ShowOverlay = 1 << 5, + + /// + /// Show indicator + /// + [EditorBrowsable(EditorBrowsableState.Never)] + ShowFindIndiator = 1 << 6, + + /// + /// Show highlight + /// + [EditorBrowsable(EditorBrowsableState.Never)] + ShowHighlight = 1 << 7, + } + + /// /// BackForwardList. /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -663,6 +750,90 @@ namespace Tizen.NUI } /// + /// Background color of web page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 DocumentBackgroundColor + { + get + { + return documentBackgroundColor; + } + set + { + documentBackgroundColor = value; + SetValue(DocumentBackgroundColorProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Whether tiles are cleared or not when hidden. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TilesClearedWhenHidden + { + get + { + return tilesClearedWhenHidden; + } + set + { + tilesClearedWhenHidden = value; + SetValue(TilesClearedWhenHiddenProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Multiplier of cover area of tile when web page is rendered. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float TileCoverAreaMultiplier + { + get + { + return tileCoverAreaMultiplier; + } + set + { + tileCoverAreaMultiplier = value; + SetValue(TileCoverAreaMultiplierProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Whether cursor is enabled or not by client. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool CursorEnabledByClient + { + get + { + return cursorEnabledByClient; + } + set + { + cursorEnabledByClient = value; + SetValue(CursorEnabledByClientProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets selected text in web page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string SelectedText + { + get + { + return (string)GetValue(SelectedTextProperty); + } + } + + /// /// Gets title of web page. /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -675,7 +846,7 @@ namespace Tizen.NUI } /// - /// Gets favicon. + /// Gets favicon of web page. /// [EditorBrowsable(EditorBrowsableState.Never)] public ImageView Favicon @@ -689,6 +860,52 @@ namespace Tizen.NUI } } + /// + /// Zoom factor of web page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float PageZoomFactor + { + get + { + return (float)GetValue(PageZoomFactorProperty); + } + set + { + SetValue(PageZoomFactorProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Zoom factor of text in web page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float TextZoomFactor + { + get + { + return (float)GetValue(TextZoomFactorProperty); + } + set + { + SetValue(TextZoomFactorProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets percentage of loading progress. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float LoadProgressPercentage + { + get + { + return (float)GetValue(LoadProgressPercentageProperty); + } + } + internal static new class Property { internal static readonly int Url = Interop.WebView.UrlGet(); @@ -700,6 +917,14 @@ namespace Tizen.NUI internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet(); internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet(); internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet(); + internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet(); + internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet(); + internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet(); + internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet(); + internal static readonly int SelectedText = Interop.WebView.SelectedTextGet(); + internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet(); + internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet(); + internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet(); } private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => @@ -822,6 +1047,90 @@ namespace Tizen.NUI return temp; }); + private static readonly BindableProperty DocumentBackgroundColorProperty = BindableProperty.Create(nameof(DocumentBackgroundColor), typeof(Vector4), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) => + { + var webview = (WebView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }); + + private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) => + { + var webview = (WebView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }); + + private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) => + { + var webview = (WebView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue)); + } + }); + + private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) => + { + var webview = (WebView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }); + + private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), null, defaultValueCreator: (bindable) => + { + var webview = (WebView)bindable; + string text; + Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text); + return text; + }); + + private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) => + { + var webview = (WebView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var webview = (WebView)bindable; + float temp; + Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp); + return temp; + }); + + private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) => + { + var webview = (WebView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var webview = (WebView)bindable; + float temp; + Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp); + return temp; + }); + + private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), null, defaultValueCreator: (bindable) => + { + var webview = (WebView)bindable; + float percentage; + Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage); + return percentage; + }); + // For rooting handlers internal Dictionary handlerRootMap = new Dictionary(); @@ -859,6 +1168,36 @@ namespace Tizen.NUI } /// + /// Loads the specified html as the content of the view to override current history entry. + /// The html to be loaded + /// Basic URL used for relative paths to external objects + /// URL that could not be reached + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool LoadHtmlStringOverrideCurrentEntry(string html, string basicUri, string unreachableUri) + { + bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, basicUri, unreachableUri); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Requests to load the given contents by MIME type. + /// The contents to be loaded + /// The size of contents (in bytes) + /// The type of contents, "text/html" is assumed if null + /// The encoding for contents, "UTF-8" is assumed if null + /// The base URI to use for relative resources + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri) + { + bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// /// Reloads the Web /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -869,6 +1208,17 @@ namespace Tizen.NUI } /// + /// Reloads the current page's document without cache + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ReloadWithoutCache() + { + bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// /// Stops loading the Web /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -899,7 +1249,75 @@ namespace Tizen.NUI } /// - /// Scroll web view by deltaX and detlaY. + /// Suspends all network loading. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SuspendNetworkLoading() + { + Interop.WebView.SuspendNetworkLoading(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Resumes all network loading. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void ResumeNetworkLoading() + { + Interop.WebView.ResumeNetworkLoading(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Adds custom header. + /// The name of custom header + /// The value of custom header + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool AddCustomHeader(string name, string value) + { + bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Removes custom header. + /// The name of custom header + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool RemoveCustomHeader(string name) + { + bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Starts the inspector server. + /// The port number + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint StartInspectorServer(uint port) + { + uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Stops the inspector server. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool StopInspectorServer() + { + bool result = Interop.WebView.StopInspectorServer(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Scrolls page of web view by deltaX and detlaY. /// The deltaX of scroll /// The deltaY of scroll /// @@ -911,6 +1329,19 @@ namespace Tizen.NUI } /// + /// Scrolls edge of web view by deltaX and deltaY. + /// The deltaX of scroll + /// The deltaY of scroll + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ScrollEdgeBy(int deltaX, int deltaY) + { + bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// /// Goes to the back /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -1078,6 +1509,120 @@ namespace Tizen.NUI } /// + /// Scales the current page, centered at the given point. + /// The new factor to be scaled + /// The center coordinate + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScaleFactor(float scaleFactor, Vector2 point) + { + Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the current scale factor of the page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetScaleFactor() + { + float result = Interop.WebView.GetScaleFactor(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Requests to activate/deactivate the accessibility usage set by web app. + /// The new factor to be scaled + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void ActivateAccessibility(bool activated) + { + Interop.WebView.ActivateAccessibility(SwigCPtr, activated); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Searches and highlights the given string in the document. + /// The text to be searched + /// The options to search + /// The maximum match count to search + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool HighlightText(string text, FindOption options, uint maxMatchCount) + { + bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Adds dynamic certificate path. + /// Host that required client authentication + /// The file path stored certificate + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddDynamicCertificatePath(string host, string certPath) + { + Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Get snapshot of the specified viewArea of page. + /// Host that required client authentication + /// The file path stored certificate + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor) + { + IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor); + ImageView imageView = new ImageView(image, true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return imageView; + } + + /// + /// Get snapshot of the specified viewArea of page. + /// Host that required client authentication + /// The file path stored certificate + /// The callback for getting screen shot + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotCapturedCallback callback) + { + System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); + bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Asynchronous requests to check if there is a video playing in the given view. + /// The callback called after checking if video is playing or not + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback) + { + System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); + bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Registers callback which will be called upon geolocation permission request. + /// The callback for requesting geolocation permission + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback) + { + System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); + Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// /// Deprecated. Clears the cache of current WebView. /// [EditorBrowsable(EditorBrowsableState.Never)]