2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using System.Runtime.InteropServices;
22 using Tizen.NUI.Binding;
24 namespace Tizen.NUI.BaseComponents
27 /// WebView allows presenting content with embedded web browser, both local files and remote websites.
29 /// <since_tizen> 9 </since_tizen>
30 public partial class WebView : View
32 private static readonly WebContext context = new WebContext(Interop.WebView.GetWebContext(), false);
33 private static readonly WebCookieManager cookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(), false);
35 private Color contentBackgroundColor;
36 private bool tilesClearedWhenHidden;
37 private float tileCoverAreaMultiplier;
38 private bool cursorEnabledByClient;
40 private EventHandler<WebViewPageLoadEventArgs> pageLoadStartedEventHandler;
41 private WebViewPageLoadCallback pageLoadStartedCallback;
43 private EventHandler<WebViewPageLoadEventArgs> pageLoadingEventHandler;
44 private WebViewPageLoadCallback pageLoadingCallback;
46 private EventHandler<WebViewPageLoadEventArgs> pageLoadFinishedEventHandler;
47 private WebViewPageLoadCallback pageLoadFinishedCallback;
49 private EventHandler<WebViewPageLoadErrorEventArgs> pageLoadErrorEventHandler;
50 private WebViewPageLoadErrorCallback pageLoadErrorCallback;
52 private EventHandler<WebViewScrollEdgeReachedEventArgs> scrollEdgeReachedEventHandler;
53 private WebViewScrollEdgeReachedCallback scrollEdgeReachedCallback;
55 private EventHandler<WebViewUrlChangedEventArgs> urlChangedEventHandler;
56 private WebViewUrlChangedCallback urlChangedCallback;
58 private EventHandler<WebViewFormRepostPolicyDecidedEventArgs> formRepostPolicyDecidedEventHandler;
59 private WebViewFormRepostPolicyDecidedCallback formRepostPolicyDecidedCallback;
61 private EventHandler<EventArgs> frameRenderedEventHandler;
62 private WebViewFrameRenderedCallback frameRenderedCallback;
64 private ScreenshotAcquiredCallback screenshotAcquiredCallback;
65 private readonly WebViewScreenshotAcquiredProxyCallback screenshotAcquiredProxyCallback;
67 private HitTestFinishedCallback hitTestFinishedCallback;
68 private readonly WebViewHitTestFinishedProxyCallback hitTestFinishedProxyCallback;
70 private EventHandler<WebViewPolicyDecidedEventArgs> responsePolicyDecidedEventHandler;
71 private WebViewPolicyDecidedCallback responsePolicyDecidedCallback;
73 private EventHandler<WebViewPolicyDecidedEventArgs> navigationPolicyDecidedEventHandler;
74 private WebViewPolicyDecidedCallback navigationPolicyDecidedCallback;
76 private EventHandlerWithReturnType<object, EventArgs, WebView> newWindowCreatedEventHandler;
77 private WebViewNewWindowCreatedCallback newWindowCreatedCallback;
79 private EventHandler<WebViewCertificateReceivedEventArgs> certificateConfirmedEventHandler;
80 private WebViewCertificateReceivedCallback certificateConfirmedCallback;
82 private EventHandler<WebViewCertificateReceivedEventArgs> sslCertificateChangedEventHandler;
83 private WebViewCertificateReceivedCallback sslCertificateChangedCallback;
85 private EventHandler<WebViewHttpAuthRequestedEventArgs> httpAuthRequestedEventHandler;
86 private WebViewHttpAuthRequestedCallback httpAuthRequestedCallback;
88 private EventHandler<WebViewConsoleMessageReceivedEventArgs> consoleMessageReceivedEventHandler;
89 private WebViewConsoleMessageReceivedCallback consoleMessageReceivedCallback;
91 private EventHandler<WebViewContextMenuShownEventArgs> contextMenuShownEventHandler;
92 private WebViewContextMenuShownCallback contextMenuShownCallback;
94 private EventHandler<WebViewContextMenuHiddenEventArgs> contextMenuHiddenEventHandler;
95 private WebViewContextMenuHiddenCallback contextMenuHiddenCallback;
97 private PlainTextReceivedCallback plainTextReceivedCallback;
101 /// Creates a WebView.
103 /// <since_tizen> 9 </since_tizen>
104 public WebView() : this(Interop.WebView.New(), true)
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110 /// Creates a WebView with locale and time-zone.
112 /// <param name="locale">The specified locale</param>
113 /// <param name="timezoneId">The specified time-zone ID</param>
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public WebView(string locale, string timezoneId) : this(Interop.WebView.New2(locale, timezoneId), true)
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 /// Creates a WebView with an args list.
123 /// <param name="args">Arguments passed into web engine. The first value of array must be program's name.</param>
124 /// <since_tizen> 9 </since_tizen>
125 public WebView(string[] args) : this(Interop.WebView.New3(args?.Length ?? 0, args), true)
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// Copy constructor.
133 /// <param name="webView">WebView to copy. The copied WebView will point at the same implementation</param>
134 /// <since_tizen> 9 </since_tizen>
135 public WebView(WebView webView) : this(Interop.WebView.NewWebView(WebView.getCPtr(webView)), true)
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WebView.Upcast(cPtr), cMemoryOwn)
142 screenshotAcquiredProxyCallback = OnScreenshotAcquired;
143 hitTestFinishedProxyCallback = OnHitTestFinished;
145 BackForwardList = new WebBackForwardList(Interop.WebView.GetWebBackForwardList(SwigCPtr), false);
146 Settings = new WebSettings(Interop.WebView.GetWebSettings(SwigCPtr), false);
150 /// Dispose for IDisposable pattern
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 protected override void Dispose(DisposeTypes type)
160 if (type == DisposeTypes.Explicit)
163 //Release your own managed resources here.
164 //You should release all of your own disposable objects here.
165 BackForwardList.Dispose();
172 /// This will not be public opened.
173 /// <param name="swigCPtr"></param>
174 [EditorBrowsable(EditorBrowsableState.Never)]
175 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
177 Interop.WebView.DeleteWebView(swigCPtr);
181 /// The callback function that is invoked when the message is received from the script.
183 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public delegate void JavaScriptMessageHandler(string message);
188 /// The callback function that is invoked when the message is received from the script.
190 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public delegate void JavaScriptAlertCallback(string message);
195 /// The callback function that is invoked when the message is received from the script.
197 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
198 [EditorBrowsable(EditorBrowsableState.Never)]
199 public delegate void JavaScriptConfirmCallback(string message);
202 /// The callback function that is invoked when the message is received from the script.
204 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 public delegate void JavaScriptPromptCallback(string message1, string message2);
209 /// The callback function that is invoked when screen shot is acquired asynchronously.
211 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
212 [EditorBrowsable(EditorBrowsableState.Never)]
213 public delegate void ScreenshotAcquiredCallback(ImageView image);
216 /// The callback function that is invoked when video playing is checked asynchronously.
218 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 public delegate void VideoPlayingCallback(bool isPlaying);
223 /// The callback function that is invoked when geolocation permission is requested.
225 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
226 [EditorBrowsable(EditorBrowsableState.Never)]
227 public delegate void GeolocationPermissionCallback(string host, string protocol);
230 /// The callback function that is invoked when hit test is finished.
232 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
233 [EditorBrowsable(EditorBrowsableState.Never)]
234 public delegate void HitTestFinishedCallback(WebHitTestResult test);
237 /// The callback function that is invoked when the plain text of the current page is received.
239 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
240 [EditorBrowsable(EditorBrowsableState.Never)]
241 public delegate void PlainTextReceivedCallback(string plainText);
243 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
244 private delegate void WebViewPageLoadCallback(string pageUrl);
246 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
247 private delegate void WebViewPageLoadErrorCallback(IntPtr error);
249 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
250 private delegate void WebViewScrollEdgeReachedCallback(int edge);
252 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
253 private delegate void WebViewUrlChangedCallback(string pageUrl);
255 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
256 private delegate void WebViewFormRepostPolicyDecidedCallback(IntPtr maker);
258 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
259 private delegate void WebViewFrameRenderedCallback();
261 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
262 private delegate void WebViewScreenshotAcquiredProxyCallback(IntPtr data);
264 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
265 private delegate void WebViewHitTestFinishedProxyCallback(IntPtr data);
267 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
268 private delegate void WebViewPolicyDecidedCallback(IntPtr maker);
270 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
271 private delegate void WebViewNewWindowCreatedCallback(out IntPtr outView);
273 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
274 private delegate void WebViewCertificateReceivedCallback(IntPtr certificate);
276 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
277 private delegate void WebViewHttpAuthRequestedCallback(IntPtr handler);
279 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
280 private delegate void WebViewConsoleMessageReceivedCallback(IntPtr message);
282 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
283 private delegate void WebViewContextMenuShownCallback(IntPtr menu);
285 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
286 private delegate void WebViewContextMenuHiddenCallback(IntPtr menu);
289 /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.<br />
290 /// This signal is emitted when page loading has started.<br />
292 /// <since_tizen> 9 </since_tizen>
293 public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
297 if (pageLoadStartedEventHandler == null)
299 pageLoadStartedCallback = OnPageLoadStarted;
300 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadStartedCallback);
301 Interop.WebView.RegisterPageLoadStartedCallback(SwigCPtr, new HandleRef(this, ip));
303 pageLoadStartedEventHandler += value;
307 pageLoadStartedEventHandler -= value;
308 if (pageLoadStartedEventHandler == null)
310 IntPtr ip = IntPtr.Zero;
311 Interop.WebView.RegisterPageLoadStartedCallback(SwigCPtr, new HandleRef(this, ip));
317 /// Event for the PageLoading signal which can be used to subscribe or unsubscribe the event handler.<br />
318 /// This signal is emitted when page loading is in progress.<br />
320 /// <since_tizen> 9 </since_tizen>
321 public event EventHandler<WebViewPageLoadEventArgs> PageLoading
325 if (pageLoadingEventHandler == null)
327 pageLoadingCallback = OnPageLoading;
328 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadingCallback);
329 Interop.WebView.RegisterPageLoadInProgressCallback(SwigCPtr, new HandleRef(this, ip));
331 pageLoadingEventHandler += value;
335 pageLoadingEventHandler -= value;
336 if (pageLoadingEventHandler == null)
338 IntPtr ip = IntPtr.Zero;
339 Interop.WebView.RegisterPageLoadInProgressCallback(SwigCPtr, new HandleRef(this, ip));
345 /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.<br />
346 /// This signal is emitted when page loading has finished.<br />
348 /// <since_tizen> 9 </since_tizen>
349 public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
353 if (pageLoadFinishedEventHandler == null)
355 pageLoadFinishedCallback = (OnPageLoadFinished);
356 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadFinishedCallback);
357 Interop.WebView.RegisterPageLoadFinishedCallback(SwigCPtr, new HandleRef(this, ip));
359 pageLoadFinishedEventHandler += value;
363 pageLoadFinishedEventHandler -= value;
364 if (pageLoadFinishedEventHandler == null)
366 IntPtr ip = IntPtr.Zero;
367 Interop.WebView.RegisterPageLoadFinishedCallback(SwigCPtr, new HandleRef(this, ip));
373 /// Event for the PageLoadError signal which can be used to subscribe or unsubscribe the event handler.<br />
374 /// This signal is emitted when there's an error in page loading.<br />
376 /// <since_tizen> 9 </since_tizen>
377 public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
381 if (pageLoadErrorEventHandler == null)
383 pageLoadErrorCallback = OnPageLoadError;
384 IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadErrorCallback);
385 Interop.WebView.RegisterPageLoadErrorCallback(SwigCPtr, new HandleRef(this, ip));
387 pageLoadErrorEventHandler += value;
391 pageLoadErrorEventHandler -= value;
392 if (pageLoadErrorEventHandler == null)
394 IntPtr ip = IntPtr.Zero;
395 Interop.WebView.RegisterPageLoadErrorCallback(SwigCPtr, new HandleRef(this, ip));
401 /// Event for the ScrollEdgeReached signal which can be used to subscribe or unsubscribe the event handler.<br />
402 /// This signal is emitted when web view is scrolled to edge.<br />
404 [EditorBrowsable(EditorBrowsableState.Never)]
405 public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
409 if (scrollEdgeReachedEventHandler == null)
411 scrollEdgeReachedCallback = OnScrollEdgeReached;
412 IntPtr ip = Marshal.GetFunctionPointerForDelegate(scrollEdgeReachedCallback);
413 Interop.WebView.RegisterScrollEdgeReachedCallback(SwigCPtr, new HandleRef(this, ip));
415 scrollEdgeReachedEventHandler += value;
419 scrollEdgeReachedEventHandler -= value;
420 if (scrollEdgeReachedEventHandler == null)
422 IntPtr ip = IntPtr.Zero;
423 Interop.WebView.RegisterScrollEdgeReachedCallback(SwigCPtr, new HandleRef(this, ip));
429 /// Event for the UrlChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
430 /// This signal is emitted when url is changed.<br />
432 [EditorBrowsable(EditorBrowsableState.Never)]
433 public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
437 if (urlChangedEventHandler == null)
439 urlChangedCallback = OnUrlChanged;
440 IntPtr ip = Marshal.GetFunctionPointerForDelegate(urlChangedCallback);
441 Interop.WebView.RegisterUrlChangedCallback(SwigCPtr, new HandleRef(this, ip));
443 urlChangedEventHandler += value;
447 urlChangedEventHandler -= value;
448 if (urlChangedEventHandler == null)
450 IntPtr ip = IntPtr.Zero;
451 Interop.WebView.RegisterUrlChangedCallback(SwigCPtr, new HandleRef(this, ip));
457 /// Event for the FormRepostDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
458 /// This signal is emitted when form repost policy would be decided.<br />
460 [EditorBrowsable(EditorBrowsableState.Never)]
461 public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
465 if (formRepostPolicyDecidedEventHandler == null)
467 formRepostPolicyDecidedCallback = OnFormRepostPolicyDecided;
468 IntPtr ip = Marshal.GetFunctionPointerForDelegate(formRepostPolicyDecidedCallback);
469 Interop.WebView.RegisterFormRepostDecidedCallback(SwigCPtr, new HandleRef(this, ip));
471 formRepostPolicyDecidedEventHandler += value;
475 formRepostPolicyDecidedEventHandler -= value;
476 if (formRepostPolicyDecidedEventHandler == null)
478 IntPtr ip = IntPtr.Zero;
479 Interop.WebView.RegisterFormRepostDecidedCallback(SwigCPtr, new HandleRef(this, ip));
485 /// Event for the FrameRendered signal which can be used to subscribe or unsubscribe the event handler.<br />
486 /// This signal is emitted when frame is rendered off-screen.<br />
488 [EditorBrowsable(EditorBrowsableState.Never)]
489 public event EventHandler<EventArgs> FrameRendered
493 if (frameRenderedEventHandler == null)
495 frameRenderedCallback = OnFrameRendered;
496 IntPtr ip = Marshal.GetFunctionPointerForDelegate(frameRenderedCallback);
497 Interop.WebView.RegisterFrameRenderedCallback(SwigCPtr, new HandleRef(this, ip));
499 frameRenderedEventHandler += value;
503 frameRenderedEventHandler -= value;
504 if (frameRenderedEventHandler == null)
506 IntPtr ip = IntPtr.Zero;
507 Interop.WebView.RegisterFrameRenderedCallback(SwigCPtr, new HandleRef(this, ip));
513 /// Event for the ResponsePolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
514 /// This signal is emitted when response policy would be decided.<br />
516 [EditorBrowsable(EditorBrowsableState.Never)]
517 public event EventHandler<WebViewPolicyDecidedEventArgs> ResponsePolicyDecided
521 if (responsePolicyDecidedEventHandler == null)
523 responsePolicyDecidedCallback = OnResponsePolicyDecided;
524 IntPtr ip = Marshal.GetFunctionPointerForDelegate(responsePolicyDecidedCallback);
525 Interop.WebView.RegisterResponsePolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
527 responsePolicyDecidedEventHandler += value;
531 responsePolicyDecidedEventHandler -= value;
532 if (responsePolicyDecidedEventHandler == null)
534 IntPtr ip = IntPtr.Zero;
535 Interop.WebView.RegisterResponsePolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
541 /// Event for the NavigationPolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
542 /// This signal is emitted when response policy would be decided.<br />
544 [EditorBrowsable(EditorBrowsableState.Never)]
545 public event EventHandler<WebViewPolicyDecidedEventArgs> NavigationPolicyDecided
549 if (navigationPolicyDecidedEventHandler == null)
551 navigationPolicyDecidedCallback = OnNavigationPolicyDecided;
552 IntPtr ip = Marshal.GetFunctionPointerForDelegate(navigationPolicyDecidedCallback);
553 Interop.WebView.RegisterNavigationPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
555 navigationPolicyDecidedEventHandler += value;
559 navigationPolicyDecidedEventHandler -= value;
560 if (navigationPolicyDecidedEventHandler == null)
562 IntPtr ip = IntPtr.Zero;
563 Interop.WebView.RegisterNavigationPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
569 /// Event for the NewWindowCreated signal which can be used to subscribe or unsubscribe the event handler.<br />
570 /// This signal is emitted when a new window would be created.<br />
572 [EditorBrowsable(EditorBrowsableState.Never)]
573 public event EventHandlerWithReturnType<object, EventArgs, WebView> NewWindowCreated
577 if (newWindowCreatedEventHandler == null)
579 newWindowCreatedCallback = OnNewWindowCreated;
580 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(newWindowCreatedCallback);
581 Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip));
583 newWindowCreatedEventHandler += value;
587 newWindowCreatedEventHandler -= value;
588 if (newWindowCreatedEventHandler == null)
590 IntPtr ip = IntPtr.Zero;
591 Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip));
597 /// Event for the CertificateConfirmed signal which can be used to subscribe or unsubscribe the event handler.<br />
598 /// This signal is emitted when certificate would be confirmed.<br />
600 [EditorBrowsable(EditorBrowsableState.Never)]
601 public event EventHandler<WebViewCertificateReceivedEventArgs> CertificateConfirmed
605 if (certificateConfirmedEventHandler == null)
607 certificateConfirmedCallback = OnCertificateConfirmed;
608 IntPtr ip = Marshal.GetFunctionPointerForDelegate(certificateConfirmedCallback);
609 Interop.WebView.RegisterCertificateConfirmedCallback(SwigCPtr, new HandleRef(this, ip));
611 certificateConfirmedEventHandler += value;
615 certificateConfirmedEventHandler -= value;
616 if (certificateConfirmedEventHandler == null)
618 IntPtr ip = IntPtr.Zero;
619 Interop.WebView.RegisterCertificateConfirmedCallback(SwigCPtr, new HandleRef(this, ip));
625 /// Event for the SslCertificateChanged signal which can be used to subscribe or unsubscribe the event handler.<br />
626 /// This signal is emitted when SSL certificate is changed.<br />
628 [EditorBrowsable(EditorBrowsableState.Never)]
629 public event EventHandler<WebViewCertificateReceivedEventArgs> SslCertificateChanged
633 if (sslCertificateChangedEventHandler == null)
635 sslCertificateChangedCallback = OnSslCertificateChanged;
636 IntPtr ip = Marshal.GetFunctionPointerForDelegate(sslCertificateChangedCallback);
637 Interop.WebView.RegisterSslCertificateChangedCallback(SwigCPtr, new HandleRef(this, ip));
639 sslCertificateChangedEventHandler += value;
643 sslCertificateChangedEventHandler -= value;
644 if (sslCertificateChangedEventHandler == null)
646 IntPtr ip = IntPtr.Zero;
647 Interop.WebView.RegisterSslCertificateChangedCallback(SwigCPtr, new HandleRef(this, ip));
653 /// Event for the HttpAuthRequested signal which can be used to subscribe or unsubscribe the event handler.<br />
654 /// This signal is emitted when http authentication is requested.<br />
656 [EditorBrowsable(EditorBrowsableState.Never)]
657 public event EventHandler<WebViewHttpAuthRequestedEventArgs> HttpAuthRequested
661 if (httpAuthRequestedEventHandler == null)
663 httpAuthRequestedCallback = OnHttpAuthRequested;
664 IntPtr ip = Marshal.GetFunctionPointerForDelegate(httpAuthRequestedCallback);
665 Interop.WebView.RegisterHttpAuthHandlerCallback(SwigCPtr, new HandleRef(this, ip));
667 httpAuthRequestedEventHandler += value;
671 httpAuthRequestedEventHandler -= value;
672 if (httpAuthRequestedEventHandler == null)
674 IntPtr ip = IntPtr.Zero;
675 Interop.WebView.RegisterHttpAuthHandlerCallback(SwigCPtr, new HandleRef(this, ip));
681 /// Event for the ConsoleMessageReceived signal which can be used to subscribe or unsubscribe the event handler.<br />
682 /// This signal is emitted when console message is received.<br />
684 [EditorBrowsable(EditorBrowsableState.Never)]
685 public event EventHandler<WebViewConsoleMessageReceivedEventArgs> ConsoleMessageReceived
689 if (consoleMessageReceivedEventHandler == null)
691 consoleMessageReceivedCallback = OnConsoleMessageReceived;
692 IntPtr ip = Marshal.GetFunctionPointerForDelegate(consoleMessageReceivedCallback);
693 Interop.WebView.RegisterConsoleMessageReceivedCallback(SwigCPtr, new HandleRef(this, ip));
695 consoleMessageReceivedEventHandler += value;
699 consoleMessageReceivedEventHandler -= value;
700 if (consoleMessageReceivedEventHandler == null)
702 IntPtr ip = IntPtr.Zero;
703 Interop.WebView.RegisterConsoleMessageReceivedCallback(SwigCPtr, new HandleRef(this, ip));
709 /// Event for the ContextMenuShown signal which can be used to subscribe or unsubscribe the event handler.<br />
710 /// This signal is emitted when context menu is shown.<br />
712 [EditorBrowsable(EditorBrowsableState.Never)]
713 public event EventHandler<WebViewContextMenuShownEventArgs> ContextMenuShown
717 if (contextMenuShownEventHandler == null)
719 contextMenuShownCallback = OnContextMenuShown;
720 IntPtr ip = Marshal.GetFunctionPointerForDelegate(contextMenuShownCallback);
721 Interop.WebView.RegisterContextMenuShownCallback(SwigCPtr, new HandleRef(this, ip));
723 contextMenuShownEventHandler += value;
727 contextMenuShownEventHandler -= value;
728 if (contextMenuShownEventHandler == null)
730 IntPtr ip = IntPtr.Zero;
731 Interop.WebView.RegisterContextMenuShownCallback(SwigCPtr, new HandleRef(this, ip));
737 /// Event for the ContextMenuHidden signal which can be used to subscribe or unsubscribe the event handler.<br />
738 /// This signal is emitted when context menu item is hidden.<br />
740 [EditorBrowsable(EditorBrowsableState.Never)]
741 public event EventHandler<WebViewContextMenuHiddenEventArgs> ContextMenuHidden
745 if (contextMenuHiddenEventHandler == null)
747 contextMenuHiddenCallback = OnContextMenuHidden;
748 IntPtr ip = Marshal.GetFunctionPointerForDelegate(contextMenuHiddenCallback);
749 Interop.WebView.RegisterContextMenuHiddenCallback(SwigCPtr, new HandleRef(this, ip));
751 contextMenuHiddenEventHandler += value;
755 contextMenuHiddenEventHandler -= value;
756 if (contextMenuHiddenEventHandler == null)
758 IntPtr ip = IntPtr.Zero;
759 Interop.WebView.RegisterContextMenuHiddenCallback(SwigCPtr, new HandleRef(this, ip));
765 /// Options for searching texts.
767 [EditorBrowsable(EditorBrowsableState.Never)]
768 public enum FindOption
773 [EditorBrowsable(EditorBrowsableState.Never)]
777 /// Case insensitive search
779 [EditorBrowsable(EditorBrowsableState.Never)]
780 CaseInsensitive = 1 << 0,
783 /// Search text only at the beginning of the words
785 [EditorBrowsable(EditorBrowsableState.Never)]
786 AtWordStart = 1 << 1,
789 /// Treat capital letters in the middle of words as word start
791 [EditorBrowsable(EditorBrowsableState.Never)]
792 TreatMediaCapitalAsWordStart = 1 << 2,
797 [EditorBrowsable(EditorBrowsableState.Never)]
801 /// If not present the search stops at the end of the document
803 [EditorBrowsable(EditorBrowsableState.Never)]
809 [EditorBrowsable(EditorBrowsableState.Never)]
810 ShowOverlay = 1 << 5,
815 [EditorBrowsable(EditorBrowsableState.Never)]
816 ShowFindIndiator = 1 << 6,
821 [EditorBrowsable(EditorBrowsableState.Never)]
822 ShowHighlight = 1 << 7,
826 /// Enumeration for mode of hit test.
828 [EditorBrowsable(EditorBrowsableState.Never)]
829 public enum HitTestMode
834 [EditorBrowsable(EditorBrowsableState.Never)]
838 /// Extra node data(tag name, node value, attribute infomation, etc).
840 [EditorBrowsable(EditorBrowsableState.Never)]
844 /// Extra image data(image data, image data length, image file name exteionsion, etc).
846 [EditorBrowsable(EditorBrowsableState.Never)]
852 [EditorBrowsable(EditorBrowsableState.Never)]
853 All = Default | NodeData | ImageData,
859 [EditorBrowsable(EditorBrowsableState.Never)]
860 public WebContext Context => context;
865 [EditorBrowsable(EditorBrowsableState.Never)]
866 public WebCookieManager CookieManager => cookieManager;
871 [EditorBrowsable(EditorBrowsableState.Never)]
872 public WebBackForwardList BackForwardList { get; }
877 [EditorBrowsable(EditorBrowsableState.Never)]
878 public WebSettings Settings { get; }
883 /// <since_tizen> 9 </since_tizen>
888 return (string)GetValue(UrlProperty);
892 SetValue(UrlProperty, value);
893 NotifyPropertyChanged();
898 /// Deprecated. The cache model of the current WebView.
900 [EditorBrowsable(EditorBrowsableState.Never)]
901 public CacheModel CacheModel
905 return (CacheModel)GetValue(CacheModelProperty);
909 SetValue(CacheModelProperty, value);
910 NotifyPropertyChanged();
914 private CacheModel InternalCacheModel
918 return (CacheModel)Context.CacheModel;
922 Context.CacheModel = (WebContext.CacheModelType)value;
927 /// Deprecated. The cookie acceptance policy.
929 [EditorBrowsable(EditorBrowsableState.Never)]
930 public CookieAcceptPolicy CookieAcceptPolicy
934 return (CookieAcceptPolicy)GetValue(CookieAcceptPolicyProperty);
938 SetValue(CookieAcceptPolicyProperty, value);
939 NotifyPropertyChanged();
943 private CookieAcceptPolicy InternalCookieAcceptPolicy
947 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
951 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
956 /// The user agent string.
958 /// <since_tizen> 9 </since_tizen>
959 public string UserAgent
963 return (string)GetValue(UserAgentProperty);
967 SetValue(UserAgentProperty, value);
968 NotifyPropertyChanged();
973 /// Deprecated. Whether JavaScript is enabled.
975 [EditorBrowsable(EditorBrowsableState.Never)]
976 public bool EnableJavaScript
980 return (bool)GetValue(EnableJavaScriptProperty);
984 SetValue(EnableJavaScriptProperty, value);
985 NotifyPropertyChanged();
989 private bool InternalEnableJavaScript
993 return Settings.JavaScriptEnabled;
997 Settings.JavaScriptEnabled = value;
1002 /// Deprecated. Whether images can be loaded automatically.
1004 [EditorBrowsable(EditorBrowsableState.Never)]
1005 public bool LoadImagesAutomatically
1009 return (bool)GetValue(LoadImagesAutomaticallyProperty);
1013 SetValue(LoadImagesAutomaticallyProperty, value);
1014 NotifyPropertyChanged();
1018 private bool InternalLoadImagesAutomatically
1022 return Settings.AutomaticImageLoadingAllowed;
1026 Settings.AutomaticImageLoadingAllowed = value;
1031 /// The default text encoding name.<br />
1032 /// e.g. "UTF-8"<br />
1034 [EditorBrowsable(EditorBrowsableState.Never)]
1035 public string DefaultTextEncodingName
1039 return GetValue(DefaultTextEncodingNameProperty) as string;
1043 SetValue(DefaultTextEncodingNameProperty, value);
1044 NotifyPropertyChanged();
1048 private string InternalDefaultTextEncodingName
1052 return Settings.DefaultTextEncodingName;
1056 Settings.DefaultTextEncodingName = value;
1061 /// The default font size in pixel.
1063 [EditorBrowsable(EditorBrowsableState.Never)]
1064 public int DefaultFontSize
1068 return (int)GetValue(DefaultFontSizeProperty);
1072 SetValue(DefaultFontSizeProperty, value);
1073 NotifyPropertyChanged();
1077 private int InternalDefaultFontSize
1081 return Settings.DefaultFontSize;
1085 Settings.DefaultFontSize = value;
1090 /// The position of scroll.
1092 [EditorBrowsable(EditorBrowsableState.Never)]
1093 public Position ScrollPosition
1097 return GetValue(ScrollPositionProperty) as Position;
1101 SetValue(ScrollPositionProperty, value);
1105 private Position InternalScrollPosition
1109 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
1110 return new Position(pv.X, pv.Y);
1116 Position pv = value;
1117 Vector2 vpv = new Vector2(pv.X, pv.Y);
1118 SetValue(ScrollPositionProperty, vpv);
1119 NotifyPropertyChanged();
1125 /// The size of scroll, read-only.
1127 [EditorBrowsable(EditorBrowsableState.Never)]
1128 public Size ScrollSize
1132 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
1133 return new Size(sv.Width, sv.Height);
1138 /// The size of content, read-only.
1140 [EditorBrowsable(EditorBrowsableState.Never)]
1141 public Size ContentSize
1145 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
1146 return new Size(sv.Width, sv.Height);
1151 /// Whether video hole is enabled or not.
1153 [EditorBrowsable(EditorBrowsableState.Never)]
1154 public bool VideoHoleEnabled
1158 return (bool)GetValue(VideoHoleEnabledProperty);
1162 SetValue(VideoHoleEnabledProperty, value);
1163 NotifyPropertyChanged();
1168 /// Whether mouse events are enabled or not.
1170 [EditorBrowsable(EditorBrowsableState.Never)]
1171 public bool MouseEventsEnabled
1175 return (bool)GetValue(MouseEventsEnabledProperty);
1179 SetValue(MouseEventsEnabledProperty, value);
1180 NotifyPropertyChanged();
1185 /// Whether key events are enabled or not.
1187 [EditorBrowsable(EditorBrowsableState.Never)]
1188 public bool KeyEventsEnabled
1192 return (bool)GetValue(KeyEventsEnabledProperty);
1196 SetValue(KeyEventsEnabledProperty, value);
1197 NotifyPropertyChanged();
1202 /// Background color of web page.
1203 /// Please note that it only works after LoadUrl, etc.
1205 [EditorBrowsable(EditorBrowsableState.Never)]
1206 public Color ContentBackgroundColor
1210 return (Color)GetValue(ContentBackgroundColorProperty);
1214 SetValue(ContentBackgroundColorProperty, value);
1215 NotifyPropertyChanged();
1220 /// Whether tiles are cleared or not when hidden.
1222 [EditorBrowsable(EditorBrowsableState.Never)]
1223 public bool TilesClearedWhenHidden
1227 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1231 SetValue(TilesClearedWhenHiddenProperty, value);
1232 NotifyPropertyChanged();
1237 /// Multiplier of cover area of tile when web page is rendered.
1239 [EditorBrowsable(EditorBrowsableState.Never)]
1240 public float TileCoverAreaMultiplier
1244 return (float)GetValue(TileCoverAreaMultiplierProperty);
1248 SetValue(TileCoverAreaMultiplierProperty, value);
1249 NotifyPropertyChanged();
1254 /// Whether cursor is enabled or not by client.
1256 [EditorBrowsable(EditorBrowsableState.Never)]
1257 public bool CursorEnabledByClient
1261 return (bool)GetValue(CursorEnabledByClientProperty);
1265 SetValue(CursorEnabledByClientProperty, value);
1266 NotifyPropertyChanged();
1271 /// Gets selected text in web page.
1273 [EditorBrowsable(EditorBrowsableState.Never)]
1274 public string SelectedText
1278 return (string)GetValue(SelectedTextProperty);
1283 /// Gets title of web page.
1285 /// <since_tizen> 9 </since_tizen>
1290 return (string)GetValue(TitleProperty);
1295 /// Gets favicon of web page.
1297 /// <since_tizen> 9 </since_tizen>
1298 public ImageView Favicon
1302 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1303 if (imageView == IntPtr.Zero)
1305 return new ImageView(imageView, false);
1310 /// Zoom factor of web page.
1312 [EditorBrowsable(EditorBrowsableState.Never)]
1313 public float PageZoomFactor
1317 return (float)GetValue(PageZoomFactorProperty);
1321 SetValue(PageZoomFactorProperty, value);
1322 NotifyPropertyChanged();
1327 /// Zoom factor of text in web page.
1329 [EditorBrowsable(EditorBrowsableState.Never)]
1330 public float TextZoomFactor
1334 return (float)GetValue(TextZoomFactorProperty);
1338 SetValue(TextZoomFactorProperty, value);
1339 NotifyPropertyChanged();
1344 /// Gets percentage of loading progress.
1346 /// <since_tizen> 9 </since_tizen>
1347 public float LoadProgressPercentage
1351 return (float)GetValue(LoadProgressPercentageProperty);
1355 internal static new class Property
1357 internal static readonly int Url = Interop.WebView.UrlGet();
1358 internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
1359 internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
1360 internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
1361 internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
1362 internal static readonly int Title = Interop.WebView.TitleGet();
1363 internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
1364 internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
1365 internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
1366 internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
1367 internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
1368 internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
1369 internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
1370 internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
1371 internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
1372 internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
1373 internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
1376 private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1378 var webview = (WebView)bindable;
1379 if (newValue != null)
1381 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1384 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1386 var webview = (WebView)bindable;
1388 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1392 private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1394 var webview = (WebView)bindable;
1395 if (newValue != null)
1397 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1400 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1402 var webview = (WebView)bindable;
1404 Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1408 private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1410 var webview = (WebView)bindable;
1411 if (newValue != null)
1413 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1416 defaultValueCreator: (bindable) =>
1418 var webview = (WebView)bindable;
1419 Vector2 temp = new Vector2(0.0f, 0.0f);
1420 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
1424 private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1426 var webview = (WebView)bindable;
1427 Vector2 temp = new Vector2(0.0f, 0.0f);
1428 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
1432 private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1434 var webview = (WebView)bindable;
1435 Vector2 temp = new Vector2(0.0f, 0.0f);
1436 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
1440 private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1442 var webview = (WebView)bindable;
1444 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1448 private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1450 var webview = (WebView)bindable;
1451 if (newValue != null)
1453 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1456 defaultValueCreator: (bindable) =>
1458 var webview = (WebView)bindable;
1460 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1464 private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1466 var webview = (WebView)bindable;
1467 if (newValue != null)
1469 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1472 defaultValueCreator: (bindable) =>
1474 var webview = (WebView)bindable;
1476 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1480 private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1482 var webview = (WebView)bindable;
1483 if (newValue != null)
1485 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1488 defaultValueCreator: (bindable) =>
1490 var webview = (WebView)bindable;
1492 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1496 private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1498 var webview = (WebView)bindable;
1499 if (newValue != null)
1501 webview.contentBackgroundColor = (Color)newValue;
1502 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1505 defaultValueCreator: (bindable) =>
1507 var webview = (WebView)bindable;
1508 return webview.contentBackgroundColor;
1511 private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1513 var webview = (WebView)bindable;
1514 if (newValue != null)
1516 webview.tilesClearedWhenHidden = (bool)newValue;
1517 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1520 defaultValueCreator: (bindable) =>
1522 var webview = (WebView)bindable;
1523 return webview.tilesClearedWhenHidden;
1526 private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1528 var webview = (WebView)bindable;
1529 if (newValue != null)
1531 webview.tileCoverAreaMultiplier = (float)newValue;
1532 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1535 defaultValueCreator: (bindable) =>
1537 var webview = (WebView)bindable;
1538 return webview.tileCoverAreaMultiplier;
1541 private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1543 var webview = (WebView)bindable;
1544 if (newValue != null)
1546 webview.cursorEnabledByClient = (bool)newValue;
1547 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1550 defaultValueCreator: (bindable) =>
1552 var webview = (WebView)bindable;
1553 return webview.cursorEnabledByClient;
1556 private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1558 var webview = (WebView)bindable;
1560 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1564 private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1566 var webview = (WebView)bindable;
1567 if (newValue != null)
1569 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1572 defaultValueCreator: (bindable) =>
1574 var webview = (WebView)bindable;
1576 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1580 private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1582 var webview = (WebView)bindable;
1583 if (newValue != null)
1585 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1588 defaultValueCreator: (bindable) =>
1590 var webview = (WebView)bindable;
1592 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1596 private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1598 var webview = (WebView)bindable;
1600 Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1604 // For rooting handlers
1605 internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1610 /// <param name="url">The path of Web</param>
1612 /// The following privileges are required:
1613 /// http://tizen.org/privilege/internet for remote web pages of websites.
1614 /// http://tizen.org/privilege/mediastorage for local files in media storage.
1615 /// http://tizen.org/privilege/externalstorage for local files in external storage.
1617 /// <since_tizen> 9 </since_tizen>
1618 public void LoadUrl(string url)
1620 Interop.WebView.LoadUrl(SwigCPtr, url);
1621 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1625 /// Deprecated. Loads a html by string.
1627 /// <param name="data">The data of Web</param>
1628 [EditorBrowsable(EditorBrowsableState.Never)]
1629 public void LoadHTMLString(string data)
1631 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1632 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1636 /// Loads a html by string.
1638 /// <param name="data">The data of Web</param>
1639 /// <since_tizen> 9 </since_tizen>
1640 public void LoadHtmlString(string data)
1642 Interop.WebView.LoadHtmlString(SwigCPtr, data);
1643 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1647 /// Loads the specified html as the content of the view to override current history entry.
1649 /// <param name="html">The html to be loaded</param>
1650 /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1651 /// <param name="unreachableUri">URL that could not be reached</param>
1652 [EditorBrowsable(EditorBrowsableState.Never)]
1653 public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1655 bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1661 /// Requests to load the given contents by MIME type.
1663 /// <param name="contents">The contents to be loaded in bytes</param>
1664 /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1665 /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1666 /// <param name="baseUri">The base URI to use for relative resources</param>
1667 [EditorBrowsable(EditorBrowsableState.Never)]
1668 public bool LoadContents(byte[] contents, string mimeType, string encoding, string baseUri)
1670 int length = contents != null ? contents.Length : 0;
1671 bool result = Interop.WebView.LoadContents(SwigCPtr, contents, (uint)length, mimeType, encoding, baseUri);
1672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1677 /// Requests to load the given contents by MIME type.
1679 /// <param name="contents">The contents to be loaded. For UTF-8 encoding, contents would be got like System.Text.Encoding.UTF8.GetString(...)</param>
1680 /// <param name="contentSize">The size of contents (in bytes)</param>
1681 /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1682 /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1683 /// <param name="baseUri">The base URI to use for relative resources</param>
1684 [EditorBrowsable(EditorBrowsableState.Never)]
1685 public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1687 bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1695 [EditorBrowsable(EditorBrowsableState.Never)]
1696 public void Reload()
1698 Interop.WebView.Reload(SwigCPtr);
1699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1703 /// Reloads the current page's document without cache
1705 [EditorBrowsable(EditorBrowsableState.Never)]
1706 public bool ReloadWithoutCache()
1708 bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1709 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1714 /// Stops loading the Web
1716 [EditorBrowsable(EditorBrowsableState.Never)]
1717 public void StopLoading()
1719 Interop.WebView.StopLoading(SwigCPtr);
1720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1724 /// Suspends the operation.
1726 [EditorBrowsable(EditorBrowsableState.Never)]
1727 public void Suspend()
1729 Interop.WebView.Suspend(SwigCPtr);
1730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1734 /// Resumes the operation after calling Suspend()
1736 [EditorBrowsable(EditorBrowsableState.Never)]
1737 public void Resume()
1739 Interop.WebView.Resume(SwigCPtr);
1740 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1744 /// Suspends all network loading.
1746 [EditorBrowsable(EditorBrowsableState.Never)]
1747 public void SuspendNetworkLoading()
1749 Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1750 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1754 /// Resumes all network loading.
1756 [EditorBrowsable(EditorBrowsableState.Never)]
1757 public void ResumeNetworkLoading()
1759 Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1760 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1764 /// Adds custom header.
1766 /// <param name="name">The name of custom header</param>
1767 /// <param name="value">The value of custom header</param>
1768 [EditorBrowsable(EditorBrowsableState.Never)]
1769 public bool AddCustomHeader(string name, string value)
1771 bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1772 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1777 /// Removes custom header.
1779 /// <param name="name">The name of custom header</param>
1780 [EditorBrowsable(EditorBrowsableState.Never)]
1781 public bool RemoveCustomHeader(string name)
1783 bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1789 /// Starts the inspector server.
1791 /// <param name="port">The port number</param>
1792 [EditorBrowsable(EditorBrowsableState.Never)]
1793 public uint StartInspectorServer(uint port)
1795 uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1796 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1801 /// Stops the inspector server.
1803 [EditorBrowsable(EditorBrowsableState.Never)]
1804 public bool StopInspectorServer()
1806 bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1807 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1812 /// Scrolls page of web view by deltaX and detlaY.
1814 /// <param name="deltaX">The deltaX of scroll</param>
1815 /// <param name="deltaY">The deltaY of scroll</param>
1816 [EditorBrowsable(EditorBrowsableState.Never)]
1817 public void ScrollBy(int deltaX, int deltaY)
1819 Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1820 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1824 /// Scrolls edge of web view by deltaX and deltaY.
1826 /// <param name="deltaX">The deltaX of scroll</param>
1827 /// <param name="deltaY">The deltaY of scroll</param>
1828 [EditorBrowsable(EditorBrowsableState.Never)]
1829 public bool ScrollEdgeBy(int deltaX, int deltaY)
1831 bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1837 /// Goes to the back
1839 [EditorBrowsable(EditorBrowsableState.Never)]
1840 public void GoBack()
1842 Interop.WebView.GoBack(SwigCPtr);
1843 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1847 /// Goes to the forward
1849 [EditorBrowsable(EditorBrowsableState.Never)]
1850 public void GoForward()
1852 Interop.WebView.GoForward(SwigCPtr);
1853 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1857 /// Returns whether backward is possible.
1859 /// <returns>True if backward is possible, false otherwise</returns>
1860 [EditorBrowsable(EditorBrowsableState.Never)]
1861 public bool CanGoBack()
1863 bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1864 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1869 /// Returns whether forward is possible.
1871 /// <returns>True if forward is possible, false otherwise</returns>
1872 [EditorBrowsable(EditorBrowsableState.Never)]
1873 public bool CanGoForward()
1875 bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1876 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1881 /// Evaluates JavaScript code represented as a string.
1883 /// <param name="script">The JavaScript code</param>
1884 [EditorBrowsable(EditorBrowsableState.Never)]
1885 public void EvaluateJavaScript(string script)
1887 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1892 /// Evaluates JavaScript code represented as a string.
1894 /// <param name="script">The JavaScript code</param>
1895 /// <param name="handler">The callback for result of JavaScript code evaluation</param>
1896 [EditorBrowsable(EditorBrowsableState.Never)]
1897 public void EvaluateJavaScript(string script, JavaScriptMessageHandler handler)
1899 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1900 Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(this, ip));
1901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1905 /// Add a message handler into the WebView.
1907 /// <param name="objectName">The name of exposed object</param>
1908 /// <param name="handler">The callback function</param>
1909 [EditorBrowsable(EditorBrowsableState.Never)]
1910 public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1912 if (handlerRootMap.ContainsKey(objectName))
1917 handlerRootMap.Add(objectName, handler);
1919 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1920 Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1922 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1926 /// Registers a callback for JS alert.
1928 /// <param name="callback">The callback function</param>
1929 [EditorBrowsable(EditorBrowsableState.Never)]
1930 public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1932 IntPtr ip = IntPtr.Zero;
1933 if (callback != null)
1935 ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1937 Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1938 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1942 /// Reply for alert popup.
1944 [EditorBrowsable(EditorBrowsableState.Never)]
1945 public void JavaScriptAlertReply()
1947 Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1948 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1952 /// Registers a callback for JS confirm.
1954 /// <param name="callback">The callback function</param>
1955 [EditorBrowsable(EditorBrowsableState.Never)]
1956 public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1958 IntPtr ip = IntPtr.Zero;
1959 if (callback != null)
1961 ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1963 Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1964 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1968 /// Reply for confirm popup.
1970 /// <param name="confirmed">Confirmed or not</param>
1971 [EditorBrowsable(EditorBrowsableState.Never)]
1972 public void JavaScriptConfirmReply(bool confirmed)
1974 Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1975 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1979 /// Registers a callback for JS promt.
1981 /// <param name="callback">The callback function</param>
1982 [EditorBrowsable(EditorBrowsableState.Never)]
1983 public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1985 IntPtr ip = IntPtr.Zero;
1986 if (callback != null)
1988 ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1990 Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1991 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1995 /// Reply for prompt popup.
1997 /// <param name="result">Text in prompt input field.</param>
1998 [EditorBrowsable(EditorBrowsableState.Never)]
1999 public void JavaScriptPromptReply(string result)
2001 Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
2002 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2006 /// Clears title resources of current WebView.
2008 [EditorBrowsable(EditorBrowsableState.Never)]
2009 public void ClearAllTilesResources()
2011 Interop.WebView.ClearAllTilesResources(SwigCPtr);
2012 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2016 /// Clears the history of current WebView.
2018 [EditorBrowsable(EditorBrowsableState.Never)]
2019 public void ClearHistory()
2021 Interop.WebView.ClearHistory(SwigCPtr);
2022 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2026 /// Scales the current page, centered at the given point.
2028 /// <param name="scaleFactor">The new factor to be scaled</param>
2029 /// <param name="point">The center coordinate</param>
2030 [EditorBrowsable(EditorBrowsableState.Never)]
2031 public void SetScaleFactor(float scaleFactor, Vector2 point)
2033 Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
2034 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2038 /// Gets the current scale factor of the page.
2040 [EditorBrowsable(EditorBrowsableState.Never)]
2041 public float GetScaleFactor()
2043 float result = Interop.WebView.GetScaleFactor(SwigCPtr);
2044 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2049 /// Requests to activate/deactivate the accessibility usage set by web app.
2051 /// <param name="activated">The new factor to be scaled</param>
2052 [EditorBrowsable(EditorBrowsableState.Never)]
2053 public void ActivateAccessibility(bool activated)
2055 Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
2056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2060 /// Searches and highlights the given string in the document.
2062 /// <param name="text">The text to be searched</param>
2063 /// <param name="options">The options to search</param>
2064 /// <param name="maxMatchCount">The maximum match count to search</param>
2065 [EditorBrowsable(EditorBrowsableState.Never)]
2066 public bool HighlightText(string text, FindOption options, uint maxMatchCount)
2068 bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
2069 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2074 /// Adds dynamic certificate path.
2076 /// <param name="host">Host that required client authentication</param>
2077 /// <param name="certPath">The file path stored certificate</param>
2078 [EditorBrowsable(EditorBrowsableState.Never)]
2079 public void AddDynamicCertificatePath(string host, string certPath)
2081 Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
2082 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2086 /// Get snapshot of the specified viewArea of page.
2088 /// <param name="viewArea">Host that required client authentication</param>
2089 /// <param name="scaleFactor">The file path stored certificate</param>
2090 [EditorBrowsable(EditorBrowsableState.Never)]
2091 public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
2093 IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
2094 ImageView imageView = new ImageView(image, true);
2095 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2100 /// Get snapshot of the specified viewArea of page.
2102 /// <param name="viewArea">Host that required client authentication</param>
2103 /// <param name="scaleFactor">The file path stored certificate</param>
2104 /// <param name="callback">The callback for getting screen shot</param>
2105 [EditorBrowsable(EditorBrowsableState.Never)]
2106 public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
2108 screenshotAcquiredCallback = callback;
2109 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(screenshotAcquiredProxyCallback);
2110 bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
2111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2116 /// Asynchronously requests to check if there is a video playing in the given view.
2118 /// <param name="callback">The callback called after checking if video is playing or not</param>
2119 [EditorBrowsable(EditorBrowsableState.Never)]
2120 public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
2122 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
2123 bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
2124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2129 /// Registers callback which will be called upon geolocation permission request.
2131 /// <param name="callback">The callback for requesting geolocation permission</param>
2132 [EditorBrowsable(EditorBrowsableState.Never)]
2133 public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
2135 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
2136 Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
2137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2141 /// Does hit test synchronously.
2143 /// <param name="x">the horizontal position to query</param>
2144 /// <param name="y">the vertical position to query</param>
2145 /// <param name="mode">the mode of hit test</param>
2146 [EditorBrowsable(EditorBrowsableState.Never)]
2147 public WebHitTestResult HitTest(int x, int y, HitTestMode mode)
2149 System.IntPtr result = Interop.WebView.CreateHitTest(SwigCPtr, x, y, (int)mode);
2150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2151 return new WebHitTestResult(result, true);
2155 /// Does hit test asynchronously.
2157 /// <param name="x">the horizontal position to query</param>
2158 /// <param name="y">the vertical position to query</param>
2159 /// <param name="mode">the mode of hit test</param>
2160 /// <param name="callback">the callback that is called after hit test is finished.</param>
2161 [EditorBrowsable(EditorBrowsableState.Never)]
2162 public bool HitTestAsynchronously(int x, int y, HitTestMode mode, HitTestFinishedCallback callback)
2164 hitTestFinishedCallback = callback;
2165 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(hitTestFinishedProxyCallback);
2166 bool result = Interop.WebView.CreateHitTestAsynchronously(SwigCPtr, x, y, (int)mode, new HandleRef(this, ip));
2167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2172 /// Deprecated. Clears the cache of current WebView.
2174 [EditorBrowsable(EditorBrowsableState.Never)]
2175 public void ClearCache()
2177 Context.ClearCache();
2181 /// Deprecated. Clears all the cookies of current WebView.
2183 [EditorBrowsable(EditorBrowsableState.Never)]
2184 public void ClearCookies()
2186 CookieManager.ClearCookies();
2190 /// Sets the tts focus to the webview.
2191 /// Please note that it only works when the webview does not have keyinput focus.
2192 /// If the webview has a keyinput focus, it also has tts focus so calling SetTtsFocus(false) is ignored.
2194 /// <param name="focused">Focused or not</param>
2195 [EditorBrowsable(EditorBrowsableState.Never)]
2196 public void SetTtsFocus(bool focused)
2198 Interop.WebView.SetTtsFocus(SwigCPtr, focused);
2199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2203 /// Get a plain text of current web page asynchronously.
2204 /// Please note that it gets plain text of currently loaded page so please call this method after page load finished.
2206 /// <param name="callback">The callback for getting plain text</param>
2207 [EditorBrowsable(EditorBrowsableState.Never)]
2208 public void GetPlainTextAsynchronously(PlainTextReceivedCallback callback)
2210 plainTextReceivedCallback = callback;
2211 System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(plainTextReceivedCallback);
2212 Interop.WebView.GetPlainTextAsynchronously(SwigCPtr, new HandleRef(this, ip));
2213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2216 internal static WebView DownCast(BaseHandle handle)
2218 WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2223 internal WebView Assign(WebView webView)
2225 WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2230 private void OnPageLoadStarted(string pageUrl)
2232 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2235 e.PageUrl = pageUrl;
2237 pageLoadStartedEventHandler?.Invoke(this, e);
2240 private void OnPageLoading(string pageUrl)
2242 pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2245 private void OnPageLoadFinished(string pageUrl)
2247 WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2250 e.PageUrl = pageUrl;
2252 pageLoadFinishedEventHandler?.Invoke(this, e);
2255 private void OnPageLoadError(IntPtr error)
2257 pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, true)));
2260 private void OnScrollEdgeReached(int edge)
2262 scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2265 private void OnUrlChanged(string pageUrl)
2267 urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2270 private void OnFormRepostPolicyDecided(IntPtr decision)
2272 formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, true)));
2275 private void OnFrameRendered()
2277 frameRenderedEventHandler?.Invoke(this, new EventArgs());
2280 private void OnScreenshotAcquired(IntPtr data)
2282 #pragma warning disable CA2000 // Dispose objects before losing scope
2283 screenshotAcquiredCallback?.Invoke(new ImageView(data, true));
2284 #pragma warning restore CA2000 // Dispose objects before losing scope
2287 private void OnResponsePolicyDecided(IntPtr maker)
2289 responsePolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2292 private void OnNavigationPolicyDecided(IntPtr maker)
2294 navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2297 private void OnNewWindowCreated(out IntPtr viewHandle)
2299 WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs());
2300 viewHandle = (IntPtr)view.SwigCPtr;
2303 private void OnCertificateConfirmed(IntPtr certificate)
2305 certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2308 private void OnSslCertificateChanged(IntPtr certificate)
2310 sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2313 private void OnHttpAuthRequested(IntPtr handler)
2315 httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, true)));
2318 private void OnConsoleMessageReceived(IntPtr message)
2320 consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, true)));
2323 private void OnContextMenuShown(IntPtr menu)
2325 contextMenuShownEventHandler?.Invoke(this, new WebViewContextMenuShownEventArgs(new WebContextMenu(menu, true)));
2328 private void OnContextMenuHidden(IntPtr menu)
2330 contextMenuHiddenEventHandler?.Invoke(this, new WebViewContextMenuHiddenEventArgs(new WebContextMenu(menu, true)));
2333 private void OnHitTestFinished(IntPtr test)
2335 #pragma warning disable CA2000 // Dispose objects before losing scope
2336 hitTestFinishedCallback?.Invoke(new WebHitTestResult(test, true));
2337 #pragma warning restore CA2000 // Dispose objects before losing scope