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.Binding;
24 namespace Tizen.NUI.BaseComponents
27 /// WebView allows presenting content with embedded web browser, both local files and remote websites.
29 /// <since_tizen> 9 </since_tizen>
30 public partial class WebView : View
32 private static readonly WebContext context = new WebContext(Interop.WebView.GetWebContext(), false);
33 private static readonly WebCookieManager cookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(), false);
35 private Color contentBackgroundColor;
36 private bool tilesClearedWhenHidden;
37 private float tileCoverAreaMultiplier;
38 private bool cursorEnabledByClient;
40 private EventHandler<WebViewPageLoadEventArgs> pageLoadStartedEventHandler;
41 private WebViewPageLoadCallback pageLoadStartedCallback;
43 private EventHandler<WebViewPageLoadEventArgs> pageLoadingEventHandler;
44 private WebViewPageLoadCallback pageLoadingCallback;
46 private EventHandler<WebViewPageLoadEventArgs> pageLoadFinishedEventHandler;
47 private WebViewPageLoadCallback pageLoadFinishedCallback;
49 private EventHandler<WebViewPageLoadErrorEventArgs> pageLoadErrorEventHandler;
50 private WebViewPageLoadErrorCallback pageLoadErrorCallback;
52 private EventHandler<WebViewScrollEdgeReachedEventArgs> scrollEdgeReachedEventHandler;
53 private WebViewScrollEdgeReachedCallback scrollEdgeReachedCallback;
55 private EventHandler<WebViewUrlChangedEventArgs> urlChangedEventHandler;
56 private WebViewUrlChangedCallback urlChangedCallback;
58 private EventHandler<WebViewFormRepostPolicyDecidedEventArgs> formRepostPolicyDecidedEventHandler;
59 private WebViewFormRepostPolicyDecidedCallback formRepostPolicyDecidedCallback;
61 private EventHandler<EventArgs> frameRenderedEventHandler;
62 private WebViewFrameRenderedCallback frameRenderedCallback;
64 private ScreenshotAcquiredCallback screenshotAcquiredCallback;
65 private readonly WebViewScreenshotAcquiredProxyCallback screenshotAcquiredProxyCallback;
67 private HitTestFinishedCallback hitTestFinishedCallback;
68 private readonly WebViewHitTestFinishedProxyCallback hitTestFinishedProxyCallback;
70 private EventHandler<WebViewPolicyDecidedEventArgs> responsePolicyDecidedEventHandler;
71 private WebViewPolicyDecidedCallback responsePolicyDecidedCallback;
73 private EventHandler<WebViewPolicyDecidedEventArgs> navigationPolicyDecidedEventHandler;
74 private WebViewPolicyDecidedCallback navigationPolicyDecidedCallback;
76 private EventHandlerWithReturnType<object, EventArgs, WebView> newWindowCreatedEventHandler;
77 private WebViewNewWindowCreatedCallback newWindowCreatedCallback;
79 private EventHandler<WebViewCertificateReceivedEventArgs> certificateConfirmedEventHandler;
80 private WebViewCertificateReceivedCallback certificateConfirmedCallback;
82 private EventHandler<WebViewCertificateReceivedEventArgs> sslCertificateChangedEventHandler;
83 private WebViewCertificateReceivedCallback sslCertificateChangedCallback;
85 private EventHandler<WebViewHttpAuthRequestedEventArgs> httpAuthRequestedEventHandler;
86 private WebViewHttpAuthRequestedCallback httpAuthRequestedCallback;
88 private EventHandler<WebViewConsoleMessageReceivedEventArgs> consoleMessageReceivedEventHandler;
89 private WebViewConsoleMessageReceivedCallback consoleMessageReceivedCallback;
91 private EventHandler<WebViewContextMenuShownEventArgs> contextMenuShownEventHandler;
92 private WebViewContextMenuShownCallback contextMenuShownCallback;
94 private EventHandler<WebViewContextMenuHiddenEventArgs> contextMenuHiddenEventHandler;
95 private WebViewContextMenuHiddenCallback contextMenuHiddenCallback;
97 private PlainTextReceivedCallback plainTextReceivedCallback;
101 /// Creates a WebView.
103 /// <since_tizen> 9 </since_tizen>
104 public WebView() : this(Interop.WebView.New(), true)
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110 /// Creates a WebView with locale and time-zone.
112 /// <param name="locale">The specified locale</param>
113 /// <param name="timezoneId">The specified time-zone ID</param>
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public WebView(string locale, string timezoneId) : this(Interop.WebView.New2(locale, timezoneId), true)
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 /// Creates a WebView with an args list.
123 /// <param name="args">Arguments passed into web engine. The first value of array must be program's name.</param>
124 /// <since_tizen> 9 </since_tizen>
125 public WebView(string[] args) : this(Interop.WebView.New3(args?.Length ?? 0, args), true)
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// Copy constructor.
133 /// <param name="webView">WebView to copy. The copied WebView will point at the same implementation</param>
134 /// <since_tizen> 9 </since_tizen>
135 public WebView(WebView webView) : this(Interop.WebView.NewWebView(WebView.getCPtr(webView)), true)
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WebView.Upcast(cPtr), cMemoryOwn)
142 screenshotAcquiredProxyCallback = OnScreenshotAcquired;
143 hitTestFinishedProxyCallback = OnHitTestFinished;
145 BackForwardList = new WebBackForwardList(Interop.WebView.GetWebBackForwardList(SwigCPtr), false);
146 Settings = new WebSettings(Interop.WebView.GetWebSettings(SwigCPtr), false);
150 /// Dispose for IDisposable pattern
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 protected override void Dispose(DisposeTypes type)
160 if (type == DisposeTypes.Explicit)
163 //Release your own managed resources here.
164 //You should release all of your own disposable objects here.
165 BackForwardList.Dispose();
172 /// This will not be public opened.
173 /// <param name="swigCPtr"></param>
174 [EditorBrowsable(EditorBrowsableState.Never)]
175 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
177 Interop.WebView.DeleteWebView(swigCPtr);
181 /// The callback function that is invoked when the message is received from the script.
183 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public delegate void JavaScriptMessageHandler(string message);
188 /// The callback function that is invoked when the message is received from the script.
190 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public delegate void JavaScriptAlertCallback(string message);
195 /// The callback function that is invoked when the message is received from the script.
197 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
198 [EditorBrowsable(EditorBrowsableState.Never)]
199 public delegate void JavaScriptConfirmCallback(string message);
202 /// The callback function that is invoked when the message is received from the script.
204 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 public delegate void JavaScriptPromptCallback(string message1, string message2);
209 /// The callback function that is invoked when screen shot is acquired asynchronously.
211 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
212 [EditorBrowsable(EditorBrowsableState.Never)]
213 public delegate void ScreenshotAcquiredCallback(ImageView image);
216 /// The callback function that is invoked when video playing is checked asynchronously.
218 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 public delegate void VideoPlayingCallback(bool isPlaying);
223 /// The callback function that is invoked when geolocation permission is requested.
225 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
226 [EditorBrowsable(EditorBrowsableState.Never)]
227 public delegate void GeolocationPermissionCallback(string host, string protocol);
230 /// The callback function that is invoked when hit test is finished.
232 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
233 [EditorBrowsable(EditorBrowsableState.Never)]
234 public delegate void HitTestFinishedCallback(WebHitTestResult test);
237 /// The callback function that is invoked when the plain text of the current page is received.
239 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
240 [EditorBrowsable(EditorBrowsableState.Never)]
241 public delegate void PlainTextReceivedCallback(string plainText);
243 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
244 private delegate void WebViewPageLoadCallback(string pageUrl);
246 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
247 private delegate void WebViewPageLoadErrorCallback(IntPtr error);
249 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
250 private delegate void WebViewScrollEdgeReachedCallback(int edge);
252 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
253 private delegate void WebViewUrlChangedCallback(string pageUrl);
255 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
256 private delegate void WebViewFormRepostPolicyDecidedCallback(IntPtr maker);
258 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
259 private delegate void WebViewFrameRenderedCallback();
261 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
262 private delegate void WebViewScreenshotAcquiredProxyCallback(IntPtr data);
264 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
265 private delegate void WebViewHitTestFinishedProxyCallback(IntPtr data);
267 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
268 private delegate void WebViewPolicyDecidedCallback(IntPtr maker);
270 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
271 private delegate void WebViewNewWindowCreatedCallback(out IntPtr outView);
273 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
274 private delegate void WebViewCertificateReceivedCallback(IntPtr certificate);
276 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
277 private delegate void WebViewHttpAuthRequestedCallback(IntPtr handler);
279 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
280 private delegate void WebViewConsoleMessageReceivedCallback(IntPtr message);
282 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
283 private delegate void WebViewContextMenuShownCallback(IntPtr menu);
285 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
286 private delegate void WebViewContextMenuHiddenCallback(IntPtr menu);
289 /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.<br />
290 /// This signal is emitted when page loading has started.<br />
292 /// <since_tizen> 9 </since_tizen>
293 public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
297 if (pageLoadStartedEventHandler == null)
299 pageLoadStartedCallback = OnPageLoadStarted;
300 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadStartedCallback);
301 Interop.WebView.RegisterPageLoadStartedCallback(SwigCPtr, new HandleRef(this, ip));
303 pageLoadStartedEventHandler += value;
307 pageLoadStartedEventHandler -= value;
312 /// Event for the PageLoading signal which can be used to subscribe or unsubscribe the event handler.<br />
313 /// This signal is emitted when page loading is in progress.<br />
315 /// <since_tizen> 9 </since_tizen>
316 public event EventHandler<WebViewPageLoadEventArgs> PageLoading
320 if (pageLoadingEventHandler == null)
322 pageLoadingCallback = OnPageLoading;
323 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadingCallback);
324 Interop.WebView.RegisterPageLoadInProgressCallback(SwigCPtr, new HandleRef(this, ip));
326 pageLoadingEventHandler += value;
330 pageLoadingEventHandler -= value;
335 /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.<br />
336 /// This signal is emitted when page loading has finished.<br />
338 /// <since_tizen> 9 </since_tizen>
339 public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
343 if (pageLoadFinishedEventHandler == null)
345 pageLoadFinishedCallback = (OnPageLoadFinished);
346 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadFinishedCallback);
347 Interop.WebView.RegisterPageLoadFinishedCallback(SwigCPtr, new HandleRef(this, ip));
349 pageLoadFinishedEventHandler += value;
353 pageLoadFinishedEventHandler -= value;
358 /// Event for the PageLoadError signal which can be used to subscribe or unsubscribe the event handler.<br />
359 /// This signal is emitted when there's an error in page loading.<br />
361 /// <since_tizen> 9 </since_tizen>
362 public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
366 if (pageLoadErrorEventHandler == null)
368 pageLoadErrorCallback = OnPageLoadError;
369 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadErrorCallback);
370 Interop.WebView.RegisterPageLoadErrorCallback(SwigCPtr, new HandleRef(this, ip));
372 pageLoadErrorEventHandler += value;
376 pageLoadErrorEventHandler -= value;
381 /// Event for the ScrollEdgeReached signal which can be used to subscribe or unsubscribe the event handler.<br />
382 /// This signal is emitted when web view is scrolled to edge.<br />
384 [EditorBrowsable(EditorBrowsableState.Never)]
385 public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
389 if (scrollEdgeReachedEventHandler == null)
391 scrollEdgeReachedCallback = OnScrollEdgeReached;
392 IntPtr ip = Marshal.GetFunctionPointerForDelegate(scrollEdgeReachedCallback);
393 Interop.WebView.RegisterScrollEdgeReachedCallback(SwigCPtr, new HandleRef(this, ip));
395 scrollEdgeReachedEventHandler += value;
399 scrollEdgeReachedEventHandler -= value;
404 /// Event for the UrlChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
405 /// This signal is emitted when url is changed.<br />
407 [EditorBrowsable(EditorBrowsableState.Never)]
408 public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
412 if (urlChangedEventHandler == null)
414 urlChangedCallback = OnUrlChanged;
415 IntPtr ip = Marshal.GetFunctionPointerForDelegate(urlChangedCallback);
416 Interop.WebView.RegisterUrlChangedCallback(SwigCPtr, new HandleRef(this, ip));
418 urlChangedEventHandler += value;
422 urlChangedEventHandler -= value;
427 /// Event for the FormRepostDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
428 /// This signal is emitted when form repost policy would be decided.<br />
430 [EditorBrowsable(EditorBrowsableState.Never)]
431 public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
435 if (formRepostPolicyDecidedEventHandler == null)
437 formRepostPolicyDecidedCallback = OnFormRepostPolicyDecided;
438 IntPtr ip = Marshal.GetFunctionPointerForDelegate(formRepostPolicyDecidedCallback);
439 Interop.WebView.RegisterFormRepostDecidedCallback(SwigCPtr, new HandleRef(this, ip));
441 formRepostPolicyDecidedEventHandler += value;
445 formRepostPolicyDecidedEventHandler -= value;
450 /// Event for the FrameRendered signal which can be used to subscribe or unsubscribe the event handler.<br />
451 /// This signal is emitted when frame is rendered off-screen.<br />
453 [EditorBrowsable(EditorBrowsableState.Never)]
454 public event EventHandler<EventArgs> FrameRendered
458 if (frameRenderedEventHandler == null)
460 frameRenderedCallback = OnFrameRendered;
461 IntPtr ip = Marshal.GetFunctionPointerForDelegate(frameRenderedCallback);
462 Interop.WebView.RegisterFrameRenderedCallback(SwigCPtr, new HandleRef(this, ip));
464 frameRenderedEventHandler += value;
468 frameRenderedEventHandler -= value;
473 /// Event for the ResponsePolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
474 /// This signal is emitted when response policy would be decided.<br />
476 [EditorBrowsable(EditorBrowsableState.Never)]
477 public event EventHandler<WebViewPolicyDecidedEventArgs> ResponsePolicyDecided
481 if (responsePolicyDecidedEventHandler == null)
483 responsePolicyDecidedCallback = OnResponsePolicyDecided;
484 IntPtr ip = Marshal.GetFunctionPointerForDelegate(responsePolicyDecidedCallback);
485 Interop.WebView.RegisterResponsePolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
487 responsePolicyDecidedEventHandler += value;
491 responsePolicyDecidedEventHandler -= value;
496 /// Event for the NavigationPolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
497 /// This signal is emitted when response policy would be decided.<br />
499 [EditorBrowsable(EditorBrowsableState.Never)]
500 public event EventHandler<WebViewPolicyDecidedEventArgs> NavigationPolicyDecided
504 if (navigationPolicyDecidedEventHandler == null)
506 navigationPolicyDecidedCallback = OnNavigationPolicyDecided;
507 IntPtr ip = Marshal.GetFunctionPointerForDelegate(navigationPolicyDecidedCallback);
508 Interop.WebView.RegisterNavigationPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
510 navigationPolicyDecidedEventHandler += value;
514 navigationPolicyDecidedEventHandler -= value;
519 /// Event for the NewWindowCreated signal which can be used to subscribe or unsubscribe the event handler.<br />
520 /// This signal is emitted when a new window would be created.<br />
522 [EditorBrowsable(EditorBrowsableState.Never)]
523 public event EventHandlerWithReturnType<object, EventArgs, WebView> NewWindowCreated
527 if (newWindowCreatedEventHandler == null)
529 newWindowCreatedCallback = OnNewWindowCreated;
530 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(newWindowCreatedCallback);
531 Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip));
533 newWindowCreatedEventHandler += value;
537 newWindowCreatedEventHandler -= value;
542 /// Event for the CertificateConfirmed signal which can be used to subscribe or unsubscribe the event handler.<br />
543 /// This signal is emitted when certificate would be confirmed.<br />
545 [EditorBrowsable(EditorBrowsableState.Never)]
546 public event EventHandler<WebViewCertificateReceivedEventArgs> CertificateConfirmed
550 if (certificateConfirmedEventHandler == null)
552 certificateConfirmedCallback = OnCertificateConfirmed;
553 IntPtr ip = Marshal.GetFunctionPointerForDelegate(certificateConfirmedCallback);
554 Interop.WebView.RegisterCertificateConfirmedCallback(SwigCPtr, new HandleRef(this, ip));
556 certificateConfirmedEventHandler += value;
560 certificateConfirmedEventHandler -= value;
565 /// Event for the SslCertificateChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
566 /// This signal is emitted when SSL certificate is changed.<br />
568 [EditorBrowsable(EditorBrowsableState.Never)]
569 public event EventHandler<WebViewCertificateReceivedEventArgs> SslCertificateChanged
573 if (sslCertificateChangedEventHandler == null)
575 sslCertificateChangedCallback = OnSslCertificateChanged;
576 IntPtr ip = Marshal.GetFunctionPointerForDelegate(sslCertificateChangedCallback);
577 Interop.WebView.RegisterSslCertificateChangedCallback(SwigCPtr, new HandleRef(this, ip));
579 sslCertificateChangedEventHandler += value;
583 sslCertificateChangedEventHandler -= value;
588 /// Event for the HttpAuthRequested signal which can be used to subscribe or unsubscribe the event handler.<br />
589 /// This signal is emitted when http authentication is requested.<br />
591 [EditorBrowsable(EditorBrowsableState.Never)]
592 public event EventHandler<WebViewHttpAuthRequestedEventArgs> HttpAuthRequested
596 if (httpAuthRequestedEventHandler == null)
598 httpAuthRequestedCallback = OnHttpAuthRequested;
599 IntPtr ip = Marshal.GetFunctionPointerForDelegate(httpAuthRequestedCallback);
600 Interop.WebView.RegisterHttpAuthHandlerCallback(SwigCPtr, new HandleRef(this, ip));
602 httpAuthRequestedEventHandler += value;
606 httpAuthRequestedEventHandler -= value;
611 /// Event for the ConsoleMessageReceived signal which can be used to subscribe or unsubscribe the event handler.<br />
612 /// This signal is emitted when console message is received.<br />
614 [EditorBrowsable(EditorBrowsableState.Never)]
615 public event EventHandler<WebViewConsoleMessageReceivedEventArgs> ConsoleMessageReceived
619 if (consoleMessageReceivedEventHandler == null)
621 consoleMessageReceivedCallback = OnConsoleMessageReceived;
622 IntPtr ip = Marshal.GetFunctionPointerForDelegate(consoleMessageReceivedCallback);
623 Interop.WebView.RegisterConsoleMessageReceivedCallback(SwigCPtr, new HandleRef(this, ip));
625 consoleMessageReceivedEventHandler += value;
629 consoleMessageReceivedEventHandler -= value;
634 /// Event for the ContextMenuShown signal which can be used to subscribe or unsubscribe the event handler.<br />
635 /// This signal is emitted when context menu is shown.<br />
637 [EditorBrowsable(EditorBrowsableState.Never)]
638 public event EventHandler<WebViewContextMenuShownEventArgs> ContextMenuShown
642 if (contextMenuShownEventHandler == null)
644 contextMenuShownCallback = OnContextMenuShown;
645 IntPtr ip = Marshal.GetFunctionPointerForDelegate(contextMenuShownCallback);
646 Interop.WebView.RegisterContextMenuShownCallback(SwigCPtr, new HandleRef(this, ip));
648 contextMenuShownEventHandler += value;
652 contextMenuShownEventHandler -= value;
657 /// Event for the ContextMenuHidden signal which can be used to subscribe or unsubscribe the event handler.<br />
658 /// This signal is emitted when context menu item is hidden.<br />
660 [EditorBrowsable(EditorBrowsableState.Never)]
661 public event EventHandler<WebViewContextMenuHiddenEventArgs> ContextMenuHidden
665 if (contextMenuHiddenEventHandler == null)
667 contextMenuHiddenCallback = OnContextMenuHidden;
668 IntPtr ip = Marshal.GetFunctionPointerForDelegate(contextMenuHiddenCallback);
669 Interop.WebView.RegisterContextMenuHiddenCallback(SwigCPtr, new HandleRef(this, ip));
671 contextMenuHiddenEventHandler += value;
675 contextMenuHiddenEventHandler -= value;
680 /// Options for searching texts.
682 [EditorBrowsable(EditorBrowsableState.Never)]
683 public enum FindOption
688 [EditorBrowsable(EditorBrowsableState.Never)]
692 /// Case insensitive search
694 [EditorBrowsable(EditorBrowsableState.Never)]
695 CaseInsensitive = 1 << 0,
698 /// Search text only at the beginning of the words
700 [EditorBrowsable(EditorBrowsableState.Never)]
701 AtWordStart = 1 << 1,
704 /// Treat capital letters in the middle of words as word start
706 [EditorBrowsable(EditorBrowsableState.Never)]
707 TreatMediaCapitalAsWordStart = 1 << 2,
712 [EditorBrowsable(EditorBrowsableState.Never)]
716 /// If not present the search stops at the end of the document
718 [EditorBrowsable(EditorBrowsableState.Never)]
724 [EditorBrowsable(EditorBrowsableState.Never)]
725 ShowOverlay = 1 << 5,
730 [EditorBrowsable(EditorBrowsableState.Never)]
731 ShowFindIndiator = 1 << 6,
736 [EditorBrowsable(EditorBrowsableState.Never)]
737 ShowHighlight = 1 << 7,
741 /// Enumeration for mode of hit test.
743 [EditorBrowsable(EditorBrowsableState.Never)]
744 public enum HitTestMode
749 [EditorBrowsable(EditorBrowsableState.Never)]
753 /// Extra node data(tag name, node value, attribute infomation, etc).
755 [EditorBrowsable(EditorBrowsableState.Never)]
759 /// Extra image data(image data, image data length, image file name exteionsion, etc).
761 [EditorBrowsable(EditorBrowsableState.Never)]
767 [EditorBrowsable(EditorBrowsableState.Never)]
768 All = Default | NodeData | ImageData,
774 [EditorBrowsable(EditorBrowsableState.Never)]
775 public WebContext Context => context;
780 [EditorBrowsable(EditorBrowsableState.Never)]
781 public WebCookieManager CookieManager => cookieManager;
786 [EditorBrowsable(EditorBrowsableState.Never)]
787 public WebBackForwardList BackForwardList { get; }
792 [EditorBrowsable(EditorBrowsableState.Never)]
793 public WebSettings Settings { get; }
798 /// <since_tizen> 9 </since_tizen>
803 return (string)GetValue(UrlProperty);
807 SetValue(UrlProperty, value);
808 NotifyPropertyChanged();
813 /// Deprecated. The cache model of the current WebView.
815 [EditorBrowsable(EditorBrowsableState.Never)]
816 public CacheModel CacheModel
820 return (CacheModel)GetValue(CacheModelProperty);
824 SetValue(CacheModelProperty, value);
825 NotifyPropertyChanged();
829 private CacheModel InternalCacheModel
833 return (CacheModel)Context.CacheModel;
837 Context.CacheModel = (WebContext.CacheModelType)value;
842 /// Deprecated. The cookie acceptance policy.
844 [EditorBrowsable(EditorBrowsableState.Never)]
845 public CookieAcceptPolicy CookieAcceptPolicy
849 return (CookieAcceptPolicy)GetValue(CookieAcceptPolicyProperty);
853 SetValue(CookieAcceptPolicyProperty, value);
854 NotifyPropertyChanged();
858 private CookieAcceptPolicy InternalCookieAcceptPolicy
862 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
866 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
871 /// The user agent string.
873 /// <since_tizen> 9 </since_tizen>
874 public string UserAgent
878 return (string)GetValue(UserAgentProperty);
882 SetValue(UserAgentProperty, value);
883 NotifyPropertyChanged();
888 /// Deprecated. Whether JavaScript is enabled.
890 [EditorBrowsable(EditorBrowsableState.Never)]
891 public bool EnableJavaScript
895 return (bool)GetValue(EnableJavaScriptProperty);
899 SetValue(EnableJavaScriptProperty, value);
900 NotifyPropertyChanged();
904 private bool InternalEnableJavaScript
908 return Settings.JavaScriptEnabled;
912 Settings.JavaScriptEnabled = value;
917 /// Deprecated. Whether images can be loaded automatically.
919 [EditorBrowsable(EditorBrowsableState.Never)]
920 public bool LoadImagesAutomatically
924 return (bool)GetValue(LoadImagesAutomaticallyProperty);
928 SetValue(LoadImagesAutomaticallyProperty, value);
929 NotifyPropertyChanged();
933 private bool InternalLoadImagesAutomatically
937 return Settings.AutomaticImageLoadingAllowed;
941 Settings.AutomaticImageLoadingAllowed = value;
946 /// The default text encoding name.<br />
947 /// e.g. "UTF-8"<br />
949 [EditorBrowsable(EditorBrowsableState.Never)]
950 public string DefaultTextEncodingName
954 return GetValue(DefaultTextEncodingNameProperty) as string;
958 SetValue(DefaultTextEncodingNameProperty, value);
959 NotifyPropertyChanged();
963 private string InternalDefaultTextEncodingName
967 return Settings.DefaultTextEncodingName;
971 Settings.DefaultTextEncodingName = value;
976 /// The default font size in pixel.
978 [EditorBrowsable(EditorBrowsableState.Never)]
979 public int DefaultFontSize
983 return (int)GetValue(DefaultFontSizeProperty);
987 SetValue(DefaultFontSizeProperty, value);
988 NotifyPropertyChanged();
992 private int InternalDefaultFontSize
996 return Settings.DefaultFontSize;
1000 Settings.DefaultFontSize = value;
1005 /// The position of scroll.
1007 [EditorBrowsable(EditorBrowsableState.Never)]
1008 public Position ScrollPosition
1012 return GetValue(ScrollPositionProperty) as Position;
1016 SetValue(ScrollPositionProperty, value);
1020 private Position InternalScrollPosition
1024 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
1025 return new Position(pv.X, pv.Y);
1031 Position pv = value;
1032 Vector2 vpv = new Vector2(pv.X, pv.Y);
1033 SetValue(ScrollPositionProperty, vpv);
1034 NotifyPropertyChanged();
1040 /// The size of scroll, read-only.
1042 [EditorBrowsable(EditorBrowsableState.Never)]
1043 public Size ScrollSize
1047 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
1048 return new Size(sv.Width, sv.Height);
1053 /// The size of content, read-only.
1055 [EditorBrowsable(EditorBrowsableState.Never)]
1056 public Size ContentSize
1060 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
1061 return new Size(sv.Width, sv.Height);
1066 /// Whether video hole is enabled or not.
1068 [EditorBrowsable(EditorBrowsableState.Never)]
1069 public bool VideoHoleEnabled
1073 return (bool)GetValue(VideoHoleEnabledProperty);
1077 SetValue(VideoHoleEnabledProperty, value);
1078 NotifyPropertyChanged();
1083 /// Whether mouse events are enabled or not.
1085 [EditorBrowsable(EditorBrowsableState.Never)]
1086 public bool MouseEventsEnabled
1090 return (bool)GetValue(MouseEventsEnabledProperty);
1094 SetValue(MouseEventsEnabledProperty, value);
1095 NotifyPropertyChanged();
1100 /// Whether key events are enabled or not.
1102 [EditorBrowsable(EditorBrowsableState.Never)]
1103 public bool KeyEventsEnabled
1107 return (bool)GetValue(KeyEventsEnabledProperty);
1111 SetValue(KeyEventsEnabledProperty, value);
1112 NotifyPropertyChanged();
1117 /// Background color of web page.
1119 [EditorBrowsable(EditorBrowsableState.Never)]
1120 public Color ContentBackgroundColor
1124 return (Color)GetValue(ContentBackgroundColorProperty);
1128 SetValue(ContentBackgroundColorProperty, value);
1129 NotifyPropertyChanged();
1134 /// Whether tiles are cleared or not when hidden.
1136 [EditorBrowsable(EditorBrowsableState.Never)]
1137 public bool TilesClearedWhenHidden
1141 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1145 SetValue(TilesClearedWhenHiddenProperty, value);
1146 NotifyPropertyChanged();
1151 /// Multiplier of cover area of tile when web page is rendered.
1153 [EditorBrowsable(EditorBrowsableState.Never)]
1154 public float TileCoverAreaMultiplier
1158 return (float)GetValue(TileCoverAreaMultiplierProperty);
1162 SetValue(TileCoverAreaMultiplierProperty, value);
1163 NotifyPropertyChanged();
1168 /// Whether cursor is enabled or not by client.
1170 [EditorBrowsable(EditorBrowsableState.Never)]
1171 public bool CursorEnabledByClient
1175 return (bool)GetValue(CursorEnabledByClientProperty);
1179 SetValue(CursorEnabledByClientProperty, value);
1180 NotifyPropertyChanged();
1185 /// Gets selected text in web page.
1187 [EditorBrowsable(EditorBrowsableState.Never)]
1188 public string SelectedText
1192 return (string)GetValue(SelectedTextProperty);
1197 /// Gets title of web page.
1199 /// <since_tizen> 9 </since_tizen>
1204 return (string)GetValue(TitleProperty);
1209 /// Gets favicon of web page.
1211 /// <since_tizen> 9 </since_tizen>
1212 public ImageView Favicon
1216 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1217 if (imageView == IntPtr.Zero)
1219 return new ImageView(imageView, false);
1224 /// Zoom factor of web page.
1226 [EditorBrowsable(EditorBrowsableState.Never)]
1227 public float PageZoomFactor
1231 return (float)GetValue(PageZoomFactorProperty);
1235 SetValue(PageZoomFactorProperty, value);
1236 NotifyPropertyChanged();
1241 /// Zoom factor of text in web page.
1243 [EditorBrowsable(EditorBrowsableState.Never)]
1244 public float TextZoomFactor
1248 return (float)GetValue(TextZoomFactorProperty);
1252 SetValue(TextZoomFactorProperty, value);
1253 NotifyPropertyChanged();
1258 /// Gets percentage of loading progress.
1260 /// <since_tizen> 9 </since_tizen>
1261 public float LoadProgressPercentage
1265 return (float)GetValue(LoadProgressPercentageProperty);
1269 internal static new class Property
1271 internal static readonly int Url = Interop.WebView.UrlGet();
1272 internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
1273 internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
1274 internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
1275 internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
1276 internal static readonly int Title = Interop.WebView.TitleGet();
1277 internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
1278 internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
1279 internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
1280 internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
1281 internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
1282 internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
1283 internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
1284 internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
1285 internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
1286 internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
1287 internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
1290 private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1292 var webview = (WebView)bindable;
1293 if (newValue != null)
1295 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1298 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1300 var webview = (WebView)bindable;
1302 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1306 private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1308 var webview = (WebView)bindable;
1309 if (newValue != null)
1311 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1314 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1316 var webview = (WebView)bindable;
1318 Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1322 private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1324 var webview = (WebView)bindable;
1325 if (newValue != null)
1327 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1330 defaultValueCreator: (bindable) =>
1332 var webview = (WebView)bindable;
1333 Vector2 temp = new Vector2(0.0f, 0.0f);
1334 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
1338 private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1340 var webview = (WebView)bindable;
1341 Vector2 temp = new Vector2(0.0f, 0.0f);
1342 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
1346 private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1348 var webview = (WebView)bindable;
1349 Vector2 temp = new Vector2(0.0f, 0.0f);
1350 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
1354 private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1356 var webview = (WebView)bindable;
1358 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1362 private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1364 var webview = (WebView)bindable;
1365 if (newValue != null)
1367 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1370 defaultValueCreator: (bindable) =>
1372 var webview = (WebView)bindable;
1374 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1378 private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1380 var webview = (WebView)bindable;
1381 if (newValue != null)
1383 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1386 defaultValueCreator: (bindable) =>
1388 var webview = (WebView)bindable;
1390 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1394 private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1396 var webview = (WebView)bindable;
1397 if (newValue != null)
1399 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1402 defaultValueCreator: (bindable) =>
1404 var webview = (WebView)bindable;
1406 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1410 private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1412 var webview = (WebView)bindable;
1413 if (newValue != null)
1415 webview.contentBackgroundColor = (Color)newValue;
1416 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1419 defaultValueCreator: (bindable) =>
1421 var webview = (WebView)bindable;
1422 return webview.contentBackgroundColor;
1425 private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1427 var webview = (WebView)bindable;
1428 if (newValue != null)
1430 webview.tilesClearedWhenHidden = (bool)newValue;
1431 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1434 defaultValueCreator: (bindable) =>
1436 var webview = (WebView)bindable;
1437 return webview.tilesClearedWhenHidden;
1440 private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1442 var webview = (WebView)bindable;
1443 if (newValue != null)
1445 webview.tileCoverAreaMultiplier = (float)newValue;
1446 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1449 defaultValueCreator: (bindable) =>
1451 var webview = (WebView)bindable;
1452 return webview.tileCoverAreaMultiplier;
1455 private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1457 var webview = (WebView)bindable;
1458 if (newValue != null)
1460 webview.cursorEnabledByClient = (bool)newValue;
1461 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1464 defaultValueCreator: (bindable) =>
1466 var webview = (WebView)bindable;
1467 return webview.cursorEnabledByClient;
1470 private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1472 var webview = (WebView)bindable;
1474 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1478 private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1480 var webview = (WebView)bindable;
1481 if (newValue != null)
1483 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1486 defaultValueCreator: (bindable) =>
1488 var webview = (WebView)bindable;
1490 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1494 private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1496 var webview = (WebView)bindable;
1497 if (newValue != null)
1499 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1502 defaultValueCreator: (bindable) =>
1504 var webview = (WebView)bindable;
1506 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1510 private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1512 var webview = (WebView)bindable;
1514 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1518 // For rooting handlers
1519 internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1524 /// <param name="url">The path of Web</param>
1526 /// The following privileges are required:
1527 /// http://tizen.org/privilege/internet for remote web pages of websites.
1528 /// http://tizen.org/privilege/mediastorage for local files in media storage.
1529 /// http://tizen.org/privilege/externalstorage for local files in external storage.
1531 /// <since_tizen> 9 </since_tizen>
1532 public void LoadUrl(string url)
1534 Interop.WebView.LoadUrl(SwigCPtr, url);
1535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1539 /// Deprecated. Loads a html by string.
1541 /// <param name="data">The data of Web</param>
1542 [EditorBrowsable(EditorBrowsableState.Never)]
1543 public void LoadHTMLString(string data)
1545 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1546 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1550 /// Loads a html by string.
1552 /// <param name="data">The data of Web</param>
1553 /// <since_tizen> 9 </since_tizen>
1554 public void LoadHtmlString(string data)
1556 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1557 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1561 /// Loads the specified html as the content of the view to override current history entry.
1563 /// <param name="html">The html to be loaded</param>
1564 /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1565 /// <param name="unreachableUri">URL that could not be reached</param>
1566 [EditorBrowsable(EditorBrowsableState.Never)]
1567 public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1569 bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1570 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1575 /// Requests to load the given contents by MIME type.
1577 /// <param name="contents">The contents to be loaded</param>
1578 /// <param name="contentSize">The size of contents (in bytes)</param>
1579 /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1580 /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1581 /// <param name="baseUri">The base URI to use for relative resources</param>
1582 [EditorBrowsable(EditorBrowsableState.Never)]
1583 public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1585 bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1593 [EditorBrowsable(EditorBrowsableState.Never)]
1594 public void Reload()
1596 Interop.WebView.Reload(SwigCPtr);
1597 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1601 /// Reloads the current page's document without cache
1603 [EditorBrowsable(EditorBrowsableState.Never)]
1604 public bool ReloadWithoutCache()
1606 bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1612 /// Stops loading the Web
1614 [EditorBrowsable(EditorBrowsableState.Never)]
1615 public void StopLoading()
1617 Interop.WebView.StopLoading(SwigCPtr);
1618 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1622 /// Suspends the operation.
1624 [EditorBrowsable(EditorBrowsableState.Never)]
1625 public void Suspend()
1627 Interop.WebView.Suspend(SwigCPtr);
1628 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1632 /// Resumes the operation after calling Suspend()
1634 [EditorBrowsable(EditorBrowsableState.Never)]
1635 public void Resume()
1637 Interop.WebView.Resume(SwigCPtr);
1638 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1642 /// Suspends all network loading.
1644 [EditorBrowsable(EditorBrowsableState.Never)]
1645 public void SuspendNetworkLoading()
1647 Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1652 /// Resumes all network loading.
1654 [EditorBrowsable(EditorBrowsableState.Never)]
1655 public void ResumeNetworkLoading()
1657 Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1658 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1662 /// Adds custom header.
1664 /// <param name="name">The name of custom header</param>
1665 /// <param name="value">The value of custom header</param>
1666 [EditorBrowsable(EditorBrowsableState.Never)]
1667 public bool AddCustomHeader(string name, string value)
1669 bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1670 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1675 /// Removes custom header.
1677 /// <param name="name">The name of custom header</param>
1678 [EditorBrowsable(EditorBrowsableState.Never)]
1679 public bool RemoveCustomHeader(string name)
1681 bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1682 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1687 /// Starts the inspector server.
1689 /// <param name="port">The port number</param>
1690 [EditorBrowsable(EditorBrowsableState.Never)]
1691 public uint StartInspectorServer(uint port)
1693 uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1694 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1699 /// Stops the inspector server.
1701 [EditorBrowsable(EditorBrowsableState.Never)]
1702 public bool StopInspectorServer()
1704 bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1710 /// Scrolls page of web view by deltaX and detlaY.
1712 /// <param name="deltaX">The deltaX of scroll</param>
1713 /// <param name="deltaY">The deltaY of scroll</param>
1714 [EditorBrowsable(EditorBrowsableState.Never)]
1715 public void ScrollBy(int deltaX, int deltaY)
1717 Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1718 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1722 /// Scrolls edge of web view by deltaX and deltaY.
1724 /// <param name="deltaX">The deltaX of scroll</param>
1725 /// <param name="deltaY">The deltaY of scroll</param>
1726 [EditorBrowsable(EditorBrowsableState.Never)]
1727 public bool ScrollEdgeBy(int deltaX, int deltaY)
1729 bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1735 /// Goes to the back
1737 [EditorBrowsable(EditorBrowsableState.Never)]
1738 public void GoBack()
1740 Interop.WebView.GoBack(SwigCPtr);
1741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1745 /// Goes to the forward
1747 [EditorBrowsable(EditorBrowsableState.Never)]
1748 public void GoForward()
1750 Interop.WebView.GoForward(SwigCPtr);
1751 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1755 /// Returns whether backward is possible.
1757 /// <returns>True if backward is possible, false otherwise</returns>
1758 [EditorBrowsable(EditorBrowsableState.Never)]
1759 public bool CanGoBack()
1761 bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1762 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1767 /// Returns whether forward is possible.
1769 /// <returns>True if forward is possible, false otherwise</returns>
1770 [EditorBrowsable(EditorBrowsableState.Never)]
1771 public bool CanGoForward()
1773 bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1779 /// Evaluates JavaScript code represented as a string.
1781 /// <param name="script">The JavaScript code</param>
1782 [EditorBrowsable(EditorBrowsableState.Never)]
1783 public void EvaluateJavaScript(string script)
1785 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1790 /// Evaluates JavaScript code represented as a string.
1792 /// <param name="script">The JavaScript code</param>
1793 /// <param name="handler">The callback for result of JavaScript code evaluation</param>
1794 [EditorBrowsable(EditorBrowsableState.Never)]
1795 public void EvaluateJavaScript(string script, JavaScriptMessageHandler handler)
1797 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1798 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(this, ip));
1799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1803 /// Add a message handler into the WebView.
1805 /// <param name="objectName">The name of exposed object</param>
1806 /// <param name="handler">The callback function</param>
1807 [EditorBrowsable(EditorBrowsableState.Never)]
1808 public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1810 if (handlerRootMap.ContainsKey(objectName))
1815 handlerRootMap.Add(objectName, handler);
1817 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1818 Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1820 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1824 /// Registers a callback for JS alert.
1826 /// <param name="callback">The callback function</param>
1827 [EditorBrowsable(EditorBrowsableState.Never)]
1828 public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1830 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1831 Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1833 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1837 /// Reply for alert popup.
1839 [EditorBrowsable(EditorBrowsableState.Never)]
1840 public void JavaScriptAlertReply()
1842 Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1843 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1847 /// Registers a callback for JS confirm.
1849 /// <param name="callback">The callback function</param>
1850 [EditorBrowsable(EditorBrowsableState.Never)]
1851 public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1853 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1854 Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1860 /// Reply for confirm popup.
1862 /// <param name="confirmed">Confirmed or not</param>
1863 [EditorBrowsable(EditorBrowsableState.Never)]
1864 public void JavaScriptConfirmReply(bool confirmed)
1866 Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1867 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1871 /// Registers a callback for JS promt.
1873 /// <param name="callback">The callback function</param>
1874 [EditorBrowsable(EditorBrowsableState.Never)]
1875 public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1877 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1878 Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1880 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1884 /// Reply for prompt popup.
1886 /// <param name="result">Text in prompt input field.</param>
1887 [EditorBrowsable(EditorBrowsableState.Never)]
1888 public void JavaScriptPromptReply(string result)
1890 Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
1891 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1895 /// Clears title resources of current WebView.
1897 [EditorBrowsable(EditorBrowsableState.Never)]
1898 public void ClearAllTilesResources()
1900 Interop.WebView.ClearAllTilesResources(SwigCPtr);
1901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1905 /// Clears the history of current WebView.
1907 [EditorBrowsable(EditorBrowsableState.Never)]
1908 public void ClearHistory()
1910 Interop.WebView.ClearHistory(SwigCPtr);
1911 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1915 /// Scales the current page, centered at the given point.
1917 /// <param name="scaleFactor">The new factor to be scaled</param>
1918 /// <param name="point">The center coordinate</param>
1919 [EditorBrowsable(EditorBrowsableState.Never)]
1920 public void SetScaleFactor(float scaleFactor, Vector2 point)
1922 Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
1923 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1927 /// Gets the current scale factor of the page.
1929 [EditorBrowsable(EditorBrowsableState.Never)]
1930 public float GetScaleFactor()
1932 float result = Interop.WebView.GetScaleFactor(SwigCPtr);
1933 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1938 /// Requests to activate/deactivate the accessibility usage set by web app.
1940 /// <param name="activated">The new factor to be scaled</param>
1941 [EditorBrowsable(EditorBrowsableState.Never)]
1942 public void ActivateAccessibility(bool activated)
1944 Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
1945 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1949 /// Searches and highlights the given string in the document.
1951 /// <param name="text">The text to be searched</param>
1952 /// <param name="options">The options to search</param>
1953 /// <param name="maxMatchCount">The maximum match count to search</param>
1954 [EditorBrowsable(EditorBrowsableState.Never)]
1955 public bool HighlightText(string text, FindOption options, uint maxMatchCount)
1957 bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
1958 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1963 /// Adds dynamic certificate path.
1965 /// <param name="host">Host that required client authentication</param>
1966 /// <param name="certPath">The file path stored certificate</param>
1967 [EditorBrowsable(EditorBrowsableState.Never)]
1968 public void AddDynamicCertificatePath(string host, string certPath)
1970 Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
1971 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1975 /// Get snapshot of the specified viewArea of page.
1977 /// <param name="viewArea">Host that required client authentication</param>
1978 /// <param name="scaleFactor">The file path stored certificate</param>
1979 [EditorBrowsable(EditorBrowsableState.Never)]
1980 public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
1982 IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
1983 ImageView imageView = new ImageView(image, true);
1984 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1989 /// Get snapshot of the specified viewArea of page.
1991 /// <param name="viewArea">Host that required client authentication</param>
1992 /// <param name="scaleFactor">The file path stored certificate</param>
1993 /// <param name="callback">The callback for getting screen shot</param>
1994 [EditorBrowsable(EditorBrowsableState.Never)]
1995 public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
1997 screenshotAcquiredCallback = callback;
1998 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(screenshotAcquiredProxyCallback);
1999 bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
2000 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2005 /// Asynchronously requests to check if there is a video playing in the given view.
2007 /// <param name="callback">The callback called after checking if video is playing or not</param>
2008 [EditorBrowsable(EditorBrowsableState.Never)]
2009 public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
2011 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
2012 bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
2013 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2018 /// Registers callback which will be called upon geolocation permission request.
2020 /// <param name="callback">The callback for requesting geolocation permission</param>
2021 [EditorBrowsable(EditorBrowsableState.Never)]
2022 public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
2024 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
2025 Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
2026 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2030 /// Does hit test synchronously.
2032 /// <param name="x">the horizontal position to query</param>
2033 /// <param name="y">the vertical position to query</param>
2034 /// <param name="mode">the mode of hit test</param>
2035 [EditorBrowsable(EditorBrowsableState.Never)]
2036 public WebHitTestResult HitTest(int x, int y, HitTestMode mode)
2038 System.IntPtr result = Interop.WebView.CreateHitTest(SwigCPtr, x, y, (int)mode);
2039 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2040 return new WebHitTestResult(result, true);
2044 /// Does hit test asynchronously.
2046 /// <param name="x">the horizontal position to query</param>
2047 /// <param name="y">the vertical position to query</param>
2048 /// <param name="mode">the mode of hit test</param>
2049 /// <param name="callback">the callback that is called after hit test is finished.</param>
2050 [EditorBrowsable(EditorBrowsableState.Never)]
2051 public bool HitTestAsynchronously(int x, int y, HitTestMode mode, HitTestFinishedCallback callback)
2053 hitTestFinishedCallback = callback;
2054 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(hitTestFinishedProxyCallback);
2055 bool result = Interop.WebView.CreateHitTestAsynchronously(SwigCPtr, x, y, (int)mode, new HandleRef(this, ip));
2056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2061 /// Deprecated. Clears the cache of current WebView.
2063 [EditorBrowsable(EditorBrowsableState.Never)]
2064 public void ClearCache()
2066 Context.ClearCache();
2070 /// Deprecated. Clears all the cookies of current WebView.
2072 [EditorBrowsable(EditorBrowsableState.Never)]
2073 public void ClearCookies()
2075 CookieManager.ClearCookies();
2079 /// Sets the tts focus to the webview.
2080 /// Please note that it only works when the webview does not have keyinput focus.
2081 /// If the webview has a keyinput focus, it also has tts focus so calling SetTtsFocus(false) is ignored.
2083 /// <param name="focused">Focused or not</param>
2084 [EditorBrowsable(EditorBrowsableState.Never)]
2085 public void SetTtsFocus(bool focused)
2087 Interop.WebView.SetTtsFocus(SwigCPtr, focused);
2088 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2092 /// Get a plain text of current web page asynchronously.
2093 /// Please note that it gets plain text of currently loaded page so please call this method after page load finished.
2095 /// <param name="callback">The callback for getting plain text</param>
2096 [EditorBrowsable(EditorBrowsableState.Never)]
2097 public void GetPlainTextAsynchronously(PlainTextReceivedCallback callback)
2099 plainTextReceivedCallback = callback;
2100 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(plainTextReceivedCallback);
2101 Interop.WebView.GetPlainTextAsynchronously(SwigCPtr, new HandleRef(this, ip));
2102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2105 internal static WebView DownCast(BaseHandle handle)
2107 WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2112 internal WebView Assign(WebView webView)
2114 WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2119 private void OnPageLoadStarted(string pageUrl)
2121 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2124 e.PageUrl = pageUrl;
2126 pageLoadStartedEventHandler?.Invoke(this, e);
2129 private void OnPageLoading(string pageUrl)
2131 pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2134 private void OnPageLoadFinished(string pageUrl)
2136 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2139 e.PageUrl = pageUrl;
2141 pageLoadFinishedEventHandler?.Invoke(this, e);
2144 private void OnPageLoadError(IntPtr error)
2146 pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, true)));
2149 private void OnScrollEdgeReached(int edge)
2151 scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2154 private void OnUrlChanged(string pageUrl)
2156 urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2159 private void OnFormRepostPolicyDecided(IntPtr decision)
2161 formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, true)));
2164 private void OnFrameRendered()
2166 frameRenderedEventHandler?.Invoke(this, new EventArgs());
2169 private void OnScreenshotAcquired(IntPtr data)
2171 #pragma warning disable CA2000 // Dispose objects before losing scope
2172 screenshotAcquiredCallback?.Invoke(new ImageView(data, true));
2173 #pragma warning restore CA2000 // Dispose objects before losing scope
2176 private void OnResponsePolicyDecided(IntPtr maker)
2178 responsePolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2181 private void OnNavigationPolicyDecided(IntPtr maker)
2183 navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2186 private void OnNewWindowCreated(out IntPtr viewHandle)
2188 WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs());
2189 viewHandle = (IntPtr)view.SwigCPtr;
2192 private void OnCertificateConfirmed(IntPtr certificate)
2194 certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2197 private void OnSslCertificateChanged(IntPtr certificate)
2199 sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2202 private void OnHttpAuthRequested(IntPtr handler)
2204 httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, true)));
2207 private void OnConsoleMessageReceived(IntPtr message)
2209 consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, true)));
2212 private void OnContextMenuShown(IntPtr menu)
2214 contextMenuShownEventHandler?.Invoke(this, new WebViewContextMenuShownEventArgs(new WebContextMenu(menu, true)));
2217 private void OnContextMenuHidden(IntPtr menu)
2219 contextMenuHiddenEventHandler?.Invoke(this, new WebViewContextMenuHiddenEventArgs(new WebContextMenu(menu, true)));
2222 private void OnHitTestFinished(IntPtr test)
2224 #pragma warning disable CA2000 // Dispose objects before losing scope
2225 hitTestFinishedCallback?.Invoke(new WebHitTestResult(test, true));
2226 #pragma warning restore CA2000 // Dispose objects before losing scope