2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using System.Runtime.InteropServices;
22 using Tizen.NUI.BaseComponents;
23 using Tizen.NUI.Binding;
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 public class WebView : View
33 private Color contentBackgroundColor;
34 private bool tilesClearedWhenHidden;
35 private float tileCoverAreaMultiplier;
36 private bool cursorEnabledByClient;
38 private readonly WebViewPageLoadSignal pageLoadStartedSignal;
39 private EventHandler<WebViewPageLoadEventArgs> pageLoadStartedEventHandler;
40 private WebViewPageLoadCallbackDelegate pageLoadStartedCallback;
42 private readonly WebViewPageLoadSignal pageLoadingSignal;
43 private EventHandler<WebViewPageLoadEventArgs> pageLoadingEventHandler;
44 private WebViewPageLoadCallbackDelegate pageLoadingCallback;
46 private readonly WebViewPageLoadSignal pageLoadFinishedSignal;
47 private EventHandler<WebViewPageLoadEventArgs> pageLoadFinishedEventHandler;
48 private WebViewPageLoadCallbackDelegate pageLoadFinishedCallback;
50 private readonly WebViewPageLoadErrorSignal pageLoadErrorSignal;
51 private EventHandler<WebViewPageLoadErrorEventArgs> pageLoadErrorEventHandler;
52 private WebViewPageLoadErrorCallbackDelegate pageLoadErrorCallback;
54 private readonly WebViewScrollEdgeReachedSignal scrollEdgeReachedSignal;
55 private EventHandler<WebViewScrollEdgeReachedEventArgs> scrollEdgeReachedEventHandler;
56 private WebViewScrollEdgeReachedCallbackDelegate scrollEdgeReachedCallback;
58 private readonly WebViewUrlChangedSignal urlChangedSignal;
59 private EventHandler<WebViewUrlChangedEventArgs> urlChangedEventHandler;
60 private WebViewUrlChangedCallbackDelegate urlChangedCallback;
62 private readonly WebViewFormRepostPolicyDecidedSignal formRepostPolicyDecidedSignal;
63 private EventHandler<WebViewFormRepostPolicyDecidedEventArgs> formRepostPolicyDecidedEventHandler;
64 private WebViewFormRepostPolicyDecidedCallbackDelegate formRepostPolicyDecidedCallback;
66 private readonly WebViewFrameRenderedSignal frameRenderedSignal;
67 private EventHandler<EventArgs> frameRenderedEventHandler;
68 private WebViewFrameRenderedCallbackDelegate frameRenderedCallback;
70 private ScreenshotAcquiredCallback screenshotAcquiredCallback;
71 private readonly WebViewScreenshotAcquiredProxyCallback screenshotAcquiredProxyCallback;
73 private HitTestFinishedCallback hitTestFinishedCallback;
74 private readonly WebViewHitTestFinishedProxyCallback hitTestFinishedProxyCallback;
76 private readonly WebViewResponsePolicyDecidedSignal responsePolicyDecidedSignal;
77 private EventHandler<WebViewResponsePolicyDecidedEventArgs> responsePolicyDecidedEventHandler;
78 private WebViewResponsePolicyDecidedCallbackDelegate responsePolicyDecidedCallback;
80 private readonly WebViewCertificateReceivedSignal certificateConfirmedSignal;
81 private EventHandler<WebViewCertificateReceivedEventArgs> certificateConfirmedEventHandler;
82 private WebViewCertificateReceivedCallbackDelegate certificateConfirmedCallback;
84 private readonly WebViewCertificateReceivedSignal sslCertificateChangedSignal;
85 private EventHandler<WebViewCertificateReceivedEventArgs> sslCertificateChangedEventHandler;
86 private WebViewCertificateReceivedCallbackDelegate sslCertificateChangedCallback;
88 private readonly WebViewHttpAuthRequestedSignal httpAuthRequestedSignal;
89 private EventHandler<WebViewHttpAuthRequestedEventArgs> httpAuthRequestedEventHandler;
90 private WebViewHttpAuthRequestedCallbackDelegate httpAuthRequestedCallback;
92 private readonly WebViewHttpRequestInterceptedSignal httpRequestInterceptedSignal;
93 private EventHandler<WebViewHttpRequestInterceptedEventArgs> httpRequestInterceptedEventHandler;
94 private WebViewHttpRequestInterceptedCallbackDelegate httpRequestInterceptedCallback;
96 private readonly WebViewConsoleMessageReceivedSignal consoleMessageReceivedSignal;
97 private EventHandler<WebViewConsoleMessageReceivedEventArgs> consoleMessageReceivedEventHandler;
98 private WebViewConsoleMessageReceivedCallbackDelegate consoleMessageReceivedCallback;
100 private readonly WebViewContextMenuCustomizedSignal contextMenuCustomizedSignal;
101 private EventHandler<WebViewContextMenuCustomizedEventArgs> contextMenuCustomizedEventHandler;
102 private WebViewContextMenuCustomizedCallbackDelegate contextMenuCustomizedCallback;
104 private readonly WebViewContextMenuItemSelectedSignal contextMenuItemSelectedSignal;
105 private EventHandler<WebViewContextMenuItemSelectedEventArgs> contextMenuItemSelectedEventHandler;
106 private WebViewContextMenuItemSelectedCallbackDelegate contextMenuItemSelectedCallback;
109 /// Creates a WebView.
111 [EditorBrowsable(EditorBrowsableState.Never)]
112 public WebView() : this(Interop.WebView.New(), true)
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 /// Creates a WebView with local language and time zone.
119 /// <param name="locale">The locale language of Web</param>
120 /// <param name="timezoneId">The time zone Id of Web</param>
122 [EditorBrowsable(EditorBrowsableState.Never)]
123 public WebView(string locale, string timezoneId) : this(Interop.WebView.New2(locale, timezoneId), true)
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 /// Creates a WebView with an args list.
130 /// <param name="args">args array. The first value of array must be program's name.</param>
132 [EditorBrowsable(EditorBrowsableState.Never)]
133 public WebView(string[] args) : this(Interop.WebView.New3(args?.Length ?? 0, args), true)
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// Copy constructor.
140 /// <param name="webView">WebView to copy. The copied WebView will point at the same implementation</param>
142 [EditorBrowsable(EditorBrowsableState.Never)]
143 public WebView(WebView webView) : this(Interop.WebView.NewWebView(WebView.getCPtr(webView)), true)
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WebView.Upcast(cPtr), cMemoryOwn)
150 pageLoadStartedSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadStarted(SwigCPtr));
151 pageLoadingSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadInProgress(SwigCPtr));
152 pageLoadFinishedSignal = new WebViewPageLoadSignal(Interop.WebView.NewWebViewPageLoadSignalPageLoadFinished(SwigCPtr));
153 pageLoadErrorSignal = new WebViewPageLoadErrorSignal(Interop.WebView.NewWebViewPageLoadErrorSignalPageLoadError(SwigCPtr));
154 scrollEdgeReachedSignal = new WebViewScrollEdgeReachedSignal(Interop.WebView.NewWebViewScrollEdgeReachedSignalScrollEdgeReached(SwigCPtr));
155 urlChangedSignal = new WebViewUrlChangedSignal(Interop.WebView.NewWebViewUrlChangedSignalUrlChanged(SwigCPtr));
156 formRepostPolicyDecidedSignal = new WebViewFormRepostPolicyDecidedSignal(Interop.WebView.NewWebViewFormRepostDecisionSignalFormRepostDecision(SwigCPtr));
157 frameRenderedSignal = new WebViewFrameRenderedSignal(Interop.WebView.WebViewFrameRenderedSignalFrameRenderedGet(SwigCPtr));
158 responsePolicyDecidedSignal = new WebViewResponsePolicyDecidedSignal(Interop.WebView.NewWebViewResponsePolicyDecisionSignalPolicyDecision(SwigCPtr));
159 certificateConfirmedSignal = new WebViewCertificateReceivedSignal(Interop.WebView.NewWebViewCertificateSignalCertificateConfirm(SwigCPtr));
160 sslCertificateChangedSignal = new WebViewCertificateReceivedSignal(Interop.WebView.NewWebViewCertificateSignalSslCertificateChanged(SwigCPtr));
161 httpAuthRequestedSignal = new WebViewHttpAuthRequestedSignal(Interop.WebView.NewWebViewHttpAuthHandlerSignalHttpAuthHandler(SwigCPtr));
162 httpRequestInterceptedSignal = new WebViewHttpRequestInterceptedSignal(Interop.WebView.NewWebViewRequestInterceptorSignalRequestInterceptor(SwigCPtr));
163 consoleMessageReceivedSignal = new WebViewConsoleMessageReceivedSignal(Interop.WebView.NewWebViewConsoleMessageSignalConsoleMessage(SwigCPtr));
164 contextMenuCustomizedSignal = new WebViewContextMenuCustomizedSignal(Interop.WebView.NewWebViewContextMenuCustomizedSignalContextMenuCustomized(SwigCPtr));
165 contextMenuItemSelectedSignal = new WebViewContextMenuItemSelectedSignal(Interop.WebView.NewWebViewContextMenuItemSelectedSignalContextMenuItemSelected(SwigCPtr));
167 screenshotAcquiredProxyCallback = OnScreenshotAcquired;
168 hitTestFinishedProxyCallback = OnHitTestFinished;
170 BackForwardList = new WebBackForwardList(Interop.WebView.GetWebBackForwardList(SwigCPtr), false);
171 Context = new WebContext(Interop.WebView.GetWebContext(SwigCPtr), false);
172 CookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(SwigCPtr), false);
173 Settings = new WebSettings(Interop.WebView.GetWebSettings(SwigCPtr), false);
177 /// Dispose for IDisposable pattern
179 [EditorBrowsable(EditorBrowsableState.Never)]
180 protected override void Dispose(DisposeTypes type)
187 if (type == DisposeTypes.Explicit)
190 //Release your own managed resources here.
191 //You should release all of your own disposable objects here.
192 pageLoadStartedSignal.Dispose();
193 pageLoadingSignal.Dispose();
194 pageLoadFinishedSignal.Dispose();
195 pageLoadErrorSignal.Dispose();
196 scrollEdgeReachedSignal.Dispose();
197 urlChangedSignal.Dispose();
198 formRepostPolicyDecidedSignal.Dispose();
199 frameRenderedSignal.Dispose();
200 responsePolicyDecidedSignal.Dispose();
201 certificateConfirmedSignal.Dispose();
202 sslCertificateChangedSignal.Dispose();
203 httpAuthRequestedSignal.Dispose();
204 httpRequestInterceptedSignal.Dispose();
205 consoleMessageReceivedSignal.Dispose();
206 contextMenuCustomizedSignal.Dispose();
207 contextMenuItemSelectedSignal.Dispose();
209 BackForwardList.Dispose();
211 CookieManager.Dispose();
218 /// This will not be public opened.
219 /// <param name="swigCPtr"></param>
220 [EditorBrowsable(EditorBrowsableState.Never)]
221 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
223 Interop.WebView.DeleteWebView(swigCPtr);
227 /// The callback function that is invoked when the message is received from the script.
229 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public delegate void JavaScriptMessageHandler(string message);
234 /// The callback function that is invoked when the message is received from the script.
236 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
237 [EditorBrowsable(EditorBrowsableState.Never)]
238 public delegate void JavaScriptAlertCallback(string message);
241 /// The callback function that is invoked when the message is received from the script.
243 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
244 [EditorBrowsable(EditorBrowsableState.Never)]
245 public delegate void JavaScriptConfirmCallback(string message);
248 /// The callback function that is invoked when the message is received from the script.
250 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
251 [EditorBrowsable(EditorBrowsableState.Never)]
252 public delegate void JavaScriptPromptCallback(string message1, string message2);
255 /// The callback function that is invoked when screen shot is acquired asynchronously.
257 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
258 [EditorBrowsable(EditorBrowsableState.Never)]
259 public delegate void ScreenshotAcquiredCallback(ImageView image);
262 /// The callback function that is invoked when video playing is checked asynchronously.
264 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
265 [EditorBrowsable(EditorBrowsableState.Never)]
266 public delegate void VideoPlayingCallback(bool isPlaying);
269 /// The callback function that is invoked when geolocation permission is requested.
271 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
272 [EditorBrowsable(EditorBrowsableState.Never)]
273 public delegate void GeolocationPermissionCallback(string host, string protocol);
276 /// The callback function that is invoked when hit test is finished.
278 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
279 [EditorBrowsable(EditorBrowsableState.Never)]
280 public delegate void HitTestFinishedCallback(WebHitTestResult test);
282 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
283 private delegate void WebViewPageLoadCallbackDelegate(IntPtr data, string pageUrl);
285 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
286 private delegate void WebViewPageLoadErrorCallbackDelegate(IntPtr data, IntPtr error);
288 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
289 private delegate void WebViewScrollEdgeReachedCallbackDelegate(IntPtr data, int edge);
291 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
292 private delegate void WebViewUrlChangedCallbackDelegate(IntPtr data, string pageUrl);
294 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
295 private delegate void WebViewFormRepostPolicyDecidedCallbackDelegate(IntPtr data, IntPtr maker);
297 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
298 private delegate void WebViewFrameRenderedCallbackDelegate(IntPtr data);
300 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
301 private delegate void WebViewScreenshotAcquiredProxyCallback(IntPtr data);
303 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
304 private delegate void WebViewHitTestFinishedProxyCallback(IntPtr data);
306 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
307 private delegate void WebViewResponsePolicyDecidedCallbackDelegate(IntPtr data, IntPtr maker);
309 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
310 private delegate void WebViewCertificateReceivedCallbackDelegate(IntPtr data, IntPtr certificate);
312 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
313 private delegate void WebViewHttpAuthRequestedCallbackDelegate(IntPtr data, IntPtr handler);
315 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
316 private delegate void WebViewHttpRequestInterceptedCallbackDelegate(IntPtr data, IntPtr interceptor);
318 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
319 private delegate void WebViewConsoleMessageReceivedCallbackDelegate(IntPtr data, IntPtr message);
321 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
322 private delegate void WebViewContextMenuCustomizedCallbackDelegate(IntPtr data, IntPtr menu);
324 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
325 private delegate void WebViewContextMenuItemSelectedCallbackDelegate(IntPtr data, IntPtr item);
328 /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.<br />
329 /// This signal is emitted when page loading has started.<br />
331 [EditorBrowsable(EditorBrowsableState.Never)]
332 public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
336 if (pageLoadStartedEventHandler == null)
338 pageLoadStartedCallback = (OnPageLoadStarted);
339 pageLoadStartedSignal.Connect(pageLoadStartedCallback);
341 pageLoadStartedEventHandler += value;
345 pageLoadStartedEventHandler -= value;
346 if (pageLoadStartedEventHandler == null && pageLoadStartedCallback != null)
348 pageLoadStartedSignal.Disconnect(pageLoadStartedCallback);
354 /// Event for the PageLoading signal which can be used to subscribe or unsubscribe the event handler.<br />
355 /// This signal is emitted when page loading is in progress.<br />
357 [EditorBrowsable(EditorBrowsableState.Never)]
358 public event EventHandler<WebViewPageLoadEventArgs> PageLoading
362 if (pageLoadingEventHandler == null)
364 pageLoadingCallback = OnPageLoading;
365 pageLoadingSignal.Connect(pageLoadingCallback);
367 pageLoadingEventHandler += value;
371 pageLoadingEventHandler -= value;
372 if (pageLoadingEventHandler == null && pageLoadingCallback != null)
374 pageLoadingSignal.Disconnect(pageLoadingCallback);
380 /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.<br />
381 /// This signal is emitted when page loading has finished.<br />
383 [EditorBrowsable(EditorBrowsableState.Never)]
384 public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
388 if (pageLoadFinishedEventHandler == null)
390 pageLoadFinishedCallback = (OnPageLoadFinished);
391 pageLoadFinishedSignal.Connect(pageLoadFinishedCallback);
393 pageLoadFinishedEventHandler += value;
397 pageLoadFinishedEventHandler -= value;
398 if (pageLoadFinishedEventHandler == null && pageLoadFinishedCallback != null)
400 pageLoadFinishedSignal.Disconnect(pageLoadFinishedCallback);
406 /// Event for the PageLoadError signal which can be used to subscribe or unsubscribe the event handler.<br />
407 /// This signal is emitted when there's an error in page loading.<br />
409 [EditorBrowsable(EditorBrowsableState.Never)]
410 public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
414 if (pageLoadErrorEventHandler == null)
416 pageLoadErrorCallback = OnPageLoadError;
417 pageLoadErrorSignal.Connect(pageLoadErrorCallback);
419 pageLoadErrorEventHandler += value;
423 pageLoadErrorEventHandler -= value;
424 if (pageLoadErrorEventHandler == null && pageLoadErrorCallback != null)
426 pageLoadErrorSignal.Disconnect(pageLoadErrorCallback);
432 /// Event for the ScrollEdgeReached signal which can be used to subscribe or unsubscribe the event handler.<br />
433 /// This signal is emitted when web view is scrolled to edge.<br />
435 [EditorBrowsable(EditorBrowsableState.Never)]
436 public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
440 if (scrollEdgeReachedEventHandler == null)
442 scrollEdgeReachedCallback = OnScrollEdgeReached;
443 scrollEdgeReachedSignal.Connect(scrollEdgeReachedCallback);
445 scrollEdgeReachedEventHandler += value;
449 scrollEdgeReachedEventHandler -= value;
450 if (scrollEdgeReachedEventHandler == null && scrollEdgeReachedCallback != null)
452 scrollEdgeReachedSignal.Disconnect(scrollEdgeReachedCallback);
458 /// Event for the UrlChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
459 /// This signal is emitted when url is changed.<br />
461 [EditorBrowsable(EditorBrowsableState.Never)]
462 public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
466 if (urlChangedEventHandler == null)
468 urlChangedCallback = OnUrlChanged;
469 urlChangedSignal.Connect(urlChangedCallback);
471 urlChangedEventHandler += value;
475 urlChangedEventHandler -= value;
476 if (urlChangedEventHandler == null && urlChangedCallback != null)
478 urlChangedSignal.Disconnect(urlChangedCallback);
484 /// Event for the FormRepostDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
485 /// This signal is emitted when form repost policy would be decided.<br />
487 [EditorBrowsable(EditorBrowsableState.Never)]
488 public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
492 if (formRepostPolicyDecidedEventHandler == null)
494 formRepostPolicyDecidedCallback = OnFormRepostPolicyDecided;
495 formRepostPolicyDecidedSignal.Connect(formRepostPolicyDecidedCallback);
497 formRepostPolicyDecidedEventHandler += value;
501 formRepostPolicyDecidedEventHandler -= value;
502 if (formRepostPolicyDecidedEventHandler == null && formRepostPolicyDecidedCallback != null)
504 formRepostPolicyDecidedSignal.Disconnect(formRepostPolicyDecidedCallback);
510 /// Event for the FrameRendered signal which can be used to subscribe or unsubscribe the event handler.<br />
511 /// This signal is emitted when frame is rendered off-screen.<br />
513 [EditorBrowsable(EditorBrowsableState.Never)]
514 public event EventHandler<EventArgs> FrameRendered
518 if (frameRenderedEventHandler == null)
520 frameRenderedCallback = OnFrameRendered;
521 frameRenderedSignal.Connect(frameRenderedCallback);
523 frameRenderedEventHandler += value;
527 frameRenderedEventHandler -= value;
528 if (frameRenderedEventHandler == null && frameRenderedCallback != null)
530 frameRenderedSignal.Disconnect(frameRenderedCallback);
536 /// Event for the ResponsePolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
537 /// This signal is emitted when response policy would be decided.<br />
539 [EditorBrowsable(EditorBrowsableState.Never)]
540 public event EventHandler<WebViewResponsePolicyDecidedEventArgs> ResponsePolicyDecided
544 if (responsePolicyDecidedEventHandler == null)
546 responsePolicyDecidedCallback = OnResponsePolicyDecided;
547 responsePolicyDecidedSignal.Connect(responsePolicyDecidedCallback);
549 responsePolicyDecidedEventHandler += value;
553 responsePolicyDecidedEventHandler -= value;
554 if (responsePolicyDecidedEventHandler == null && responsePolicyDecidedCallback != null)
556 responsePolicyDecidedSignal.Disconnect(responsePolicyDecidedCallback);
562 /// Event for the CertificateConfirmed signal which can be used to subscribe or unsubscribe the event handler.<br />
563 /// This signal is emitted when certificate would be confirmed.<br />
565 [EditorBrowsable(EditorBrowsableState.Never)]
566 public event EventHandler<WebViewCertificateReceivedEventArgs> CertificateConfirmed
570 if (certificateConfirmedEventHandler == null)
572 certificateConfirmedCallback = OnCertificateConfirmed;
573 certificateConfirmedSignal.Connect(certificateConfirmedCallback);
575 certificateConfirmedEventHandler += value;
579 certificateConfirmedEventHandler -= value;
580 if (certificateConfirmedEventHandler == null && certificateConfirmedCallback != null)
582 certificateConfirmedSignal.Disconnect(certificateConfirmedCallback);
588 /// Event for the HttpRequestIntercepted signal which can be used to subscribe or unsubscribe the event handler.<br />
589 /// This signal is emitted when http request would be intercepted.<br />
591 [EditorBrowsable(EditorBrowsableState.Never)]
592 public event EventHandler<WebViewHttpRequestInterceptedEventArgs> HttpRequestIntercepted
596 if (httpRequestInterceptedEventHandler == null)
598 httpRequestInterceptedCallback = OnHttpRequestIntercepted;
599 httpRequestInterceptedSignal.Connect(httpRequestInterceptedCallback);
601 httpRequestInterceptedEventHandler += value;
605 httpRequestInterceptedEventHandler -= value;
606 if (httpRequestInterceptedEventHandler == null && httpRequestInterceptedCallback != null)
608 httpRequestInterceptedSignal.Disconnect(httpRequestInterceptedCallback);
614 /// Event for the SslCertificateChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
615 /// This signal is emitted when SSL certificate is changed.<br />
617 [EditorBrowsable(EditorBrowsableState.Never)]
618 public event EventHandler<WebViewCertificateReceivedEventArgs> SslCertificateChanged
622 if (sslCertificateChangedEventHandler == null)
624 sslCertificateChangedCallback = OnSslCertificateChanged;
625 sslCertificateChangedSignal.Connect(sslCertificateChangedCallback);
627 sslCertificateChangedEventHandler += value;
631 sslCertificateChangedEventHandler -= value;
632 if (sslCertificateChangedEventHandler == null && sslCertificateChangedCallback != null)
634 sslCertificateChangedSignal.Disconnect(sslCertificateChangedCallback);
640 /// Event for the HttpAuthRequested signal which can be used to subscribe or unsubscribe the event handler.<br />
641 /// This signal is emitted when http authentication is requested.<br />
643 [EditorBrowsable(EditorBrowsableState.Never)]
644 public event EventHandler<WebViewHttpAuthRequestedEventArgs> HttpAuthRequested
648 if (httpAuthRequestedEventHandler == null)
650 httpAuthRequestedCallback = OnHttpAuthRequested;
651 httpAuthRequestedSignal.Connect(httpAuthRequestedCallback);
653 httpAuthRequestedEventHandler += value;
657 httpAuthRequestedEventHandler -= value;
658 if (httpAuthRequestedEventHandler == null && httpAuthRequestedCallback != null)
660 httpAuthRequestedSignal.Disconnect(httpAuthRequestedCallback);
666 /// Event for the ConsoleMessageReceived signal which can be used to subscribe or unsubscribe the event handler.<br />
667 /// This signal is emitted when console message is received.<br />
669 [EditorBrowsable(EditorBrowsableState.Never)]
670 public event EventHandler<WebViewConsoleMessageReceivedEventArgs> ConsoleMessageReceived
674 if (consoleMessageReceivedEventHandler == null)
676 consoleMessageReceivedCallback = OnConsoleMessageReceived;
677 consoleMessageReceivedSignal.Connect(consoleMessageReceivedCallback);
679 consoleMessageReceivedEventHandler += value;
683 consoleMessageReceivedEventHandler -= value;
684 if (consoleMessageReceivedEventHandler == null && consoleMessageReceivedCallback != null)
686 consoleMessageReceivedSignal.Disconnect(consoleMessageReceivedCallback);
692 /// Event for the ContextMenuCustomized signal which can be used to subscribe or unsubscribe the event handler.<br />
693 /// This signal is emitted when context menu is customized.<br />
695 [EditorBrowsable(EditorBrowsableState.Never)]
696 public event EventHandler<WebViewContextMenuCustomizedEventArgs> ContextMenuCustomized
700 if (contextMenuCustomizedEventHandler == null)
702 contextMenuCustomizedCallback = OnContextMenuCustomized;
703 contextMenuCustomizedSignal.Connect(contextMenuCustomizedCallback);
705 contextMenuCustomizedEventHandler += value;
709 contextMenuCustomizedEventHandler -= value;
710 if (contextMenuCustomizedEventHandler == null && contextMenuCustomizedCallback != null)
712 contextMenuCustomizedSignal.Disconnect(contextMenuCustomizedCallback);
718 /// Event for the ContextMenuItemSelected signal which can be used to subscribe or unsubscribe the event handler.<br />
719 /// This signal is emitted when context menu item is selected.<br />
721 [EditorBrowsable(EditorBrowsableState.Never)]
722 public event EventHandler<WebViewContextMenuItemSelectedEventArgs> ContextMenuItemSelected
726 if (contextMenuItemSelectedEventHandler == null)
728 contextMenuItemSelectedCallback = OnContextMenuItemSelected;
729 contextMenuItemSelectedSignal.Connect(contextMenuItemSelectedCallback);
731 contextMenuItemSelectedEventHandler += value;
735 contextMenuItemSelectedEventHandler -= value;
736 if (contextMenuItemSelectedEventHandler == null && contextMenuItemSelectedCallback != null)
738 contextMenuItemSelectedSignal.Disconnect(contextMenuItemSelectedCallback);
744 /// Options for searching texts.
746 [EditorBrowsable(EditorBrowsableState.Never)]
747 public enum FindOption
752 [EditorBrowsable(EditorBrowsableState.Never)]
756 /// Case insensitive search
758 [EditorBrowsable(EditorBrowsableState.Never)]
759 CaseInsensitive = 1 << 0,
762 /// Search text only at the beginning of the words
764 [EditorBrowsable(EditorBrowsableState.Never)]
765 AtWordStart = 1 << 1,
768 /// Treat capital letters in the middle of words as word start
770 [EditorBrowsable(EditorBrowsableState.Never)]
771 TreatMediaCapitalAsWordStart = 1 << 2,
776 [EditorBrowsable(EditorBrowsableState.Never)]
780 /// If not present the search stops at the end of the document
782 [EditorBrowsable(EditorBrowsableState.Never)]
788 [EditorBrowsable(EditorBrowsableState.Never)]
789 ShowOverlay = 1 << 5,
794 [EditorBrowsable(EditorBrowsableState.Never)]
795 ShowFindIndiator = 1 << 6,
800 [EditorBrowsable(EditorBrowsableState.Never)]
801 ShowHighlight = 1 << 7,
805 /// Enumeration for mode of hit test.
807 [EditorBrowsable(EditorBrowsableState.Never)]
808 public enum HitTestMode
813 [EditorBrowsable(EditorBrowsableState.Never)]
817 /// Extra node data(tag name, node value, attribute infomation, etc).
819 [EditorBrowsable(EditorBrowsableState.Never)]
823 /// Extra image data(image data, image data length, image file name exteionsion, etc).
825 [EditorBrowsable(EditorBrowsableState.Never)]
831 [EditorBrowsable(EditorBrowsableState.Never)]
832 All = Default | NodeData | ImageData,
838 [EditorBrowsable(EditorBrowsableState.Never)]
839 public WebBackForwardList BackForwardList { get; }
844 [EditorBrowsable(EditorBrowsableState.Never)]
845 public WebContext Context { get; }
850 [EditorBrowsable(EditorBrowsableState.Never)]
851 public WebCookieManager CookieManager { get; }
856 [EditorBrowsable(EditorBrowsableState.Never)]
857 public WebSettings Settings { get; }
862 [EditorBrowsable(EditorBrowsableState.Never)]
867 return (string)GetValue(UrlProperty);
871 SetValue(UrlProperty, value);
872 NotifyPropertyChanged();
877 /// Deprecated. The cache model of the current WebView.
879 [EditorBrowsable(EditorBrowsableState.Never)]
880 public CacheModel CacheModel
884 return (CacheModel)Context.CacheModel;
888 Context.CacheModel = (WebContext.CacheModelType)value;
893 /// Deprecated. The cookie acceptance policy.
895 [EditorBrowsable(EditorBrowsableState.Never)]
896 public CookieAcceptPolicy CookieAcceptPolicy
900 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
904 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
909 /// The user agent string.
911 [EditorBrowsable(EditorBrowsableState.Never)]
912 public string UserAgent
916 return (string)GetValue(UserAgentProperty);
920 SetValue(UserAgentProperty, value);
921 NotifyPropertyChanged();
926 /// Deprecated. Whether JavaScript is enabled.
928 [EditorBrowsable(EditorBrowsableState.Never)]
929 public bool EnableJavaScript
933 return Settings.JavaScriptEnabled;
937 Settings.JavaScriptEnabled = value;
942 /// Deprecated. Whether images can be loaded automatically.
944 [EditorBrowsable(EditorBrowsableState.Never)]
945 public bool LoadImagesAutomatically
949 return Settings.AutomaticImageLoadingAllowed;
953 Settings.AutomaticImageLoadingAllowed = value;
958 /// The default text encoding name.<br />
959 /// e.g. "UTF-8"<br />
961 [EditorBrowsable(EditorBrowsableState.Never)]
962 public string DefaultTextEncodingName
966 return Settings.DefaultTextEncodingName;
970 Settings.DefaultTextEncodingName = value;
975 /// The default font size in pixel.
977 [EditorBrowsable(EditorBrowsableState.Never)]
978 public int DefaultFontSize
982 return Settings.DefaultFontSize;
986 Settings.DefaultFontSize = value;
991 /// The position of scroll.
993 [EditorBrowsable(EditorBrowsableState.Never)]
994 public Position ScrollPosition
998 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
999 return new Position(pv.X, pv.Y);
1005 Position pv = value;
1006 Vector2 vpv = new Vector2(pv.X, pv.Y);
1007 SetValue(ScrollPositionProperty, vpv);
1008 NotifyPropertyChanged();
1014 /// The size of scroll, read-only.
1016 [EditorBrowsable(EditorBrowsableState.Never)]
1017 public Size ScrollSize
1021 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
1022 return new Size(sv.Width, sv.Height);
1027 /// The size of content, read-only.
1029 [EditorBrowsable(EditorBrowsableState.Never)]
1030 public Size ContentSize
1034 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
1035 return new Size(sv.Width, sv.Height);
1040 /// Whether video hole is enabled or not.
1042 [EditorBrowsable(EditorBrowsableState.Never)]
1043 public bool VideoHoleEnabled
1047 return (bool)GetValue(VideoHoleEnabledProperty);
1051 SetValue(VideoHoleEnabledProperty, value);
1052 NotifyPropertyChanged();
1057 /// Whether mouse events are enabled or not.
1059 [EditorBrowsable(EditorBrowsableState.Never)]
1060 public bool MouseEventsEnabled
1064 return (bool)GetValue(MouseEventsEnabledProperty);
1068 SetValue(MouseEventsEnabledProperty, value);
1069 NotifyPropertyChanged();
1074 /// Whether key events are enabled or not.
1076 [EditorBrowsable(EditorBrowsableState.Never)]
1077 public bool KeyEventsEnabled
1081 return (bool)GetValue(KeyEventsEnabledProperty);
1085 SetValue(KeyEventsEnabledProperty, value);
1086 NotifyPropertyChanged();
1091 /// Background color of web page.
1093 [EditorBrowsable(EditorBrowsableState.Never)]
1094 public Color ContentBackgroundColor
1098 return (Color)GetValue(ContentBackgroundColorProperty);
1102 SetValue(ContentBackgroundColorProperty, value);
1103 NotifyPropertyChanged();
1108 /// Whether tiles are cleared or not when hidden.
1110 [EditorBrowsable(EditorBrowsableState.Never)]
1111 public bool TilesClearedWhenHidden
1115 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1119 SetValue(TilesClearedWhenHiddenProperty, value);
1120 NotifyPropertyChanged();
1125 /// Multiplier of cover area of tile when web page is rendered.
1127 [EditorBrowsable(EditorBrowsableState.Never)]
1128 public float TileCoverAreaMultiplier
1132 return (float)GetValue(TileCoverAreaMultiplierProperty);
1136 SetValue(TileCoverAreaMultiplierProperty, value);
1137 NotifyPropertyChanged();
1142 /// Whether cursor is enabled or not by client.
1144 [EditorBrowsable(EditorBrowsableState.Never)]
1145 public bool CursorEnabledByClient
1149 return (bool)GetValue(CursorEnabledByClientProperty);
1153 SetValue(CursorEnabledByClientProperty, value);
1154 NotifyPropertyChanged();
1159 /// Gets selected text in web page.
1161 [EditorBrowsable(EditorBrowsableState.Never)]
1162 public string SelectedText
1166 return (string)GetValue(SelectedTextProperty);
1171 /// Gets title of web page.
1173 [EditorBrowsable(EditorBrowsableState.Never)]
1178 return (string)GetValue(TitleProperty);
1183 /// Gets favicon of web page.
1185 [EditorBrowsable(EditorBrowsableState.Never)]
1186 public ImageView Favicon
1190 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1191 if (imageView == IntPtr.Zero)
1193 return new ImageView(imageView, false);
1198 /// Zoom factor of web page.
1200 [EditorBrowsable(EditorBrowsableState.Never)]
1201 public float PageZoomFactor
1205 return (float)GetValue(PageZoomFactorProperty);
1209 SetValue(PageZoomFactorProperty, value);
1210 NotifyPropertyChanged();
1215 /// Zoom factor of text in web page.
1217 [EditorBrowsable(EditorBrowsableState.Never)]
1218 public float TextZoomFactor
1222 return (float)GetValue(TextZoomFactorProperty);
1226 SetValue(TextZoomFactorProperty, value);
1227 NotifyPropertyChanged();
1232 /// Gets percentage of loading progress.
1234 [EditorBrowsable(EditorBrowsableState.Never)]
1235 public float LoadProgressPercentage
1239 return (float)GetValue(LoadProgressPercentageProperty);
1243 internal static new class Property
1245 internal static readonly int Url = Interop.WebView.UrlGet();
1246 internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
1247 internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
1248 internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
1249 internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
1250 internal static readonly int Title = Interop.WebView.TitleGet();
1251 internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
1252 internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
1253 internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
1254 internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
1255 internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
1256 internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
1257 internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
1258 internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
1259 internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
1260 internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
1261 internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
1264 private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1266 var webview = (WebView)bindable;
1267 if (newValue != null)
1269 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1272 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1274 var webview = (WebView)bindable;
1276 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1280 private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1282 var webview = (WebView)bindable;
1283 if (newValue != null)
1285 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1288 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1290 var webview = (WebView)bindable;
1292 Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1296 private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1298 var webview = (WebView)bindable;
1299 if (newValue != null)
1301 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1304 defaultValueCreator: (bindable) =>
1306 var webview = (WebView)bindable;
1307 Vector2 temp = new Vector2(0.0f, 0.0f);
1308 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
1312 private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1314 var webview = (WebView)bindable;
1315 Vector2 temp = new Vector2(0.0f, 0.0f);
1316 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
1320 private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1322 var webview = (WebView)bindable;
1323 Vector2 temp = new Vector2(0.0f, 0.0f);
1324 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
1328 private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1330 var webview = (WebView)bindable;
1332 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1336 private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1338 var webview = (WebView)bindable;
1339 if (newValue != null)
1341 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1344 defaultValueCreator: (bindable) =>
1346 var webview = (WebView)bindable;
1348 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1352 private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1354 var webview = (WebView)bindable;
1355 if (newValue != null)
1357 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1360 defaultValueCreator: (bindable) =>
1362 var webview = (WebView)bindable;
1364 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1368 private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1370 var webview = (WebView)bindable;
1371 if (newValue != null)
1373 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1376 defaultValueCreator: (bindable) =>
1378 var webview = (WebView)bindable;
1380 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1384 private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1386 var webview = (WebView)bindable;
1387 if (newValue != null)
1389 webview.contentBackgroundColor = (Color)newValue;
1390 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1393 defaultValueCreator: (bindable) =>
1395 var webview = (WebView)bindable;
1396 return webview.contentBackgroundColor;
1399 private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1401 var webview = (WebView)bindable;
1402 if (newValue != null)
1404 webview.tilesClearedWhenHidden = (bool)newValue;
1405 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1408 defaultValueCreator: (bindable) =>
1410 var webview = (WebView)bindable;
1411 return webview.tilesClearedWhenHidden;
1414 private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1416 var webview = (WebView)bindable;
1417 if (newValue != null)
1419 webview.tileCoverAreaMultiplier = (float)newValue;
1420 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1423 defaultValueCreator: (bindable) =>
1425 var webview = (WebView)bindable;
1426 return webview.tileCoverAreaMultiplier;
1429 private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1431 var webview = (WebView)bindable;
1432 if (newValue != null)
1434 webview.cursorEnabledByClient = (bool)newValue;
1435 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1438 defaultValueCreator: (bindable) =>
1440 var webview = (WebView)bindable;
1441 return webview.cursorEnabledByClient;
1444 private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1446 var webview = (WebView)bindable;
1448 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1452 private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1454 var webview = (WebView)bindable;
1455 if (newValue != null)
1457 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1460 defaultValueCreator: (bindable) =>
1462 var webview = (WebView)bindable;
1464 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1468 private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1470 var webview = (WebView)bindable;
1471 if (newValue != null)
1473 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1476 defaultValueCreator: (bindable) =>
1478 var webview = (WebView)bindable;
1480 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1484 private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1486 var webview = (WebView)bindable;
1488 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1492 // For rooting handlers
1493 internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1497 /// <param name="url">The path of Web</param>
1499 [EditorBrowsable(EditorBrowsableState.Never)]
1500 public void LoadUrl(string url)
1502 Interop.WebView.LoadUrl(SwigCPtr, url);
1503 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1507 /// Deprecated. Loads a html by string.
1508 /// <param name="data">The data of Web</param>
1510 [EditorBrowsable(EditorBrowsableState.Never)]
1511 public void LoadHTMLString(string data)
1513 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1518 /// Loads a html by string.
1519 /// <param name="data">The data of Web</param>
1521 [EditorBrowsable(EditorBrowsableState.Never)]
1522 public void LoadHtmlString(string data)
1524 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1525 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1529 /// Loads the specified html as the content of the view to override current history entry.
1530 /// <param name="html">The html to be loaded</param>
1531 /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1532 /// <param name="unreachableUri">URL that could not be reached</param>
1534 [EditorBrowsable(EditorBrowsableState.Never)]
1535 public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1537 bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1543 /// Requests to load the given contents by MIME type.
1544 /// <param name="contents">The contents to be loaded</param>
1545 /// <param name="contentSize">The size of contents (in bytes)</param>
1546 /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1547 /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1548 /// <param name="baseUri">The base URI to use for relative resources</param>
1550 [EditorBrowsable(EditorBrowsableState.Never)]
1551 public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1553 bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1561 [EditorBrowsable(EditorBrowsableState.Never)]
1562 public void Reload()
1564 Interop.WebView.Reload(SwigCPtr);
1565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1569 /// Reloads the current page's document without cache
1571 [EditorBrowsable(EditorBrowsableState.Never)]
1572 public bool ReloadWithoutCache()
1574 bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1580 /// Stops loading the Web
1582 [EditorBrowsable(EditorBrowsableState.Never)]
1583 public void StopLoading()
1585 Interop.WebView.StopLoading(SwigCPtr);
1586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1590 /// Suspends the operation.
1592 [EditorBrowsable(EditorBrowsableState.Never)]
1593 public void Suspend()
1595 Interop.WebView.Suspend(SwigCPtr);
1596 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1600 /// Resumes the operation after calling Suspend()
1602 [EditorBrowsable(EditorBrowsableState.Never)]
1603 public void Resume()
1605 Interop.WebView.Resume(SwigCPtr);
1606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1610 /// Suspends all network loading.
1612 [EditorBrowsable(EditorBrowsableState.Never)]
1613 public void SuspendNetworkLoading()
1615 Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1620 /// Resumes all network loading.
1622 [EditorBrowsable(EditorBrowsableState.Never)]
1623 public void ResumeNetworkLoading()
1625 Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1626 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1630 /// Adds custom header.
1631 /// <param name="name">The name of custom header</param>
1632 /// <param name="value">The value of custom header</param>
1634 [EditorBrowsable(EditorBrowsableState.Never)]
1635 public bool AddCustomHeader(string name, string value)
1637 bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1638 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1643 /// Removes custom header.
1644 /// <param name="name">The name of custom header</param>
1646 [EditorBrowsable(EditorBrowsableState.Never)]
1647 public bool RemoveCustomHeader(string name)
1649 bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1650 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1655 /// Starts the inspector server.
1656 /// <param name="port">The port number</param>
1658 [EditorBrowsable(EditorBrowsableState.Never)]
1659 public uint StartInspectorServer(uint port)
1661 uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1662 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1667 /// Stops the inspector server.
1669 [EditorBrowsable(EditorBrowsableState.Never)]
1670 public bool StopInspectorServer()
1672 bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1673 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1678 /// Scrolls page of web view by deltaX and detlaY.
1679 /// <param name="deltaX">The deltaX of scroll</param>
1680 /// <param name="deltaY">The deltaY of scroll</param>
1682 [EditorBrowsable(EditorBrowsableState.Never)]
1683 public void ScrollBy(int deltaX, int deltaY)
1685 Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1690 /// Scrolls edge of web view by deltaX and deltaY.
1691 /// <param name="deltaX">The deltaX of scroll</param>
1692 /// <param name="deltaY">The deltaY of scroll</param>
1694 [EditorBrowsable(EditorBrowsableState.Never)]
1695 public bool ScrollEdgeBy(int deltaX, int deltaY)
1697 bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1698 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1703 /// Goes to the back
1705 [EditorBrowsable(EditorBrowsableState.Never)]
1706 public void GoBack()
1708 Interop.WebView.GoBack(SwigCPtr);
1709 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1713 /// Goes to the forward
1715 [EditorBrowsable(EditorBrowsableState.Never)]
1716 public void GoForward()
1718 Interop.WebView.GoForward(SwigCPtr);
1719 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1723 /// Returns whether backward is possible.
1724 /// <returns>True if backward is possible, false otherwise</returns>
1726 [EditorBrowsable(EditorBrowsableState.Never)]
1727 public bool CanGoBack()
1729 bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1735 /// Returns whether forward is possible.
1736 /// <returns>True if forward is possible, false otherwise</returns>
1738 [EditorBrowsable(EditorBrowsableState.Never)]
1739 public bool CanGoForward()
1741 bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1747 /// Evaluates JavaScript code represented as a string.
1748 /// <param name="script">The JavaScript code</param>
1750 [EditorBrowsable(EditorBrowsableState.Never)]
1751 public void EvaluateJavaScript(string script)
1753 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1754 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1758 /// Add a message handler into the WebView.
1759 /// <param name="objectName">The name of exposed object</param>
1760 /// <param name="handler">The callback function</param>
1762 [EditorBrowsable(EditorBrowsableState.Never)]
1763 public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1765 if (handlerRootMap.ContainsKey(objectName))
1770 handlerRootMap.Add(objectName, handler);
1772 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1773 Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1775 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1779 /// Add a message handler into the WebView.
1780 /// <param name="callback">The callback function</param>
1782 [EditorBrowsable(EditorBrowsableState.Never)]
1783 public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1785 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1786 Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1792 /// Reply for alert popup.
1794 [EditorBrowsable(EditorBrowsableState.Never)]
1795 public void JavaScriptAlertReply()
1797 Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1802 /// Add a message handler into the WebView.
1803 /// <param name="callback">The callback function</param>
1805 [EditorBrowsable(EditorBrowsableState.Never)]
1806 public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1808 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1809 Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1811 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1815 /// Reply for confirm popup.
1816 /// <param name="confirmed">confirmed or not</param>
1818 [EditorBrowsable(EditorBrowsableState.Never)]
1819 public void JavaScriptConfirmReply(bool confirmed)
1821 Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1822 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1826 /// Add a message handler into the WebView.
1827 /// <param name="callback">The callback function</param>
1829 [EditorBrowsable(EditorBrowsableState.Never)]
1830 public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1832 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1833 Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1835 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1839 /// Reply for prompt popup.
1840 /// <param name="result">text in prompt input field.</param>
1842 [EditorBrowsable(EditorBrowsableState.Never)]
1843 public void JavaScriptPromptReply(string result)
1845 Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
1846 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1850 /// Clears title resources of current WebView.
1852 [EditorBrowsable(EditorBrowsableState.Never)]
1853 public void ClearAllTilesResources()
1855 Interop.WebView.ClearAllTilesResources(SwigCPtr);
1856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1860 /// Clears the history of current WebView.
1862 [EditorBrowsable(EditorBrowsableState.Never)]
1863 public void ClearHistory()
1865 Interop.WebView.ClearHistory(SwigCPtr);
1866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1870 /// Scales the current page, centered at the given point.
1871 /// <param name="scaleFactor">The new factor to be scaled</param>
1872 /// <param name="point">The center coordinate</param>
1874 [EditorBrowsable(EditorBrowsableState.Never)]
1875 public void SetScaleFactor(float scaleFactor, Vector2 point)
1877 Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
1878 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1882 /// Gets the current scale factor of the page.
1884 [EditorBrowsable(EditorBrowsableState.Never)]
1885 public float GetScaleFactor()
1887 float result = Interop.WebView.GetScaleFactor(SwigCPtr);
1888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1893 /// Requests to activate/deactivate the accessibility usage set by web app.
1894 /// <param name="activated">The new factor to be scaled</param>
1896 [EditorBrowsable(EditorBrowsableState.Never)]
1897 public void ActivateAccessibility(bool activated)
1899 Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
1900 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1904 /// Searches and highlights the given string in the document.
1905 /// <param name="text">The text to be searched</param>
1906 /// <param name="options">The options to search</param>
1907 /// <param name="maxMatchCount">The maximum match count to search</param>
1909 [EditorBrowsable(EditorBrowsableState.Never)]
1910 public bool HighlightText(string text, FindOption options, uint maxMatchCount)
1912 bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
1913 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1918 /// Adds dynamic certificate path.
1919 /// <param name="host">Host that required client authentication</param>
1920 /// <param name="certPath">The file path stored certificate</param>
1922 [EditorBrowsable(EditorBrowsableState.Never)]
1923 public void AddDynamicCertificatePath(string host, string certPath)
1925 Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
1926 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1930 /// Get snapshot of the specified viewArea of page.
1931 /// <param name="viewArea">Host that required client authentication</param>
1932 /// <param name="scaleFactor">The file path stored certificate</param>
1934 [EditorBrowsable(EditorBrowsableState.Never)]
1935 public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
1937 IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
1938 ImageView imageView = new ImageView(image, true);
1939 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1944 /// Get snapshot of the specified viewArea of page.
1945 /// <param name="viewArea">Host that required client authentication</param>
1946 /// <param name="scaleFactor">The file path stored certificate</param>
1947 /// <param name="callback">The callback for getting screen shot</param>
1949 [EditorBrowsable(EditorBrowsableState.Never)]
1950 public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
1952 screenshotAcquiredCallback = callback;
1953 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(screenshotAcquiredProxyCallback);
1954 bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
1955 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1960 /// Asynchronous requests to check if there is a video playing in the given view.
1961 /// <param name="callback">The callback called after checking if video is playing or not</param>
1963 [EditorBrowsable(EditorBrowsableState.Never)]
1964 public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
1966 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1967 bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
1968 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1973 /// Registers callback which will be called upon geolocation permission request.
1974 /// <param name="callback">The callback for requesting geolocation permission</param>
1976 [EditorBrowsable(EditorBrowsableState.Never)]
1977 public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
1979 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1980 Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
1981 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1985 /// Does hit test synchronously.
1986 /// <param name="x">the horizontal position to query</param>
1987 /// <param name="y">the vertical position to query</param>
1988 /// <param name="mode">the mode of hit test</param>
1990 [EditorBrowsable(EditorBrowsableState.Never)]
1991 public WebHitTestResult HitTest(int x, int y, HitTestMode mode)
1993 System.IntPtr result = Interop.WebView.CreateHitTest(SwigCPtr, x, y, (int)mode);
1994 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1995 return new WebHitTestResult(result, true);
1999 /// Does hit test asynchronously.
2000 /// <param name="x">the horizontal position to query</param>
2001 /// <param name="y">the vertical position to query</param>
2002 /// <param name="mode">the mode of hit test</param>
2003 /// <param name="callback">the callback that is called after hit test is finished.</param>
2005 [EditorBrowsable(EditorBrowsableState.Never)]
2006 public bool HitTestAsynchronously(int x, int y, HitTestMode mode, HitTestFinishedCallback callback)
2008 hitTestFinishedCallback = callback;
2009 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(hitTestFinishedProxyCallback);
2010 bool result = Interop.WebView.CreateHitTestAsynchronously(SwigCPtr, x, y, (int)mode, new HandleRef(this, ip));
2011 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2016 /// Deprecated. Clears the cache of current WebView.
2018 [EditorBrowsable(EditorBrowsableState.Never)]
2019 public void ClearCache()
2021 Context.ClearCache();
2025 /// Deprecated. Clears all the cookies of current WebView.
2027 [EditorBrowsable(EditorBrowsableState.Never)]
2028 public void ClearCookies()
2030 CookieManager.ClearCookies();
2033 internal static WebView DownCast(BaseHandle handle)
2035 WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2036 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2040 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebView obj)
2042 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
2045 internal WebView Assign(WebView webView)
2047 WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2048 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2052 private void OnPageLoadStarted(IntPtr data, string pageUrl)
2054 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2056 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
2057 e.PageUrl = pageUrl;
2059 pageLoadStartedEventHandler?.Invoke(this, e);
2062 private void OnPageLoading(IntPtr data, string pageUrl)
2064 pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2067 private void OnPageLoadFinished(IntPtr data, string pageUrl)
2069 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2071 e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView;
2072 e.PageUrl = pageUrl;
2074 pageLoadFinishedEventHandler?.Invoke(this, e);
2077 private void OnPageLoadError(IntPtr data, IntPtr error)
2079 pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, false)));
2082 private void OnScrollEdgeReached(IntPtr data, int edge)
2084 scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2087 private void OnUrlChanged(IntPtr data, string pageUrl)
2089 urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2092 private void OnFormRepostPolicyDecided(IntPtr data, IntPtr decision)
2094 formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, false)));
2097 private void OnFrameRendered(IntPtr data)
2099 frameRenderedEventHandler?.Invoke(this, new EventArgs());
2102 private void OnScreenshotAcquired(IntPtr data)
2104 ImageView image = new ImageView(data, true);
2105 screenshotAcquiredCallback?.Invoke(image);
2109 private void OnResponsePolicyDecided(IntPtr data, IntPtr maker)
2111 responsePolicyDecidedEventHandler?.Invoke(this, new WebViewResponsePolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, false)));
2114 private void OnCertificateConfirmed(IntPtr data, IntPtr certificate)
2116 certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, false)));
2119 private void OnSslCertificateChanged(IntPtr data, IntPtr certificate)
2121 sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, false)));
2124 private void OnHttpAuthRequested(IntPtr data, IntPtr handler)
2126 httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, false)));
2129 private void OnHttpRequestIntercepted(IntPtr data, IntPtr interceptor)
2131 httpRequestInterceptedEventHandler?.Invoke(this, new WebViewHttpRequestInterceptedEventArgs(new WebHttpRequestInterceptor(interceptor, false)));
2134 private void OnConsoleMessageReceived(IntPtr data, IntPtr message)
2136 consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, false)));
2139 private void OnContextMenuCustomized(IntPtr data, IntPtr menu)
2141 contextMenuCustomizedEventHandler?.Invoke(this, new WebViewContextMenuCustomizedEventArgs(new WebContextMenu(menu, false)));
2144 private void OnContextMenuItemSelected(IntPtr data, IntPtr item)
2146 contextMenuItemSelectedEventHandler?.Invoke(this, new WebViewContextMenuItemSelectedEventArgs(new WebContextMenuItem(item, false)));
2149 private void OnHitTestFinished(IntPtr test)
2151 WebHitTestResult hitTest = new WebHitTestResult(test, true);
2152 hitTestFinishedCallback?.Invoke(hitTest);