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
29 [EditorBrowsable(EditorBrowsableState.Never)]
30 public class WebView : View
32 private Color contentBackgroundColor;
33 private bool tilesClearedWhenHidden;
34 private float tileCoverAreaMultiplier;
35 private bool cursorEnabledByClient;
37 private readonly WebViewPageLoadSignal pageLoadStartedSignal;
38 private EventHandler<WebViewPageLoadEventArgs> pageLoadStartedEventHandler;
39 private WebViewPageLoadCallbackDelegate pageLoadStartedCallback;
41 private readonly WebViewPageLoadSignal pageLoadingSignal;
42 private EventHandler<WebViewPageLoadEventArgs> pageLoadingEventHandler;
43 private WebViewPageLoadCallbackDelegate pageLoadingCallback;
45 private readonly WebViewPageLoadSignal pageLoadFinishedSignal;
46 private EventHandler<WebViewPageLoadEventArgs> pageLoadFinishedEventHandler;
47 private WebViewPageLoadCallbackDelegate pageLoadFinishedCallback;
49 private readonly WebViewPageLoadErrorSignal pageLoadErrorSignal;
50 private EventHandler<WebViewPageLoadErrorEventArgs> pageLoadErrorEventHandler;
51 private WebViewPageLoadErrorCallbackDelegate pageLoadErrorCallback;
53 private readonly WebViewScrollEdgeReachedSignal scrollEdgeReachedSignal;
54 private EventHandler<WebViewScrollEdgeReachedEventArgs> scrollEdgeReachedEventHandler;
55 private WebViewScrollEdgeReachedCallbackDelegate scrollEdgeReachedCallback;
57 private readonly WebViewUrlChangedSignal urlChangedSignal;
58 private EventHandler<WebViewUrlChangedEventArgs> urlChangedEventHandler;
59 private WebViewUrlChangedCallbackDelegate urlChangedCallback;
61 private readonly WebViewFormRepostPolicyDecidedSignal formRepostPolicyDecidedSignal;
62 private EventHandler<WebViewFormRepostPolicyDecidedEventArgs> formRepostPolicyDecidedEventHandler;
63 private WebViewFormRepostPolicyDecidedCallbackDelegate formRepostPolicyDecidedCallback;
65 private readonly WebViewFrameRenderedSignal frameRenderedSignal;
66 private EventHandler<EventArgs> frameRenderedEventHandler;
67 private WebViewFrameRenderedCallbackDelegate frameRenderedCallback;
69 private ScreenshotAcquiredCallback screenshotAcquiredCallback;
70 private readonly WebViewScreenshotAcquiredProxyCallback screenshotAcquiredProxyCallback;
72 private HitTestFinishedCallback hitTestFinishedCallback;
73 private readonly WebViewHitTestFinishedProxyCallback hitTestFinishedProxyCallback;
75 private readonly WebViewResponsePolicyDecidedSignal responsePolicyDecidedSignal;
76 private EventHandler<WebViewResponsePolicyDecidedEventArgs> responsePolicyDecidedEventHandler;
77 private WebViewResponsePolicyDecidedCallbackDelegate responsePolicyDecidedCallback;
79 private readonly WebViewCertificateReceivedSignal certificateConfirmedSignal;
80 private EventHandler<WebViewCertificateReceivedEventArgs> certificateConfirmedEventHandler;
81 private WebViewCertificateReceivedCallbackDelegate certificateConfirmedCallback;
83 private readonly WebViewCertificateReceivedSignal sslCertificateChangedSignal;
84 private EventHandler<WebViewCertificateReceivedEventArgs> sslCertificateChangedEventHandler;
85 private WebViewCertificateReceivedCallbackDelegate sslCertificateChangedCallback;
87 private readonly WebViewHttpAuthRequestedSignal httpAuthRequestedSignal;
88 private EventHandler<WebViewHttpAuthRequestedEventArgs> httpAuthRequestedEventHandler;
89 private WebViewHttpAuthRequestedCallbackDelegate httpAuthRequestedCallback;
91 private readonly WebViewHttpRequestInterceptedSignal httpRequestInterceptedSignal;
92 private EventHandler<WebViewHttpRequestInterceptedEventArgs> httpRequestInterceptedEventHandler;
93 private WebViewHttpRequestInterceptedCallbackDelegate httpRequestInterceptedCallback;
95 private readonly WebViewConsoleMessageReceivedSignal consoleMessageReceivedSignal;
96 private EventHandler<WebViewConsoleMessageReceivedEventArgs> consoleMessageReceivedEventHandler;
97 private WebViewConsoleMessageReceivedCallbackDelegate consoleMessageReceivedCallback;
99 private readonly WebViewContextMenuCustomizedSignal contextMenuCustomizedSignal;
100 private EventHandler<WebViewContextMenuCustomizedEventArgs> contextMenuCustomizedEventHandler;
101 private WebViewContextMenuCustomizedCallbackDelegate contextMenuCustomizedCallback;
103 private readonly WebViewContextMenuItemSelectedSignal contextMenuItemSelectedSignal;
104 private EventHandler<WebViewContextMenuItemSelectedEventArgs> contextMenuItemSelectedEventHandler;
105 private WebViewContextMenuItemSelectedCallbackDelegate contextMenuItemSelectedCallback;
108 /// Creates a WebView.
110 [EditorBrowsable(EditorBrowsableState.Never)]
111 public WebView() : this(Interop.WebView.New(), true)
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 /// Creates a WebView with local language and time zone.
118 /// <param name="locale">The locale language of Web</param>
119 /// <param name="timezoneId">The time zone Id of Web</param>
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public WebView(string locale, string timezoneId) : this(Interop.WebView.New2(locale, timezoneId), true)
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 /// Creates a WebView with an args list.
129 /// <param name="args">args array. The first value of array must be program's name.</param>
131 [EditorBrowsable(EditorBrowsableState.Never)]
132 public WebView(string[] args) : this(Interop.WebView.New3(args?.Length ?? 0, args), true)
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 /// Copy constructor.
139 /// <param name="webView">WebView to copy. The copied WebView will point at the same implementation</param>
141 [EditorBrowsable(EditorBrowsableState.Never)]
142 public WebView(WebView webView) : this(Interop.WebView.NewWebView(WebView.getCPtr(webView)), true)
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WebView.Upcast(cPtr), cMemoryOwn)
149 pageLoadStartedSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadStarted(SwigCPtr));
150 pageLoadingSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadInProgress(SwigCPtr));
151 pageLoadFinishedSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadFinished(SwigCPtr));
152 pageLoadErrorSignal = new WebViewPageLoadErrorSignal(Interop.WebView.NewWebViewPageLoadErrorSignalPageLoadError(SwigCPtr));
153 scrollEdgeReachedSignal = new WebViewScrollEdgeReachedSignal(Interop.WebView.NewWebViewScrollEdgeReachedSignalScrollEdgeReached(SwigCPtr));
154 urlChangedSignal = new WebViewUrlChangedSignal(Interop.WebView.NewWebViewUrlChangedSignalUrlChanged(SwigCPtr));
155 formRepostPolicyDecidedSignal = new WebViewFormRepostPolicyDecidedSignal(Interop.WebView.NewWebViewFormRepostDecisionSignalFormRepostDecision(SwigCPtr));
156 frameRenderedSignal = new WebViewFrameRenderedSignal(Interop.WebView.WebViewFrameRenderedSignalFrameRenderedGet(SwigCPtr));
157 responsePolicyDecidedSignal = new WebViewResponsePolicyDecidedSignal(Interop.WebView.NewWebViewResponsePolicyDecisionSignalPolicyDecision(SwigCPtr));
158 certificateConfirmedSignal = new WebViewCertificateReceivedSignal(Interop.WebView.NewWebViewCertificateSignalCertificateConfirm(SwigCPtr));
159 sslCertificateChangedSignal = new WebViewCertificateReceivedSignal(Interop.WebView.NewWebViewCertificateSignalSslCertificateChanged(SwigCPtr));
160 httpAuthRequestedSignal = new WebViewHttpAuthRequestedSignal(Interop.WebView.NewWebViewHttpAuthHandlerSignalHttpAuthHandler(SwigCPtr));
161 httpRequestInterceptedSignal = new WebViewHttpRequestInterceptedSignal(Interop.WebView.NewWebViewRequestInterceptorSignalRequestInterceptor(SwigCPtr));
162 consoleMessageReceivedSignal = new WebViewConsoleMessageReceivedSignal(Interop.WebView.NewWebViewConsoleMessageSignalConsoleMessage(SwigCPtr));
163 contextMenuCustomizedSignal = new WebViewContextMenuCustomizedSignal(Interop.WebView.NewWebViewContextMenuCustomizedSignalContextMenuCustomized(SwigCPtr));
164 contextMenuItemSelectedSignal = new WebViewContextMenuItemSelectedSignal(Interop.WebView.NewWebViewContextMenuItemSelectedSignalContextMenuItemSelected(SwigCPtr));
166 screenshotAcquiredProxyCallback = OnScreenshotAcquired;
167 hitTestFinishedProxyCallback = OnHitTestFinished;
169 BackForwardList = new WebBackForwardList(Interop.WebView.GetWebBackForwardList(SwigCPtr), false);
170 Context = new WebContext(Interop.WebView.GetWebContext(SwigCPtr), false);
171 CookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(SwigCPtr), false);
172 Settings = new WebSettings(Interop.WebView.GetWebSettings(SwigCPtr), false);
176 /// Dispose for IDisposable pattern
178 [EditorBrowsable(EditorBrowsableState.Never)]
179 protected override void Dispose(DisposeTypes type)
186 if (type == DisposeTypes.Explicit)
189 //Release your own managed resources here.
190 //You should release all of your own disposable objects here.
191 pageLoadStartedSignal.Dispose();
192 pageLoadingSignal.Dispose();
193 pageLoadFinishedSignal.Dispose();
194 pageLoadErrorSignal.Dispose();
195 scrollEdgeReachedSignal.Dispose();
196 urlChangedSignal.Dispose();
197 formRepostPolicyDecidedSignal.Dispose();
198 frameRenderedSignal.Dispose();
199 responsePolicyDecidedSignal.Dispose();
200 certificateConfirmedSignal.Dispose();
201 sslCertificateChangedSignal.Dispose();
202 httpAuthRequestedSignal.Dispose();
203 httpRequestInterceptedSignal.Dispose();
204 consoleMessageReceivedSignal.Dispose();
205 contextMenuCustomizedSignal.Dispose();
206 contextMenuItemSelectedSignal.Dispose();
208 BackForwardList.Dispose();
210 CookieManager.Dispose();
217 /// This will not be public opened.
218 /// <param name="swigCPtr"></param>
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
222 Interop.WebView.DeleteWebView(swigCPtr);
226 /// The callback function that is invoked when the message is received from the script.
228 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
229 [EditorBrowsable(EditorBrowsableState.Never)]
230 public delegate void JavaScriptMessageHandler(string message);
233 /// The callback function that is invoked when the message is received from the script.
235 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
236 [EditorBrowsable(EditorBrowsableState.Never)]
237 public delegate void JavaScriptAlertCallback(string message);
240 /// The callback function that is invoked when the message is received from the script.
242 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
243 [EditorBrowsable(EditorBrowsableState.Never)]
244 public delegate void JavaScriptConfirmCallback(string message);
247 /// The callback function that is invoked when the message is received from the script.
249 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
250 [EditorBrowsable(EditorBrowsableState.Never)]
251 public delegate void JavaScriptPromptCallback(string message1, string message2);
254 /// The callback function that is invoked when screen shot is acquired asynchronously.
256 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
257 [EditorBrowsable(EditorBrowsableState.Never)]
258 public delegate void ScreenshotAcquiredCallback(ImageView image);
261 /// The callback function that is invoked when video playing is checked asynchronously.
263 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
264 [EditorBrowsable(EditorBrowsableState.Never)]
265 public delegate void VideoPlayingCallback(bool isPlaying);
268 /// The callback function that is invoked when geolocation permission is requested.
270 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
271 [EditorBrowsable(EditorBrowsableState.Never)]
272 public delegate void GeolocationPermissionCallback(string host, string protocol);
275 /// The callback function that is invoked when hit test is finished.
277 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
278 [EditorBrowsable(EditorBrowsableState.Never)]
279 public delegate void HitTestFinishedCallback(WebHitTestResult test);
281 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
282 private delegate void WebViewPageLoadCallbackDelegate(IntPtr data, string pageUrl);
284 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
285 private delegate void WebViewPageLoadErrorCallbackDelegate(IntPtr data, IntPtr error);
287 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
288 private delegate void WebViewScrollEdgeReachedCallbackDelegate(IntPtr data, int edge);
290 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
291 private delegate void WebViewUrlChangedCallbackDelegate(IntPtr data, string pageUrl);
293 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
294 private delegate void WebViewFormRepostPolicyDecidedCallbackDelegate(IntPtr data, IntPtr maker);
296 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
297 private delegate void WebViewFrameRenderedCallbackDelegate(IntPtr data);
299 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
300 private delegate void WebViewScreenshotAcquiredProxyCallback(IntPtr data);
302 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
303 private delegate void WebViewHitTestFinishedProxyCallback(IntPtr data);
305 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
306 private delegate void WebViewResponsePolicyDecidedCallbackDelegate(IntPtr data, IntPtr maker);
308 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
309 private delegate void WebViewCertificateReceivedCallbackDelegate(IntPtr data, IntPtr certificate);
311 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
312 private delegate void WebViewHttpAuthRequestedCallbackDelegate(IntPtr data, IntPtr handler);
314 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
315 private delegate void WebViewHttpRequestInterceptedCallbackDelegate(IntPtr data, IntPtr interceptor);
317 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
318 private delegate void WebViewConsoleMessageReceivedCallbackDelegate(IntPtr data, IntPtr message);
320 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
321 private delegate void WebViewContextMenuCustomizedCallbackDelegate(IntPtr data, IntPtr menu);
323 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
324 private delegate void WebViewContextMenuItemSelectedCallbackDelegate(IntPtr data, IntPtr item);
327 /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.<br />
328 /// This signal is emitted when page loading has started.<br />
330 [EditorBrowsable(EditorBrowsableState.Never)]
331 public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
335 if (pageLoadStartedEventHandler == null)
337 pageLoadStartedCallback = (OnPageLoadStarted);
338 pageLoadStartedSignal.Connect(pageLoadStartedCallback);
340 pageLoadStartedEventHandler += value;
344 pageLoadStartedEventHandler -= value;
345 if (pageLoadStartedEventHandler == null && pageLoadStartedCallback != null)
347 pageLoadStartedSignal.Disconnect(pageLoadStartedCallback);
353 /// Event for the PageLoading signal which can be used to subscribe or unsubscribe the event handler.<br />
354 /// This signal is emitted when page loading is in progress.<br />
356 [EditorBrowsable(EditorBrowsableState.Never)]
357 public event EventHandler<WebViewPageLoadEventArgs> PageLoading
361 if (pageLoadingEventHandler == null)
363 pageLoadingCallback = OnPageLoading;
364 pageLoadingSignal.Connect(pageLoadingCallback);
366 pageLoadingEventHandler += value;
370 pageLoadingEventHandler -= value;
371 if (pageLoadingEventHandler == null && pageLoadingCallback != null)
373 pageLoadingSignal.Disconnect(pageLoadingCallback);
379 /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.<br />
380 /// This signal is emitted when page loading has finished.<br />
382 [EditorBrowsable(EditorBrowsableState.Never)]
383 public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
387 if (pageLoadFinishedEventHandler == null)
389 pageLoadFinishedCallback = (OnPageLoadFinished);
390 pageLoadFinishedSignal.Connect(pageLoadFinishedCallback);
392 pageLoadFinishedEventHandler += value;
396 pageLoadFinishedEventHandler -= value;
397 if (pageLoadFinishedEventHandler == null && pageLoadFinishedCallback != null)
399 pageLoadFinishedSignal.Disconnect(pageLoadFinishedCallback);
405 /// Event for the PageLoadError signal which can be used to subscribe or unsubscribe the event handler.<br />
406 /// This signal is emitted when there's an error in page loading.<br />
408 [EditorBrowsable(EditorBrowsableState.Never)]
409 public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
413 if (pageLoadErrorEventHandler == null)
415 pageLoadErrorCallback = OnPageLoadError;
416 pageLoadErrorSignal.Connect(pageLoadErrorCallback);
418 pageLoadErrorEventHandler += value;
422 pageLoadErrorEventHandler -= value;
423 if (pageLoadErrorEventHandler == null && pageLoadErrorCallback != null)
425 pageLoadErrorSignal.Disconnect(pageLoadErrorCallback);
431 /// Event for the ScrollEdgeReached signal which can be used to subscribe or unsubscribe the event handler.<br />
432 /// This signal is emitted when web view is scrolled to edge.<br />
434 [EditorBrowsable(EditorBrowsableState.Never)]
435 public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
439 if (scrollEdgeReachedEventHandler == null)
441 scrollEdgeReachedCallback = OnScrollEdgeReached;
442 scrollEdgeReachedSignal.Connect(scrollEdgeReachedCallback);
444 scrollEdgeReachedEventHandler += value;
448 scrollEdgeReachedEventHandler -= value;
449 if (scrollEdgeReachedEventHandler == null && scrollEdgeReachedCallback != null)
451 scrollEdgeReachedSignal.Disconnect(scrollEdgeReachedCallback);
457 /// Event for the UrlChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
458 /// This signal is emitted when url is changed.<br />
460 [EditorBrowsable(EditorBrowsableState.Never)]
461 public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
465 if (urlChangedEventHandler == null)
467 urlChangedCallback = OnUrlChanged;
468 urlChangedSignal.Connect(urlChangedCallback);
470 urlChangedEventHandler += value;
474 urlChangedEventHandler -= value;
475 if (urlChangedEventHandler == null && urlChangedCallback != null)
477 urlChangedSignal.Disconnect(urlChangedCallback);
483 /// Event for the FormRepostDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
484 /// This signal is emitted when form repost policy would be decided.<br />
486 [EditorBrowsable(EditorBrowsableState.Never)]
487 public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
491 if (formRepostPolicyDecidedEventHandler == null)
493 formRepostPolicyDecidedCallback = OnFormRepostPolicyDecided;
494 formRepostPolicyDecidedSignal.Connect(formRepostPolicyDecidedCallback);
496 formRepostPolicyDecidedEventHandler += value;
500 formRepostPolicyDecidedEventHandler -= value;
501 if (formRepostPolicyDecidedEventHandler == null && formRepostPolicyDecidedCallback != null)
503 formRepostPolicyDecidedSignal.Disconnect(formRepostPolicyDecidedCallback);
509 /// Event for the FrameRendered signal which can be used to subscribe or unsubscribe the event handler.<br />
510 /// This signal is emitted when frame is rendered off-screen.<br />
512 [EditorBrowsable(EditorBrowsableState.Never)]
513 public event EventHandler<EventArgs> FrameRendered
517 if (frameRenderedEventHandler == null)
519 frameRenderedCallback = OnFrameRendered;
520 frameRenderedSignal.Connect(frameRenderedCallback);
522 frameRenderedEventHandler += value;
526 frameRenderedEventHandler -= value;
527 if (frameRenderedEventHandler == null && frameRenderedCallback != null)
529 frameRenderedSignal.Disconnect(frameRenderedCallback);
535 /// Event for the ResponsePolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
536 /// This signal is emitted when response policy would be decided.<br />
538 [EditorBrowsable(EditorBrowsableState.Never)]
539 public event EventHandler<WebViewResponsePolicyDecidedEventArgs> ResponsePolicyDecided
543 if (responsePolicyDecidedEventHandler == null)
545 responsePolicyDecidedCallback = OnResponsePolicyDecided;
546 responsePolicyDecidedSignal.Connect(responsePolicyDecidedCallback);
548 responsePolicyDecidedEventHandler += value;
552 responsePolicyDecidedEventHandler -= value;
553 if (responsePolicyDecidedEventHandler == null && responsePolicyDecidedCallback != null)
555 responsePolicyDecidedSignal.Disconnect(responsePolicyDecidedCallback);
561 /// Event for the CertificateConfirmed signal which can be used to subscribe or unsubscribe the event handler.<br />
562 /// This signal is emitted when certificate would be confirmed.<br />
564 [EditorBrowsable(EditorBrowsableState.Never)]
565 public event EventHandler<WebViewCertificateReceivedEventArgs> CertificateConfirmed
569 if (certificateConfirmedEventHandler == null)
571 certificateConfirmedCallback = OnCertificateConfirmed;
572 certificateConfirmedSignal.Connect(certificateConfirmedCallback);
574 certificateConfirmedEventHandler += value;
578 certificateConfirmedEventHandler -= value;
579 if (certificateConfirmedEventHandler == null && certificateConfirmedCallback != null)
581 certificateConfirmedSignal.Disconnect(certificateConfirmedCallback);
587 /// Event for the HttpRequestIntercepted signal which can be used to subscribe or unsubscribe the event handler.<br />
588 /// This signal is emitted when http request would be intercepted.<br />
590 [EditorBrowsable(EditorBrowsableState.Never)]
591 public event EventHandler<WebViewHttpRequestInterceptedEventArgs> HttpRequestIntercepted
595 if (httpRequestInterceptedEventHandler == null)
597 httpRequestInterceptedCallback = OnHttpRequestIntercepted;
598 httpRequestInterceptedSignal.Connect(httpRequestInterceptedCallback);
600 httpRequestInterceptedEventHandler += value;
604 httpRequestInterceptedEventHandler -= value;
605 if (httpRequestInterceptedEventHandler == null && httpRequestInterceptedCallback != null)
607 httpRequestInterceptedSignal.Disconnect(httpRequestInterceptedCallback);
613 /// Event for the SslCertificateChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
614 /// This signal is emitted when SSL certificate is changed.<br />
616 [EditorBrowsable(EditorBrowsableState.Never)]
617 public event EventHandler<WebViewCertificateReceivedEventArgs> SslCertificateChanged
621 if (sslCertificateChangedEventHandler == null)
623 sslCertificateChangedCallback = OnSslCertificateChanged;
624 sslCertificateChangedSignal.Connect(sslCertificateChangedCallback);
626 sslCertificateChangedEventHandler += value;
630 sslCertificateChangedEventHandler -= value;
631 if (sslCertificateChangedEventHandler == null && sslCertificateChangedCallback != null)
633 sslCertificateChangedSignal.Disconnect(sslCertificateChangedCallback);
639 /// Event for the HttpAuthRequested signal which can be used to subscribe or unsubscribe the event handler.<br />
640 /// This signal is emitted when http authentication is requested.<br />
642 [EditorBrowsable(EditorBrowsableState.Never)]
643 public event EventHandler<WebViewHttpAuthRequestedEventArgs> HttpAuthRequested
647 if (httpAuthRequestedEventHandler == null)
649 httpAuthRequestedCallback = OnHttpAuthRequested;
650 httpAuthRequestedSignal.Connect(httpAuthRequestedCallback);
652 httpAuthRequestedEventHandler += value;
656 httpAuthRequestedEventHandler -= value;
657 if (httpAuthRequestedEventHandler == null && httpAuthRequestedCallback != null)
659 httpAuthRequestedSignal.Disconnect(httpAuthRequestedCallback);
665 /// Event for the ConsoleMessageReceived signal which can be used to subscribe or unsubscribe the event handler.<br />
666 /// This signal is emitted when console message is received.<br />
668 [EditorBrowsable(EditorBrowsableState.Never)]
669 public event EventHandler<WebViewConsoleMessageReceivedEventArgs> ConsoleMessageReceived
673 if (consoleMessageReceivedEventHandler == null)
675 consoleMessageReceivedCallback = OnConsoleMessageReceived;
676 consoleMessageReceivedSignal.Connect(consoleMessageReceivedCallback);
678 consoleMessageReceivedEventHandler += value;
682 consoleMessageReceivedEventHandler -= value;
683 if (consoleMessageReceivedEventHandler == null && consoleMessageReceivedCallback != null)
685 consoleMessageReceivedSignal.Disconnect(consoleMessageReceivedCallback);
691 /// Event for the ContextMenuCustomized signal which can be used to subscribe or unsubscribe the event handler.<br />
692 /// This signal is emitted when context menu is customized.<br />
694 [EditorBrowsable(EditorBrowsableState.Never)]
695 public event EventHandler<WebViewContextMenuCustomizedEventArgs> ContextMenuCustomized
699 if (contextMenuCustomizedEventHandler == null)
701 contextMenuCustomizedCallback = OnContextMenuCustomized;
702 contextMenuCustomizedSignal.Connect(contextMenuCustomizedCallback);
704 contextMenuCustomizedEventHandler += value;
708 contextMenuCustomizedEventHandler -= value;
709 if (contextMenuCustomizedEventHandler == null && contextMenuCustomizedCallback != null)
711 contextMenuCustomizedSignal.Disconnect(contextMenuCustomizedCallback);
717 /// Event for the ContextMenuItemSelected signal which can be used to subscribe or unsubscribe the event handler.<br />
718 /// This signal is emitted when context menu item is selected.<br />
720 [EditorBrowsable(EditorBrowsableState.Never)]
721 public event EventHandler<WebViewContextMenuItemSelectedEventArgs> ContextMenuItemSelected
725 if (contextMenuItemSelectedEventHandler == null)
727 contextMenuItemSelectedCallback = OnContextMenuItemSelected;
728 contextMenuItemSelectedSignal.Connect(contextMenuItemSelectedCallback);
730 contextMenuItemSelectedEventHandler += value;
734 contextMenuItemSelectedEventHandler -= value;
735 if (contextMenuItemSelectedEventHandler == null && contextMenuItemSelectedCallback != null)
737 contextMenuItemSelectedSignal.Disconnect(contextMenuItemSelectedCallback);
743 /// Options for searching texts.
745 [EditorBrowsable(EditorBrowsableState.Never)]
746 public enum FindOption
751 [EditorBrowsable(EditorBrowsableState.Never)]
755 /// Case insensitive search
757 [EditorBrowsable(EditorBrowsableState.Never)]
758 CaseInsensitive = 1 << 0,
761 /// Search text only at the beginning of the words
763 [EditorBrowsable(EditorBrowsableState.Never)]
764 AtWordStart = 1 << 1,
767 /// Treat capital letters in the middle of words as word start
769 [EditorBrowsable(EditorBrowsableState.Never)]
770 TreatMediaCapitalAsWordStart = 1 << 2,
775 [EditorBrowsable(EditorBrowsableState.Never)]
779 /// If not present the search stops at the end of the document
781 [EditorBrowsable(EditorBrowsableState.Never)]
787 [EditorBrowsable(EditorBrowsableState.Never)]
788 ShowOverlay = 1 << 5,
793 [EditorBrowsable(EditorBrowsableState.Never)]
794 ShowFindIndiator = 1 << 6,
799 [EditorBrowsable(EditorBrowsableState.Never)]
800 ShowHighlight = 1 << 7,
804 /// Enumeration for mode of hit test.
806 [EditorBrowsable(EditorBrowsableState.Never)]
807 public enum HitTestMode
812 [EditorBrowsable(EditorBrowsableState.Never)]
816 /// Extra node data(tag name, node value, attribute infomation, etc).
818 [EditorBrowsable(EditorBrowsableState.Never)]
822 /// Extra image data(image data, image data length, image file name exteionsion, etc).
824 [EditorBrowsable(EditorBrowsableState.Never)]
830 [EditorBrowsable(EditorBrowsableState.Never)]
831 All = Default | NodeData | ImageData,
837 [EditorBrowsable(EditorBrowsableState.Never)]
838 public WebBackForwardList BackForwardList { get; }
843 [EditorBrowsable(EditorBrowsableState.Never)]
844 public WebContext Context { get; }
849 [EditorBrowsable(EditorBrowsableState.Never)]
850 public WebCookieManager CookieManager { get; }
855 [EditorBrowsable(EditorBrowsableState.Never)]
856 public WebSettings Settings { get; }
861 [EditorBrowsable(EditorBrowsableState.Never)]
866 return (string)GetValue(UrlProperty);
870 SetValue(UrlProperty, value);
871 NotifyPropertyChanged();
876 /// Deprecated. The cache model of the current WebView.
878 [EditorBrowsable(EditorBrowsableState.Never)]
879 public CacheModel CacheModel
883 return (CacheModel)Context.CacheModel;
887 Context.CacheModel = (WebContext.CacheModelType)value;
892 /// Deprecated. The cookie acceptance policy.
894 [EditorBrowsable(EditorBrowsableState.Never)]
895 public CookieAcceptPolicy CookieAcceptPolicy
899 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
903 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
908 /// The user agent string.
910 [EditorBrowsable(EditorBrowsableState.Never)]
911 public string UserAgent
915 return (string)GetValue(UserAgentProperty);
919 SetValue(UserAgentProperty, value);
920 NotifyPropertyChanged();
925 /// Deprecated. Whether JavaScript is enabled.
927 [EditorBrowsable(EditorBrowsableState.Never)]
928 public bool EnableJavaScript
932 return Settings.JavaScriptEnabled;
936 Settings.JavaScriptEnabled = value;
941 /// Deprecated. Whether images can be loaded automatically.
943 [EditorBrowsable(EditorBrowsableState.Never)]
944 public bool LoadImagesAutomatically
948 return Settings.AutomaticImageLoadingAllowed;
952 Settings.AutomaticImageLoadingAllowed = value;
957 /// The default text encoding name.<br />
958 /// e.g. "UTF-8"<br />
960 [EditorBrowsable(EditorBrowsableState.Never)]
961 public string DefaultTextEncodingName
965 return Settings.DefaultTextEncodingName;
969 Settings.DefaultTextEncodingName = value;
974 /// The default font size in pixel.
976 [EditorBrowsable(EditorBrowsableState.Never)]
977 public int DefaultFontSize
981 return Settings.DefaultFontSize;
985 Settings.DefaultFontSize = value;
990 /// The position of scroll.
992 [EditorBrowsable(EditorBrowsableState.Never)]
993 public Position ScrollPosition
997 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
998 return new Position(pv.X, pv.Y);
1004 Position pv = value;
1005 Vector2 vpv = new Vector2(pv.X, pv.Y);
1006 SetValue(ScrollPositionProperty, vpv);
1007 NotifyPropertyChanged();
1013 /// The size of scroll, read-only.
1015 [EditorBrowsable(EditorBrowsableState.Never)]
1016 public Size ScrollSize
1020 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
1021 return new Size(sv.Width, sv.Height);
1026 /// The size of content, read-only.
1028 [EditorBrowsable(EditorBrowsableState.Never)]
1029 public Size ContentSize
1033 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
1034 return new Size(sv.Width, sv.Height);
1039 /// Whether video hole is enabled or not.
1041 [EditorBrowsable(EditorBrowsableState.Never)]
1042 public bool VideoHoleEnabled
1046 return (bool)GetValue(VideoHoleEnabledProperty);
1050 SetValue(VideoHoleEnabledProperty, value);
1051 NotifyPropertyChanged();
1056 /// Whether mouse events are enabled or not.
1058 [EditorBrowsable(EditorBrowsableState.Never)]
1059 public bool MouseEventsEnabled
1063 return (bool)GetValue(MouseEventsEnabledProperty);
1067 SetValue(MouseEventsEnabledProperty, value);
1068 NotifyPropertyChanged();
1073 /// Whether key events are enabled or not.
1075 [EditorBrowsable(EditorBrowsableState.Never)]
1076 public bool KeyEventsEnabled
1080 return (bool)GetValue(KeyEventsEnabledProperty);
1084 SetValue(KeyEventsEnabledProperty, value);
1085 NotifyPropertyChanged();
1090 /// Background color of web page.
1092 [EditorBrowsable(EditorBrowsableState.Never)]
1093 public Color ContentBackgroundColor
1097 return (Color)GetValue(ContentBackgroundColorProperty);
1101 SetValue(ContentBackgroundColorProperty, value);
1102 NotifyPropertyChanged();
1107 /// Whether tiles are cleared or not when hidden.
1109 [EditorBrowsable(EditorBrowsableState.Never)]
1110 public bool TilesClearedWhenHidden
1114 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1118 SetValue(TilesClearedWhenHiddenProperty, value);
1119 NotifyPropertyChanged();
1124 /// Multiplier of cover area of tile when web page is rendered.
1126 [EditorBrowsable(EditorBrowsableState.Never)]
1127 public float TileCoverAreaMultiplier
1131 return (float)GetValue(TileCoverAreaMultiplierProperty);
1135 SetValue(TileCoverAreaMultiplierProperty, value);
1136 NotifyPropertyChanged();
1141 /// Whether cursor is enabled or not by client.
1143 [EditorBrowsable(EditorBrowsableState.Never)]
1144 public bool CursorEnabledByClient
1148 return (bool)GetValue(CursorEnabledByClientProperty);
1152 SetValue(CursorEnabledByClientProperty, value);
1153 NotifyPropertyChanged();
1158 /// Gets selected text in web page.
1160 [EditorBrowsable(EditorBrowsableState.Never)]
1161 public string SelectedText
1165 return (string)GetValue(SelectedTextProperty);
1170 /// Gets title of web page.
1172 [EditorBrowsable(EditorBrowsableState.Never)]
1177 return (string)GetValue(TitleProperty);
1182 /// Gets favicon of web page.
1184 [EditorBrowsable(EditorBrowsableState.Never)]
1185 public ImageView Favicon
1189 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1190 if (imageView == IntPtr.Zero)
1192 return new ImageView(imageView, false);
1197 /// Zoom factor of web page.
1199 [EditorBrowsable(EditorBrowsableState.Never)]
1200 public float PageZoomFactor
1204 return (float)GetValue(PageZoomFactorProperty);
1208 SetValue(PageZoomFactorProperty, value);
1209 NotifyPropertyChanged();
1214 /// Zoom factor of text in web page.
1216 [EditorBrowsable(EditorBrowsableState.Never)]
1217 public float TextZoomFactor
1221 return (float)GetValue(TextZoomFactorProperty);
1225 SetValue(TextZoomFactorProperty, value);
1226 NotifyPropertyChanged();
1231 /// Gets percentage of loading progress.
1233 [EditorBrowsable(EditorBrowsableState.Never)]
1234 public float LoadProgressPercentage
1238 return (float)GetValue(LoadProgressPercentageProperty);
1242 internal static new class Property
1244 internal static readonly int Url = Interop.WebView.UrlGet();
1245 internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
1246 internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
1247 internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
1248 internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
1249 internal static readonly int Title = Interop.WebView.TitleGet();
1250 internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
1251 internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
1252 internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
1253 internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
1254 internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
1255 internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
1256 internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
1257 internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
1258 internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
1259 internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
1260 internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
1263 private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1265 var webview = (WebView)bindable;
1266 if (newValue != null)
1268 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1271 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1273 var webview = (WebView)bindable;
1275 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1279 private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1281 var webview = (WebView)bindable;
1282 if (newValue != null)
1284 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1287 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1289 var webview = (WebView)bindable;
1291 Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1295 private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1297 var webview = (WebView)bindable;
1298 if (newValue != null)
1300 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1303 defaultValueCreator: (bindable) =>
1305 var webview = (WebView)bindable;
1306 Vector2 temp = new Vector2(0.0f, 0.0f);
1307 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
1311 private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1313 var webview = (WebView)bindable;
1314 Vector2 temp = new Vector2(0.0f, 0.0f);
1315 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
1319 private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1321 var webview = (WebView)bindable;
1322 Vector2 temp = new Vector2(0.0f, 0.0f);
1323 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
1327 private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1329 var webview = (WebView)bindable;
1331 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1335 private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1337 var webview = (WebView)bindable;
1338 if (newValue != null)
1340 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1343 defaultValueCreator: (bindable) =>
1345 var webview = (WebView)bindable;
1347 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1351 private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1353 var webview = (WebView)bindable;
1354 if (newValue != null)
1356 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1359 defaultValueCreator: (bindable) =>
1361 var webview = (WebView)bindable;
1363 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1367 private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1369 var webview = (WebView)bindable;
1370 if (newValue != null)
1372 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1375 defaultValueCreator: (bindable) =>
1377 var webview = (WebView)bindable;
1379 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1383 private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1385 var webview = (WebView)bindable;
1386 if (newValue != null)
1388 webview.contentBackgroundColor = (Color)newValue;
1389 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1392 defaultValueCreator: (bindable) =>
1394 var webview = (WebView)bindable;
1395 return webview.contentBackgroundColor;
1398 private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1400 var webview = (WebView)bindable;
1401 if (newValue != null)
1403 webview.tilesClearedWhenHidden = (bool)newValue;
1404 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1407 defaultValueCreator: (bindable) =>
1409 var webview = (WebView)bindable;
1410 return webview.tilesClearedWhenHidden;
1413 private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1415 var webview = (WebView)bindable;
1416 if (newValue != null)
1418 webview.tileCoverAreaMultiplier = (float)newValue;
1419 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1422 defaultValueCreator: (bindable) =>
1424 var webview = (WebView)bindable;
1425 return webview.tileCoverAreaMultiplier;
1428 private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1430 var webview = (WebView)bindable;
1431 if (newValue != null)
1433 webview.cursorEnabledByClient = (bool)newValue;
1434 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1437 defaultValueCreator: (bindable) =>
1439 var webview = (WebView)bindable;
1440 return webview.cursorEnabledByClient;
1443 private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1445 var webview = (WebView)bindable;
1447 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1451 private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1453 var webview = (WebView)bindable;
1454 if (newValue != null)
1456 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1459 defaultValueCreator: (bindable) =>
1461 var webview = (WebView)bindable;
1463 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1467 private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1469 var webview = (WebView)bindable;
1470 if (newValue != null)
1472 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1475 defaultValueCreator: (bindable) =>
1477 var webview = (WebView)bindable;
1479 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1483 private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1485 var webview = (WebView)bindable;
1487 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1491 // For rooting handlers
1492 internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1496 /// <param name="url">The path of Web</param>
1498 [EditorBrowsable(EditorBrowsableState.Never)]
1499 public void LoadUrl(string url)
1501 Interop.WebView.LoadUrl(SwigCPtr, url);
1502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1506 /// Deprecated. Loads a html by string.
1507 /// <param name="data">The data of Web</param>
1509 [EditorBrowsable(EditorBrowsableState.Never)]
1510 public void LoadHTMLString(string data)
1512 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1513 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1517 /// Loads a html by string.
1518 /// <param name="data">The data of Web</param>
1520 [EditorBrowsable(EditorBrowsableState.Never)]
1521 public void LoadHtmlString(string data)
1523 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1528 /// Loads the specified html as the content of the view to override current history entry.
1529 /// <param name="html">The html to be loaded</param>
1530 /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1531 /// <param name="unreachableUri">URL that could not be reached</param>
1533 [EditorBrowsable(EditorBrowsableState.Never)]
1534 public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1536 bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1542 /// Requests to load the given contents by MIME type.
1543 /// <param name="contents">The contents to be loaded</param>
1544 /// <param name="contentSize">The size of contents (in bytes)</param>
1545 /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1546 /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1547 /// <param name="baseUri">The base URI to use for relative resources</param>
1549 [EditorBrowsable(EditorBrowsableState.Never)]
1550 public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1552 bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1553 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1560 [EditorBrowsable(EditorBrowsableState.Never)]
1561 public void Reload()
1563 Interop.WebView.Reload(SwigCPtr);
1564 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1568 /// Reloads the current page's document without cache
1570 [EditorBrowsable(EditorBrowsableState.Never)]
1571 public bool ReloadWithoutCache()
1573 bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1579 /// Stops loading the Web
1581 [EditorBrowsable(EditorBrowsableState.Never)]
1582 public void StopLoading()
1584 Interop.WebView.StopLoading(SwigCPtr);
1585 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1589 /// Suspends the operation.
1591 [EditorBrowsable(EditorBrowsableState.Never)]
1592 public void Suspend()
1594 Interop.WebView.Suspend(SwigCPtr);
1595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1599 /// Resumes the operation after calling Suspend()
1601 [EditorBrowsable(EditorBrowsableState.Never)]
1602 public void Resume()
1604 Interop.WebView.Resume(SwigCPtr);
1605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1609 /// Suspends all network loading.
1611 [EditorBrowsable(EditorBrowsableState.Never)]
1612 public void SuspendNetworkLoading()
1614 Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1615 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1619 /// Resumes all network loading.
1621 [EditorBrowsable(EditorBrowsableState.Never)]
1622 public void ResumeNetworkLoading()
1624 Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1629 /// Adds custom header.
1630 /// <param name="name">The name of custom header</param>
1631 /// <param name="value">The value of custom header</param>
1633 [EditorBrowsable(EditorBrowsableState.Never)]
1634 public bool AddCustomHeader(string name, string value)
1636 bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1637 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1642 /// Removes custom header.
1643 /// <param name="name">The name of custom header</param>
1645 [EditorBrowsable(EditorBrowsableState.Never)]
1646 public bool RemoveCustomHeader(string name)
1648 bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1649 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1654 /// Starts the inspector server.
1655 /// <param name="port">The port number</param>
1657 [EditorBrowsable(EditorBrowsableState.Never)]
1658 public uint StartInspectorServer(uint port)
1660 uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1661 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1666 /// Stops the inspector server.
1668 [EditorBrowsable(EditorBrowsableState.Never)]
1669 public bool StopInspectorServer()
1671 bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1677 /// Scrolls page of web view by deltaX and detlaY.
1678 /// <param name="deltaX">The deltaX of scroll</param>
1679 /// <param name="deltaY">The deltaY of scroll</param>
1681 [EditorBrowsable(EditorBrowsableState.Never)]
1682 public void ScrollBy(int deltaX, int deltaY)
1684 Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1685 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1689 /// Scrolls edge of web view by deltaX and deltaY.
1690 /// <param name="deltaX">The deltaX of scroll</param>
1691 /// <param name="deltaY">The deltaY of scroll</param>
1693 [EditorBrowsable(EditorBrowsableState.Never)]
1694 public bool ScrollEdgeBy(int deltaX, int deltaY)
1696 bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1697 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1702 /// Goes to the back
1704 [EditorBrowsable(EditorBrowsableState.Never)]
1705 public void GoBack()
1707 Interop.WebView.GoBack(SwigCPtr);
1708 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1712 /// Goes to the forward
1714 [EditorBrowsable(EditorBrowsableState.Never)]
1715 public void GoForward()
1717 Interop.WebView.GoForward(SwigCPtr);
1718 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1722 /// Returns whether backward is possible.
1723 /// <returns>True if backward is possible, false otherwise</returns>
1725 [EditorBrowsable(EditorBrowsableState.Never)]
1726 public bool CanGoBack()
1728 bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1729 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1734 /// Returns whether forward is possible.
1735 /// <returns>True if forward is possible, false otherwise</returns>
1737 [EditorBrowsable(EditorBrowsableState.Never)]
1738 public bool CanGoForward()
1740 bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1746 /// Evaluates JavaScript code represented as a string.
1747 /// <param name="script">The JavaScript code</param>
1749 [EditorBrowsable(EditorBrowsableState.Never)]
1750 public void EvaluateJavaScript(string script)
1752 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1757 /// Add a message handler into the WebView.
1758 /// <param name="objectName">The name of exposed object</param>
1759 /// <param name="handler">The callback function</param>
1761 [EditorBrowsable(EditorBrowsableState.Never)]
1762 public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1764 if (handlerRootMap.ContainsKey(objectName))
1769 handlerRootMap.Add(objectName, handler);
1771 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1772 Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1778 /// Add a message handler into the WebView.
1779 /// <param name="callback">The callback function</param>
1781 [EditorBrowsable(EditorBrowsableState.Never)]
1782 public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1784 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1785 Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1787 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1791 /// Reply for alert popup.
1793 [EditorBrowsable(EditorBrowsableState.Never)]
1794 public void JavaScriptAlertReply()
1796 Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1797 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1801 /// Add a message handler into the WebView.
1802 /// <param name="callback">The callback function</param>
1804 [EditorBrowsable(EditorBrowsableState.Never)]
1805 public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1807 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1808 Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1810 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1814 /// Reply for confirm popup.
1815 /// <param name="confirmed">confirmed or not</param>
1817 [EditorBrowsable(EditorBrowsableState.Never)]
1818 public void JavaScriptConfirmReply(bool confirmed)
1820 Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1825 /// Add a message handler into the WebView.
1826 /// <param name="callback">The callback function</param>
1828 [EditorBrowsable(EditorBrowsableState.Never)]
1829 public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1831 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1832 Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1834 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1838 /// Reply for prompt popup.
1839 /// <param name="result">text in prompt input field.</param>
1841 [EditorBrowsable(EditorBrowsableState.Never)]
1842 public void JavaScriptPromptReply(string result)
1844 Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
1845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1849 /// Clears title resources of current WebView.
1851 [EditorBrowsable(EditorBrowsableState.Never)]
1852 public void ClearAllTilesResources()
1854 Interop.WebView.ClearAllTilesResources(SwigCPtr);
1855 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1859 /// Clears the history of current WebView.
1861 [EditorBrowsable(EditorBrowsableState.Never)]
1862 public void ClearHistory()
1864 Interop.WebView.ClearHistory(SwigCPtr);
1865 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1869 /// Scales the current page, centered at the given point.
1870 /// <param name="scaleFactor">The new factor to be scaled</param>
1871 /// <param name="point">The center coordinate</param>
1873 [EditorBrowsable(EditorBrowsableState.Never)]
1874 public void SetScaleFactor(float scaleFactor, Vector2 point)
1876 Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
1877 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1881 /// Gets the current scale factor of the page.
1883 [EditorBrowsable(EditorBrowsableState.Never)]
1884 public float GetScaleFactor()
1886 float result = Interop.WebView.GetScaleFactor(SwigCPtr);
1887 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1892 /// Requests to activate/deactivate the accessibility usage set by web app.
1893 /// <param name="activated">The new factor to be scaled</param>
1895 [EditorBrowsable(EditorBrowsableState.Never)]
1896 public void ActivateAccessibility(bool activated)
1898 Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
1899 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1903 /// Searches and highlights the given string in the document.
1904 /// <param name="text">The text to be searched</param>
1905 /// <param name="options">The options to search</param>
1906 /// <param name="maxMatchCount">The maximum match count to search</param>
1908 [EditorBrowsable(EditorBrowsableState.Never)]
1909 public bool HighlightText(string text, FindOption options, uint maxMatchCount)
1911 bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
1912 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1917 /// Adds dynamic certificate path.
1918 /// <param name="host">Host that required client authentication</param>
1919 /// <param name="certPath">The file path stored certificate</param>
1921 [EditorBrowsable(EditorBrowsableState.Never)]
1922 public void AddDynamicCertificatePath(string host, string certPath)
1924 Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
1925 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1929 /// Get snapshot of the specified viewArea of page.
1930 /// <param name="viewArea">Host that required client authentication</param>
1931 /// <param name="scaleFactor">The file path stored certificate</param>
1933 [EditorBrowsable(EditorBrowsableState.Never)]
1934 public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
1936 IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
1937 ImageView imageView = new ImageView(image, true);
1938 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1943 /// Get snapshot of the specified viewArea of page.
1944 /// <param name="viewArea">Host that required client authentication</param>
1945 /// <param name="scaleFactor">The file path stored certificate</param>
1946 /// <param name="callback">The callback for getting screen shot</param>
1948 [EditorBrowsable(EditorBrowsableState.Never)]
1949 public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
1951 screenshotAcquiredCallback = callback;
1952 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(screenshotAcquiredProxyCallback);
1953 bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
1954 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1959 /// Asynchronous requests to check if there is a video playing in the given view.
1960 /// <param name="callback">The callback called after checking if video is playing or not</param>
1962 [EditorBrowsable(EditorBrowsableState.Never)]
1963 public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
1965 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1966 bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
1967 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1972 /// Registers callback which will be called upon geolocation permission request.
1973 /// <param name="callback">The callback for requesting geolocation permission</param>
1975 [EditorBrowsable(EditorBrowsableState.Never)]
1976 public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
1978 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1979 Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
1980 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1984 /// Does hit test synchronously.
1985 /// <param name="x">the horizontal position to query</param>
1986 /// <param name="y">the vertical position to query</param>
1987 /// <param name="mode">the mode of hit test</param>
1989 [EditorBrowsable(EditorBrowsableState.Never)]
1990 public WebHitTestResult HitTest(int x, int y, HitTestMode mode)
1992 System.IntPtr result = Interop.WebView.CreateHitTest(SwigCPtr, x, y, (int)mode);
1993 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1994 return new WebHitTestResult(result, true);
1998 /// Does hit test asynchronously.
1999 /// <param name="x">the horizontal position to query</param>
2000 /// <param name="y">the vertical position to query</param>
2001 /// <param name="mode">the mode of hit test</param>
2002 /// <param name="callback">the callback that is called after hit test is finished.</param>
2004 [EditorBrowsable(EditorBrowsableState.Never)]
2005 public bool HitTestAsynchronously(int x, int y, HitTestMode mode, HitTestFinishedCallback callback)
2007 hitTestFinishedCallback = callback;
2008 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(hitTestFinishedProxyCallback);
2009 bool result = Interop.WebView.CreateHitTestAsynchronously(SwigCPtr, x, y, (int)mode, new HandleRef(this, ip));
2010 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2015 /// Deprecated. Clears the cache of current WebView.
2017 [EditorBrowsable(EditorBrowsableState.Never)]
2018 public void ClearCache()
2020 Context.ClearCache();
2024 /// Deprecated. Clears all the cookies of current WebView.
2026 [EditorBrowsable(EditorBrowsableState.Never)]
2027 public void ClearCookies()
2029 CookieManager.ClearCookies();
2032 internal static WebView DownCast(BaseHandle handle)
2034 WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2035 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2039 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebView obj)
2041 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
2044 internal WebView Assign(WebView webView)
2046 WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2047 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2051 private void OnPageLoadStarted(IntPtr data, string pageUrl)
2053 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2055 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
2056 e.PageUrl = pageUrl;
2058 pageLoadStartedEventHandler?.Invoke(this, e);
2061 private void OnPageLoading(IntPtr data, string pageUrl)
2063 pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2066 private void OnPageLoadFinished(IntPtr data, string pageUrl)
2068 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2070 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
2071 e.PageUrl = pageUrl;
2073 pageLoadFinishedEventHandler?.Invoke(this, e);
2076 private void OnPageLoadError(IntPtr data, IntPtr error)
2078 pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, false)));
2081 private void OnScrollEdgeReached(IntPtr data, int edge)
2083 scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2086 private void OnUrlChanged(IntPtr data, string pageUrl)
2088 urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2091 private void OnFormRepostPolicyDecided(IntPtr data, IntPtr decision)
2093 formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, false)));
2096 private void OnFrameRendered(IntPtr data)
2098 frameRenderedEventHandler?.Invoke(this, new EventArgs());
2101 private void OnScreenshotAcquired(IntPtr data)
2103 ImageView image = new ImageView(data, true);
2104 screenshotAcquiredCallback?.Invoke(image);
2108 private void OnResponsePolicyDecided(IntPtr data, IntPtr maker)
2110 responsePolicyDecidedEventHandler?.Invoke(this, new WebViewResponsePolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, false)));
2113 private void OnCertificateConfirmed(IntPtr data, IntPtr certificate)
2115 certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, false)));
2118 private void OnSslCertificateChanged(IntPtr data, IntPtr certificate)
2120 sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, false)));
2123 private void OnHttpAuthRequested(IntPtr data, IntPtr handler)
2125 httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, false)));
2128 private void OnHttpRequestIntercepted(IntPtr data, IntPtr interceptor)
2130 httpRequestInterceptedEventHandler?.Invoke(this, new WebViewHttpRequestInterceptedEventArgs(new WebHttpRequestInterceptor(interceptor, false)));
2133 private void OnConsoleMessageReceived(IntPtr data, IntPtr message)
2135 consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, false)));
2138 private void OnContextMenuCustomized(IntPtr data, IntPtr menu)
2140 contextMenuCustomizedEventHandler?.Invoke(this, new WebViewContextMenuCustomizedEventArgs(new WebContextMenu(menu, false)));
2143 private void OnContextMenuItemSelected(IntPtr data, IntPtr item)
2145 contextMenuItemSelectedEventHandler?.Invoke(this, new WebViewContextMenuItemSelectedEventArgs(new WebContextMenuItem(item, false)));
2148 private void OnHitTestFinished(IntPtr test)
2150 WebHitTestResult hitTest = new WebHitTestResult(test, true);
2151 hitTestFinishedCallback?.Invoke(hitTest);