2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using System.Runtime.InteropServices;
22 using Tizen.NUI.BaseComponents;
23 using Tizen.NUI.Binding;
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 public class WebView : View
33 private Vector4 backgroundColor;
34 private bool tilesClearedWhenHidden;
35 private float tileCoverAreaMultiplier;
36 private bool cursorEnabledByClient;
38 private readonly WebViewPageLoadSignal pageLoadStartedSignal;
39 private EventHandler<WebViewPageLoadEventArgs> pageLoadStartedEventHandler;
40 private WebViewPageLoadCallbackDelegate pageLoadStartedCallback;
42 private readonly WebViewPageLoadSignal pageLoadingSignal;
43 private EventHandler<WebViewPageLoadEventArgs> pageLoadingEventHandler;
44 private WebViewPageLoadCallbackDelegate pageLoadingCallback;
46 private readonly WebViewPageLoadSignal pageLoadFinishedSignal;
47 private EventHandler<WebViewPageLoadEventArgs> pageLoadFinishedEventHandler;
48 private WebViewPageLoadCallbackDelegate pageLoadFinishedCallback;
50 private readonly WebViewPageLoadErrorSignal pageLoadErrorSignal;
51 private EventHandler<WebViewPageLoadErrorEventArgs> pageLoadErrorEventHandler;
52 private WebViewPageLoadErrorCallbackDelegate pageLoadErrorCallback;
54 private readonly WebViewScrollEdgeReachedSignal scrollEdgeReachedSignal;
55 private EventHandler<WebViewScrollEdgeReachedEventArgs> scrollEdgeReachedEventHandler;
56 private WebViewScrollEdgeReachedCallbackDelegate scrollEdgeReachedCallback;
58 private readonly WebViewUrlChangedSignal urlChangedSignal;
59 private EventHandler<WebViewUrlChangedEventArgs> urlChangedEventHandler;
60 private WebViewUrlChangedCallbackDelegate urlChangedCallback;
62 private readonly WebViewFormRepostDecidedSignal formRepostPolicyDecidedSignal;
63 private EventHandler<WebViewFormRepostPolicyDecidedEventArgs> formRepostPolicyDecidedEventHandler;
64 private WebViewFormRepostPolicyDecidedCallbackDelegate formRepostPolicyDecidedCallback;
66 private readonly WebViewFrameRenderedSignal frameRenderedSignal;
67 private EventHandler<EventArgs> frameRenderedEventHandler;
68 private WebViewFrameRenderedCallbackDelegate frameRenderedCallback;
71 /// Creates a WebView.
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 public WebView() : this(Interop.WebView.New(), true)
76 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80 /// Creates a WebView with local language and time zone.
81 /// <param name="locale">The locale language of Web</param>
82 /// <param name="timezoneId">The time zone Id of Web</param>
84 [EditorBrowsable(EditorBrowsableState.Never)]
85 public WebView(string locale, string timezoneId) : this(Interop.WebView.New2(locale, timezoneId), true)
87 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91 /// Creates a WebView with an args list.
92 /// <param name="args">args array. The first value of array must be program's name.</param>
94 [EditorBrowsable(EditorBrowsableState.Never)]
95 public WebView(string[] args) : this(Interop.WebView.New3(args?.Length ?? 0, args), true)
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101 /// Copy constructor.
102 /// <param name="webView">WebView to copy. The copied WebView will point at the same implementation</param>
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public WebView(WebView webView) : this(Interop.WebView.NewWebView(WebView.getCPtr(webView)), true)
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110 internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WebView.Upcast(cPtr), cMemoryOwn)
112 pageLoadStartedSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadStarted(SwigCPtr));
113 pageLoadingSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadInProgress(SwigCPtr));
114 pageLoadFinishedSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadFinished(SwigCPtr));
115 pageLoadErrorSignal = new WebViewPageLoadErrorSignal(Interop.WebView.NewWebViewPageLoadErrorSignalPageLoadError(SwigCPtr));
116 scrollEdgeReachedSignal = new WebViewScrollEdgeReachedSignal(Interop.WebView.NewWebViewScrollEdgeReachedSignalScrollEdgeReached(SwigCPtr));
117 urlChangedSignal = new WebViewUrlChangedSignal(Interop.WebView.NewWebViewUrlChangedSignalUrlChanged(SwigCPtr));
118 formRepostPolicyDecidedSignal = new WebViewFormRepostDecidedSignal(Interop.WebView.NewWebViewFormRepostDecisionSignalFormRepostDecision(SwigCPtr));
119 frameRenderedSignal = new WebViewFrameRenderedSignal(Interop.WebView.WebViewFrameRenderedSignalFrameRenderedGet(SwigCPtr));
121 BackForwardList = new WebBackForwardList(Interop.WebView.GetWebBackForwardList(SwigCPtr), false);
122 Context = new WebContext(Interop.WebView.GetWebContext(SwigCPtr), false);
123 CookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(SwigCPtr), false);
124 Settings = new WebSettings(Interop.WebView.GetWebSettings(SwigCPtr), false);
128 /// Dispose for IDisposable pattern
130 [EditorBrowsable(EditorBrowsableState.Never)]
131 protected override void Dispose(DisposeTypes type)
138 if (type == DisposeTypes.Explicit)
141 //Release your own managed resources here.
142 //You should release all of your own disposable objects here.
143 pageLoadStartedSignal.Dispose();
144 pageLoadingSignal.Dispose();
145 pageLoadFinishedSignal.Dispose();
146 pageLoadErrorSignal.Dispose();
147 scrollEdgeReachedSignal.Dispose();
148 urlChangedSignal.Dispose();
149 formRepostPolicyDecidedSignal.Dispose();
150 frameRenderedSignal.Dispose();
152 BackForwardList.Dispose();
154 CookieManager.Dispose();
162 /// The callback function that is invoked when the message is received from the script.
164 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public delegate void JavaScriptMessageHandler(string message);
169 /// The callback function that is invoked when the message is received from the script.
171 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public delegate void JavaScriptAlertCallback(string message);
176 /// The callback function that is invoked when the message is received from the script.
178 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
179 [EditorBrowsable(EditorBrowsableState.Never)]
180 public delegate void JavaScriptConfirmCallback(string message);
183 /// The callback function that is invoked when the message is received from the script.
185 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
186 [EditorBrowsable(EditorBrowsableState.Never)]
187 public delegate void JavaScriptPromptCallback(string message1, string message2);
190 /// The callback function that is invoked when screen shot is acquired asynchronously.
192 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
193 [EditorBrowsable(EditorBrowsableState.Never)]
194 public delegate void ScreenshotAcquiredCallback(ImageView image);
197 /// The callback function that is invoked when video playing is checked asynchronously.
199 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
200 [EditorBrowsable(EditorBrowsableState.Never)]
201 public delegate void VideoPlayingCallback(bool isPlaying);
204 /// The callback function that is invoked when geolocation permission is requested.
206 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
207 [EditorBrowsable(EditorBrowsableState.Never)]
208 public delegate void GeolocationPermissionCallback(string host, string protocol);
210 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
211 private delegate void WebViewPageLoadCallbackDelegate(IntPtr data, string pageUrl);
213 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
214 private delegate void WebViewPageLoadErrorCallbackDelegate(IntPtr data, string pageUrl, int errorCode);
216 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
217 private delegate void WebViewScrollEdgeReachedCallbackDelegate(IntPtr data, int edge);
219 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
220 private delegate void WebViewUrlChangedCallbackDelegate(IntPtr data, string pageUrl);
222 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
223 private delegate void WebViewFormRepostPolicyDecidedCallbackDelegate(IntPtr data, IntPtr decision);
225 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
226 private delegate void WebViewFrameRenderedCallbackDelegate(IntPtr data);
229 /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.<br />
230 /// This signal is emitted when page loading has started.<br />
232 [EditorBrowsable(EditorBrowsableState.Never)]
233 public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
237 if (pageLoadStartedEventHandler == null)
239 pageLoadStartedCallback = (OnPageLoadStarted);
240 pageLoadStartedSignal.Connect(pageLoadStartedCallback);
242 pageLoadStartedEventHandler += value;
246 pageLoadStartedEventHandler -= value;
247 if (pageLoadStartedEventHandler == null && pageLoadStartedCallback != null)
249 pageLoadStartedSignal.Disconnect(pageLoadStartedCallback);
255 /// Event for the PageLoading signal which can be used to subscribe or unsubscribe the event handler.<br />
256 /// This signal is emitted when page loading is in progress.<br />
258 [EditorBrowsable(EditorBrowsableState.Never)]
259 public event EventHandler<WebViewPageLoadEventArgs> PageLoading
263 if (pageLoadingEventHandler == null)
265 pageLoadingCallback = OnPageLoading;
266 pageLoadingSignal.Connect(pageLoadingCallback);
268 pageLoadingEventHandler += value;
272 pageLoadingEventHandler -= value;
273 if (pageLoadingEventHandler == null && pageLoadingCallback != null)
275 pageLoadingSignal.Disconnect(pageLoadingCallback);
281 /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.<br />
282 /// This signal is emitted when page loading has finished.<br />
284 [EditorBrowsable(EditorBrowsableState.Never)]
285 public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
289 if (pageLoadFinishedEventHandler == null)
291 pageLoadFinishedCallback = (OnPageLoadFinished);
292 pageLoadFinishedSignal.Connect(pageLoadFinishedCallback);
294 pageLoadFinishedEventHandler += value;
298 pageLoadFinishedEventHandler -= value;
299 if (pageLoadFinishedEventHandler == null && pageLoadFinishedCallback != null)
301 pageLoadFinishedSignal.Disconnect(pageLoadFinishedCallback);
307 /// Event for the PageLoadError signal which can be used to subscribe or unsubscribe the event handler.<br />
308 /// This signal is emitted when there's an error in page loading.<br />
310 [EditorBrowsable(EditorBrowsableState.Never)]
311 public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
315 if (pageLoadErrorEventHandler == null)
317 pageLoadErrorCallback = (OnPageLoadError);
318 pageLoadErrorSignal.Connect(pageLoadErrorCallback);
320 pageLoadErrorEventHandler += value;
324 pageLoadErrorEventHandler -= value;
325 if (pageLoadErrorEventHandler == null && pageLoadErrorCallback != null)
327 pageLoadErrorSignal.Disconnect(pageLoadErrorCallback);
333 /// Event for the ScrollEdgeReached signal which can be used to subscribe or unsubscribe the event handler.<br />
334 /// This signal is emitted when web view is scrolled to edge.<br />
336 [EditorBrowsable(EditorBrowsableState.Never)]
337 public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
341 if (scrollEdgeReachedEventHandler == null)
343 scrollEdgeReachedCallback = OnScrollEdgeReached;
344 scrollEdgeReachedSignal.Connect(scrollEdgeReachedCallback);
346 scrollEdgeReachedEventHandler += value;
350 scrollEdgeReachedEventHandler -= value;
351 if (scrollEdgeReachedEventHandler == null && scrollEdgeReachedCallback != null)
353 scrollEdgeReachedSignal.Disconnect(scrollEdgeReachedCallback);
359 /// Event for the UrlChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
360 /// This signal is emitted when url is changed.<br />
362 [EditorBrowsable(EditorBrowsableState.Never)]
363 public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
367 if (urlChangedEventHandler == null)
369 urlChangedCallback = OnUrlChanged;
370 urlChangedSignal.Connect(urlChangedCallback);
372 urlChangedEventHandler += value;
376 urlChangedEventHandler -= value;
377 if (urlChangedEventHandler == null && urlChangedCallback != null)
379 urlChangedSignal.Disconnect(urlChangedCallback);
385 /// Event for the FormRepostDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
386 /// This signal is emitted when form repost policy would be decided.<br />
388 [EditorBrowsable(EditorBrowsableState.Never)]
389 public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
393 if (formRepostPolicyDecidedEventHandler == null)
395 formRepostPolicyDecidedCallback = OnFormRepostPolicyDecided;
396 formRepostPolicyDecidedSignal.Connect(formRepostPolicyDecidedCallback);
398 formRepostPolicyDecidedEventHandler += value;
402 formRepostPolicyDecidedEventHandler -= value;
403 if (formRepostPolicyDecidedEventHandler == null && formRepostPolicyDecidedCallback != null)
405 formRepostPolicyDecidedSignal.Disconnect(formRepostPolicyDecidedCallback);
411 /// Event for the FrameRendered signal which can be used to subscribe or unsubscribe the event handler.<br />
412 /// This signal is emitted when frame is rendered off-screen.<br />
414 [EditorBrowsable(EditorBrowsableState.Never)]
415 public event EventHandler<EventArgs> FrameRendered
419 if (frameRenderedEventHandler == null)
421 frameRenderedCallback = OnFrameRendered;
422 frameRenderedSignal.Connect(frameRenderedCallback);
424 frameRenderedEventHandler += value;
428 frameRenderedEventHandler -= value;
429 if (frameRenderedEventHandler == null && frameRenderedCallback != null)
431 frameRenderedSignal.Disconnect(frameRenderedCallback);
437 /// Options for searching texts.
439 [EditorBrowsable(EditorBrowsableState.Never)]
440 public enum FindOption
445 [EditorBrowsable(EditorBrowsableState.Never)]
449 /// Case insensitive search
451 [EditorBrowsable(EditorBrowsableState.Never)]
452 CaseInsensitive = 1 << 0,
455 /// Search text only at the beginning of the words
457 [EditorBrowsable(EditorBrowsableState.Never)]
458 AtWordStarts = 1 << 1,
461 /// Treat capital letters in the middle of words as word start
463 [EditorBrowsable(EditorBrowsableState.Never)]
464 TreatMediaCapitalAsWordStart = 1 << 2,
469 [EditorBrowsable(EditorBrowsableState.Never)]
473 /// If not present the search stops at the end of the document
475 [EditorBrowsable(EditorBrowsableState.Never)]
481 [EditorBrowsable(EditorBrowsableState.Never)]
482 ShowOverlay = 1 << 5,
487 [EditorBrowsable(EditorBrowsableState.Never)]
488 ShowFindIndiator = 1 << 6,
493 [EditorBrowsable(EditorBrowsableState.Never)]
494 ShowHighlight = 1 << 7,
500 [EditorBrowsable(EditorBrowsableState.Never)]
501 public WebBackForwardList BackForwardList { get; }
506 [EditorBrowsable(EditorBrowsableState.Never)]
507 public WebContext Context { get; }
512 [EditorBrowsable(EditorBrowsableState.Never)]
513 public WebCookieManager CookieManager { get; }
518 [EditorBrowsable(EditorBrowsableState.Never)]
519 public WebSettings Settings { get; }
524 [EditorBrowsable(EditorBrowsableState.Never)]
529 return (string)GetValue(UrlProperty);
533 SetValue(UrlProperty, value);
534 NotifyPropertyChanged();
539 /// Deprecated. The cache model of the current WebView.
541 [EditorBrowsable(EditorBrowsableState.Never)]
542 public CacheModel CacheModel
546 return (CacheModel)Context.CacheModel;
550 Context.CacheModel = (WebContext.CacheModelType)value;
555 /// Deprecated. The cookie acceptance policy.
557 [EditorBrowsable(EditorBrowsableState.Never)]
558 public CookieAcceptPolicy CookieAcceptPolicy
562 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
566 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
571 /// The user agent string.
573 [EditorBrowsable(EditorBrowsableState.Never)]
574 public string UserAgent
578 return (string)GetValue(UserAgentProperty);
582 SetValue(UserAgentProperty, value);
583 NotifyPropertyChanged();
588 /// Deprecated. Whether JavaScript is enabled.
590 [EditorBrowsable(EditorBrowsableState.Never)]
591 public bool EnableJavaScript
595 return Settings.EnableJavaScript;
599 Settings.EnableJavaScript = value;
604 /// Deprecated. Whether images can be loaded automatically.
606 [EditorBrowsable(EditorBrowsableState.Never)]
607 public bool LoadImagesAutomatically
611 return Settings.AllowImagesLoadAutomatically;
615 Settings.AllowImagesLoadAutomatically = value;
620 /// The default text encoding name.<br />
621 /// e.g. "UTF-8"<br />
623 [EditorBrowsable(EditorBrowsableState.Never)]
624 public string DefaultTextEncodingName
628 return Settings.DefaultTextEncodingName;
632 Settings.DefaultTextEncodingName = value;
637 /// The default font size in pixel.
639 [EditorBrowsable(EditorBrowsableState.Never)]
640 public int DefaultFontSize
644 return Settings.DefaultFontSize;
648 Settings.DefaultFontSize = value;
653 /// The position of scroll.
655 [EditorBrowsable(EditorBrowsableState.Never)]
656 public Position ScrollPosition
660 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
661 return new Position(pv.X, pv.Y);
668 Vector2 vpv = new Vector2(pv.X, pv.Y);
669 SetValue(ScrollPositionProperty, vpv);
670 NotifyPropertyChanged();
676 /// The size of scroll, read-only.
678 [EditorBrowsable(EditorBrowsableState.Never)]
679 public Size ScrollSize
683 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
684 return new Size(sv.Width, sv.Height);
689 /// The size of content, read-only.
691 [EditorBrowsable(EditorBrowsableState.Never)]
692 public Size ContentSize
696 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
697 return new Size(sv.Width, sv.Height);
702 /// Whether video hole is enabled or not.
704 [EditorBrowsable(EditorBrowsableState.Never)]
705 public bool VideoHoleEnabled
709 return (bool)GetValue(VideoHoleEnabledProperty);
713 SetValue(VideoHoleEnabledProperty, value);
714 NotifyPropertyChanged();
719 /// Whether mouse events are enabled or not.
721 [EditorBrowsable(EditorBrowsableState.Never)]
722 public bool MouseEventsEnabled
726 return (bool)GetValue(MouseEventsEnabledProperty);
730 SetValue(MouseEventsEnabledProperty, value);
731 NotifyPropertyChanged();
736 /// Whether key events are enabled or not.
738 [EditorBrowsable(EditorBrowsableState.Never)]
739 public bool KeyEventsEnabled
743 return (bool)GetValue(KeyEventsEnabledProperty);
747 SetValue(KeyEventsEnabledProperty, value);
748 NotifyPropertyChanged();
753 /// Background color of document of web page.
755 [EditorBrowsable(EditorBrowsableState.Never)]
756 public Color DocumentBackgroundColor
760 return (Color)GetValue(DocumentBackgroundColorProperty);
764 SetValue(DocumentBackgroundColorProperty, value);
765 NotifyPropertyChanged();
770 /// Whether tiles are cleared or not when hidden.
772 [EditorBrowsable(EditorBrowsableState.Never)]
773 public bool TilesClearedWhenHidden
777 return (bool)GetValue(TilesClearedWhenHiddenProperty);
781 SetValue(TilesClearedWhenHiddenProperty, value);
782 NotifyPropertyChanged();
787 /// Multiplier of cover area of tile when web page is rendered.
789 [EditorBrowsable(EditorBrowsableState.Never)]
790 public float TileCoverAreaMultiplier
794 return (float)GetValue(TileCoverAreaMultiplierProperty);
798 SetValue(TileCoverAreaMultiplierProperty, value);
799 NotifyPropertyChanged();
804 /// Whether cursor is enabled or not by client.
806 [EditorBrowsable(EditorBrowsableState.Never)]
807 public bool CursorEnabledByClient
811 return (bool)GetValue(CursorEnabledByClientProperty);
815 SetValue(CursorEnabledByClientProperty, value);
816 NotifyPropertyChanged();
821 /// Gets selected text in web page.
823 [EditorBrowsable(EditorBrowsableState.Never)]
824 public string SelectedText
828 return (string)GetValue(SelectedTextProperty);
833 /// Gets title of web page.
835 [EditorBrowsable(EditorBrowsableState.Never)]
840 return (string)GetValue(TitleProperty);
845 /// Gets favicon of web page.
847 [EditorBrowsable(EditorBrowsableState.Never)]
848 public ImageView Favicon
852 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
853 if (NDalicPINVOKE.SWIGPendingException.Pending)
855 return new ImageView(imageView, false);
860 /// Zoom factor of web page.
862 [EditorBrowsable(EditorBrowsableState.Never)]
863 public float PageZoomFactor
867 return (float)GetValue(PageZoomFactorProperty);
871 SetValue(PageZoomFactorProperty, value);
872 NotifyPropertyChanged();
877 /// Zoom factor of text in web page.
879 [EditorBrowsable(EditorBrowsableState.Never)]
880 public float TextZoomFactor
884 return (float)GetValue(TextZoomFactorProperty);
888 SetValue(TextZoomFactorProperty, value);
889 NotifyPropertyChanged();
894 /// Gets percentage of loading progress.
896 [EditorBrowsable(EditorBrowsableState.Never)]
897 public float LoadProgressPercentage
901 return (float)GetValue(LoadProgressPercentageProperty);
905 internal static new class Property
907 internal static readonly int Url = Interop.WebView.UrlGet();
908 internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
909 internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
910 internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
911 internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
912 internal static readonly int Title = Interop.WebView.TitleGet();
913 internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
914 internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
915 internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
916 internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
917 internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
918 internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
919 internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
920 internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
921 internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
922 internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
923 internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
926 private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
928 var webview = (WebView)bindable;
929 if (newValue != null)
931 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
934 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
936 var webview = (WebView)bindable;
938 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
942 private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
944 var webview = (WebView)bindable;
945 if (newValue != null)
947 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
950 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
952 var webview = (WebView)bindable;
954 Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
958 private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
960 var webview = (WebView)bindable;
961 if (newValue != null)
963 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
966 defaultValueCreator: (bindable) =>
968 var webview = (WebView)bindable;
969 Vector2 temp = new Vector2(0.0f, 0.0f);
970 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
974 private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
976 var webview = (WebView)bindable;
977 Vector2 temp = new Vector2(0.0f, 0.0f);
978 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
982 private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
984 var webview = (WebView)bindable;
985 Vector2 temp = new Vector2(0.0f, 0.0f);
986 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
990 private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), null, defaultValueCreator: (bindable) =>
992 var webview = (WebView)bindable;
994 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
998 private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1000 var webview = (WebView)bindable;
1001 if (newValue != null)
1003 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1006 defaultValueCreator: (bindable) =>
1008 var webview = (WebView)bindable;
1010 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1014 private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1016 var webview = (WebView)bindable;
1017 if (newValue != null)
1019 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1022 defaultValueCreator: (bindable) =>
1024 var webview = (WebView)bindable;
1026 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1030 private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1032 var webview = (WebView)bindable;
1033 if (newValue != null)
1035 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1038 defaultValueCreator: (bindable) =>
1040 var webview = (WebView)bindable;
1042 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1046 private static readonly BindableProperty DocumentBackgroundColorProperty = BindableProperty.Create(nameof(DocumentBackgroundColor), typeof(Vector4), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1048 var webview = (WebView)bindable;
1049 if (newValue != null)
1051 webview.backgroundColor = (Vector4)newValue;
1052 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Vector4)newValue));
1055 defaultValueCreator: (bindable) =>
1057 var webview = (WebView)bindable;
1058 return webview.backgroundColor;
1061 private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1063 var webview = (WebView)bindable;
1064 if (newValue != null)
1066 webview.tilesClearedWhenHidden = (bool)newValue;
1067 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1070 defaultValueCreator: (bindable) =>
1072 var webview = (WebView)bindable;
1073 return webview.tilesClearedWhenHidden;
1076 private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1078 var webview = (WebView)bindable;
1079 if (newValue != null)
1081 webview.tileCoverAreaMultiplier = (float)newValue;
1082 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1085 defaultValueCreator: (bindable) =>
1087 var webview = (WebView)bindable;
1088 return webview.tileCoverAreaMultiplier;
1091 private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1093 var webview = (WebView)bindable;
1094 if (newValue != null)
1096 webview.cursorEnabledByClient = (bool)newValue;
1097 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1100 defaultValueCreator: (bindable) =>
1102 var webview = (WebView)bindable;
1103 return webview.cursorEnabledByClient;
1106 private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), null, defaultValueCreator: (bindable) =>
1108 var webview = (WebView)bindable;
1110 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1114 private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1116 var webview = (WebView)bindable;
1117 if (newValue != null)
1119 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1122 defaultValueCreator: (bindable) =>
1124 var webview = (WebView)bindable;
1126 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1130 private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1132 var webview = (WebView)bindable;
1133 if (newValue != null)
1135 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1138 defaultValueCreator: (bindable) =>
1140 var webview = (WebView)bindable;
1142 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1146 private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), null, defaultValueCreator: (bindable) =>
1148 var webview = (WebView)bindable;
1150 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1154 // For rooting handlers
1155 internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1159 /// <param name="url">The path of Web</param>
1161 [EditorBrowsable(EditorBrowsableState.Never)]
1162 public void LoadUrl(string url)
1164 Interop.WebView.LoadUrl(SwigCPtr, url);
1165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1169 /// Deprecated. Loads a html by string.
1170 /// <param name="data">The data of Web</param>
1172 [EditorBrowsable(EditorBrowsableState.Never)]
1173 public void LoadHTMLString(string data)
1175 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1180 /// Loads a html by string.
1181 /// <param name="data">The data of Web</param>
1183 [EditorBrowsable(EditorBrowsableState.Never)]
1184 public void LoadHtmlString(string data)
1186 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1191 /// Loads the specified html as the content of the view to override current history entry.
1192 /// <param name="html">The html to be loaded</param>
1193 /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1194 /// <param name="unreachableUri">URL that could not be reached</param>
1196 [EditorBrowsable(EditorBrowsableState.Never)]
1197 public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1199 bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1205 /// Requests to load the given contents by MIME type.
1206 /// <param name="contents">The contents to be loaded</param>
1207 /// <param name="contentSize">The size of contents (in bytes)</param>
1208 /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1209 /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1210 /// <param name="baseUri">The base URI to use for relative resources</param>
1212 [EditorBrowsable(EditorBrowsableState.Never)]
1213 public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1215 bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1223 [EditorBrowsable(EditorBrowsableState.Never)]
1224 public void Reload()
1226 Interop.WebView.Reload(SwigCPtr);
1227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1231 /// Reloads the current page's document without cache
1233 [EditorBrowsable(EditorBrowsableState.Never)]
1234 public bool ReloadWithoutCache()
1236 bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242 /// Stops loading the Web
1244 [EditorBrowsable(EditorBrowsableState.Never)]
1245 public void StopLoading()
1247 Interop.WebView.StopLoading(SwigCPtr);
1248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1252 /// Suspends the operation.
1254 [EditorBrowsable(EditorBrowsableState.Never)]
1255 public void Suspend()
1257 Interop.WebView.Suspend(SwigCPtr);
1258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1262 /// Resumes the operation after calling Suspend()
1264 [EditorBrowsable(EditorBrowsableState.Never)]
1265 public void Resume()
1267 Interop.WebView.Resume(SwigCPtr);
1268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1272 /// Suspends all network loading.
1274 [EditorBrowsable(EditorBrowsableState.Never)]
1275 public void SuspendNetworkLoading()
1277 Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1282 /// Resumes all network loading.
1284 [EditorBrowsable(EditorBrowsableState.Never)]
1285 public void ResumeNetworkLoading()
1287 Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1292 /// Adds custom header.
1293 /// <param name="name">The name of custom header</param>
1294 /// <param name="value">The value of custom header</param>
1296 [EditorBrowsable(EditorBrowsableState.Never)]
1297 public bool AddCustomHeader(string name, string value)
1299 bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 /// Removes custom header.
1306 /// <param name="name">The name of custom header</param>
1308 [EditorBrowsable(EditorBrowsableState.Never)]
1309 public bool RemoveCustomHeader(string name)
1311 bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1317 /// Starts the inspector server.
1318 /// <param name="port">The port number</param>
1320 [EditorBrowsable(EditorBrowsableState.Never)]
1321 public uint StartInspectorServer(uint port)
1323 uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1329 /// Stops the inspector server.
1331 [EditorBrowsable(EditorBrowsableState.Never)]
1332 public bool StopInspectorServer()
1334 bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1340 /// Scrolls page of web view by deltaX and detlaY.
1341 /// <param name="deltaX">The deltaX of scroll</param>
1342 /// <param name="deltaY">The deltaY of scroll</param>
1344 [EditorBrowsable(EditorBrowsableState.Never)]
1345 public void ScrollBy(int deltaX, int deltaY)
1347 Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1352 /// Scrolls edge of web view by deltaX and deltaY.
1353 /// <param name="deltaX">The deltaX of scroll</param>
1354 /// <param name="deltaY">The deltaY of scroll</param>
1356 [EditorBrowsable(EditorBrowsableState.Never)]
1357 public bool ScrollEdgeBy(int deltaX, int deltaY)
1359 bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1365 /// Goes to the back
1367 [EditorBrowsable(EditorBrowsableState.Never)]
1368 public void GoBack()
1370 Interop.WebView.GoBack(SwigCPtr);
1371 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1375 /// Goes to the forward
1377 [EditorBrowsable(EditorBrowsableState.Never)]
1378 public void GoForward()
1380 Interop.WebView.GoForward(SwigCPtr);
1381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1385 /// Returns whether backward is possible.
1386 /// <returns>True if backward is possible, false otherwise</returns>
1388 [EditorBrowsable(EditorBrowsableState.Never)]
1389 public bool CanGoBack()
1391 bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1397 /// Returns whether forward is possible.
1398 /// <returns>True if forward is possible, false otherwise</returns>
1400 [EditorBrowsable(EditorBrowsableState.Never)]
1401 public bool CanGoForward()
1403 bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1404 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1409 /// Evaluates JavaScript code represented as a string.
1410 /// <param name="script">The JavaScript code</param>
1412 [EditorBrowsable(EditorBrowsableState.Never)]
1413 public void EvaluateJavaScript(string script)
1415 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1420 /// Add a message handler into the WebView.
1421 /// <param name="objectName">The name of exposed object</param>
1422 /// <param name="handler">The callback function</param>
1424 [EditorBrowsable(EditorBrowsableState.Never)]
1425 public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1427 if (handlerRootMap.ContainsKey(objectName))
1432 handlerRootMap.Add(objectName, handler);
1434 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1435 Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1441 /// Add a message handler into the WebView.
1442 /// <param name="callback">The callback function</param>
1444 [EditorBrowsable(EditorBrowsableState.Never)]
1445 public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1447 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1448 Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1454 /// Reply for alert popup.
1456 [EditorBrowsable(EditorBrowsableState.Never)]
1457 public void JavaScriptAlertReply()
1459 Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1464 /// Add a message handler into the WebView.
1465 /// <param name="callback">The callback function</param>
1467 [EditorBrowsable(EditorBrowsableState.Never)]
1468 public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1470 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1471 Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1473 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1477 /// Reply for confirm popup.
1478 /// <param name="confirmed">confirmed or not</param>
1480 [EditorBrowsable(EditorBrowsableState.Never)]
1481 public void JavaScriptConfirmReply(bool confirmed)
1483 Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1484 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1488 /// Add a message handler into the WebView.
1489 /// <param name="callback">The callback function</param>
1491 [EditorBrowsable(EditorBrowsableState.Never)]
1492 public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1494 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1495 Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1497 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1501 /// Reply for prompt popup.
1502 /// <param name="result">text in prompt input field.</param>
1504 [EditorBrowsable(EditorBrowsableState.Never)]
1505 public void JavaScriptPromptReply(string result)
1507 Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
1508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1512 /// Clears title resources of current WebView.
1514 [EditorBrowsable(EditorBrowsableState.Never)]
1515 public void ClearAllTilesResources()
1517 Interop.WebView.ClearAllTilesResources(SwigCPtr);
1518 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1522 /// Clears the history of current WebView.
1524 [EditorBrowsable(EditorBrowsableState.Never)]
1525 public void ClearHistory()
1527 Interop.WebView.ClearHistory(SwigCPtr);
1528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1532 /// Scales the current page, centered at the given point.
1533 /// <param name="scaleFactor">The new factor to be scaled</param>
1534 /// <param name="point">The center coordinate</param>
1536 [EditorBrowsable(EditorBrowsableState.Never)]
1537 public void SetScaleFactor(float scaleFactor, Vector2 point)
1539 Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
1540 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1544 /// Gets the current scale factor of the page.
1546 [EditorBrowsable(EditorBrowsableState.Never)]
1547 public float GetScaleFactor()
1549 float result = Interop.WebView.GetScaleFactor(SwigCPtr);
1550 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1555 /// Requests to activate/deactivate the accessibility usage set by web app.
1556 /// <param name="activated">The new factor to be scaled</param>
1558 [EditorBrowsable(EditorBrowsableState.Never)]
1559 public void ActivateAccessibility(bool activated)
1561 Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
1562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1566 /// Searches and highlights the given string in the document.
1567 /// <param name="text">The text to be searched</param>
1568 /// <param name="options">The options to search</param>
1569 /// <param name="maxMatchCount">The maximum match count to search</param>
1571 [EditorBrowsable(EditorBrowsableState.Never)]
1572 public bool HighlightText(string text, FindOption options, uint maxMatchCount)
1574 bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
1575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1580 /// Adds dynamic certificate path.
1581 /// <param name="host">Host that required client authentication</param>
1582 /// <param name="certPath">The file path stored certificate</param>
1584 [EditorBrowsable(EditorBrowsableState.Never)]
1585 public void AddDynamicCertificatePath(string host, string certPath)
1587 Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
1588 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1592 /// Get snapshot of the specified viewArea of page.
1593 /// <param name="viewArea">Host that required client authentication</param>
1594 /// <param name="scaleFactor">The file path stored certificate</param>
1596 [EditorBrowsable(EditorBrowsableState.Never)]
1597 public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
1599 IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
1600 ImageView imageView = new ImageView(image, true);
1601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1606 /// Get snapshot of the specified viewArea of page.
1607 /// <param name="viewArea">Host that required client authentication</param>
1608 /// <param name="scaleFactor">The file path stored certificate</param>
1609 /// <param name="callback">The callback for getting screen shot</param>
1611 [EditorBrowsable(EditorBrowsableState.Never)]
1612 public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
1614 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1615 bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
1616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1621 /// Asynchronous requests to check if there is a video playing in the given view.
1622 /// <param name="callback">The callback called after checking if video is playing or not</param>
1624 [EditorBrowsable(EditorBrowsableState.Never)]
1625 public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
1627 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1628 bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
1629 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1634 /// Registers callback which will be called upon geolocation permission request.
1635 /// <param name="callback">The callback for requesting geolocation permission</param>
1637 [EditorBrowsable(EditorBrowsableState.Never)]
1638 public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
1640 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1641 Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
1642 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1646 /// Deprecated. Clears the cache of current WebView.
1648 [EditorBrowsable(EditorBrowsableState.Never)]
1649 public void ClearCache()
1651 Context.ClearCache();
1655 /// Deprecated. Clears all the cookies of current WebView.
1657 [EditorBrowsable(EditorBrowsableState.Never)]
1658 public void ClearCookies()
1660 CookieManager.ClearCookies();
1663 internal static WebView DownCast(BaseHandle handle)
1665 WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
1666 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1670 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebView obj)
1672 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1675 internal WebView Assign(WebView webView)
1677 WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
1678 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1682 /// This will not be public opened.
1683 /// <param name="swigCPtr"></param>
1684 [EditorBrowsable(EditorBrowsableState.Never)]
1685 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1687 Interop.WebView.DeleteWebView(swigCPtr);
1690 private void OnPageLoadStarted(IntPtr data, string pageUrl)
1692 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
1694 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
1695 e.PageUrl = pageUrl;
1697 pageLoadStartedEventHandler?.Invoke(this, e);
1700 private void OnPageLoading(IntPtr data, string pageUrl)
1702 pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
1705 private void OnPageLoadFinished(IntPtr data, string pageUrl)
1707 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
1709 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
1710 e.PageUrl = pageUrl;
1712 pageLoadFinishedEventHandler?.Invoke(this, e);
1715 private void OnPageLoadError(IntPtr data, string pageUrl, int errorCode)
1717 WebViewPageLoadErrorEventArgs e = new WebViewPageLoadErrorEventArgs();
1719 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
1720 e.PageUrl = pageUrl;
1721 e.ErrorCode = (WebViewPageLoadErrorEventArgs.LoadErrorCode)errorCode;
1723 pageLoadErrorEventHandler?.Invoke(this, e);
1726 private void OnScrollEdgeReached(IntPtr data, int edge)
1728 WebViewScrollEdgeReachedEventArgs arg = new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge);
1729 scrollEdgeReachedEventHandler?.Invoke(this, arg);
1732 private void OnUrlChanged(IntPtr data, string pageUrl)
1734 urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
1737 private void OnFormRepostPolicyDecided(IntPtr data, IntPtr decision)
1739 WebFormRepostPolicyDecisionMaker repostDecision = new WebFormRepostPolicyDecisionMaker(decision, false);
1740 formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(repostDecision));
1741 repostDecision.Dispose();
1744 private void OnFrameRendered(IntPtr data)
1746 frameRenderedEventHandler?.Invoke(this, new EventArgs());