[NUI] Change all CallingConvention to `Cdecl`
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / WebView / WebView.cs
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using System.Runtime.InteropServices;
22 using Tizen.NUI.Binding;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// WebView allows presenting content with embedded web browser, both local files and remote websites.
28     /// </summary>
29     /// <since_tizen> 9 </since_tizen>
30     public partial class WebView : View
31     {
32         private static readonly WebContext context = new WebContext(Interop.WebView.GetWebContext(), false);
33         private static readonly WebCookieManager cookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(), false);
34
35         private Color contentBackgroundColor;
36         private bool tilesClearedWhenHidden;
37         private float tileCoverAreaMultiplier;
38         private bool cursorEnabledByClient;
39
40         private EventHandler<WebViewPageLoadEventArgs> pageLoadStartedEventHandler;
41         private WebViewPageLoadCallback pageLoadStartedCallback;
42
43         private EventHandler<WebViewPageLoadEventArgs> pageLoadingEventHandler;
44         private WebViewPageLoadCallback pageLoadingCallback;
45
46         private EventHandler<WebViewPageLoadEventArgs> pageLoadFinishedEventHandler;
47         private WebViewPageLoadCallback pageLoadFinishedCallback;
48
49         private EventHandler<WebViewPageLoadErrorEventArgs> pageLoadErrorEventHandler;
50         private WebViewPageLoadErrorCallback pageLoadErrorCallback;
51
52         private EventHandler<WebViewScrollEdgeReachedEventArgs> scrollEdgeReachedEventHandler;
53         private WebViewScrollEdgeReachedCallback scrollEdgeReachedCallback;
54
55         private EventHandler<WebViewUrlChangedEventArgs> urlChangedEventHandler;
56         private WebViewUrlChangedCallback urlChangedCallback;
57
58         private EventHandler<WebViewFormRepostPolicyDecidedEventArgs> formRepostPolicyDecidedEventHandler;
59         private WebViewFormRepostPolicyDecidedCallback formRepostPolicyDecidedCallback;
60
61         private EventHandler<EventArgs> frameRenderedEventHandler;
62         private WebViewFrameRenderedCallback frameRenderedCallback;
63
64         private ScreenshotAcquiredCallback screenshotAcquiredCallback;
65         private readonly WebViewScreenshotAcquiredProxyCallback screenshotAcquiredProxyCallback;
66
67         private HitTestFinishedCallback hitTestFinishedCallback;
68         private readonly WebViewHitTestFinishedProxyCallback hitTestFinishedProxyCallback;
69
70         private EventHandler<WebViewPolicyDecidedEventArgs> responsePolicyDecidedEventHandler;
71         private WebViewPolicyDecidedCallback responsePolicyDecidedCallback;
72
73         private EventHandler<WebViewPolicyDecidedEventArgs> navigationPolicyDecidedEventHandler;
74         private WebViewPolicyDecidedCallback navigationPolicyDecidedCallback;
75
76         private EventHandlerWithReturnType<object, EventArgs, WebView> newWindowCreatedEventHandler;
77         private WebViewNewWindowCreatedCallback newWindowCreatedCallback;
78
79         private EventHandler<WebViewCertificateReceivedEventArgs> certificateConfirmedEventHandler;
80         private WebViewCertificateReceivedCallback certificateConfirmedCallback;
81
82         private EventHandler<WebViewCertificateReceivedEventArgs> sslCertificateChangedEventHandler;
83         private WebViewCertificateReceivedCallback sslCertificateChangedCallback;
84
85         private EventHandler<WebViewHttpAuthRequestedEventArgs> httpAuthRequestedEventHandler;
86         private WebViewHttpAuthRequestedCallback httpAuthRequestedCallback;
87
88         private EventHandler<WebViewConsoleMessageReceivedEventArgs> consoleMessageReceivedEventHandler;
89         private WebViewConsoleMessageReceivedCallback consoleMessageReceivedCallback;
90
91         private EventHandler<WebViewContextMenuShownEventArgs> contextMenuShownEventHandler;
92         private WebViewContextMenuShownCallback contextMenuShownCallback;
93
94         private EventHandler<WebViewContextMenuHiddenEventArgs> contextMenuHiddenEventHandler;
95         private WebViewContextMenuHiddenCallback contextMenuHiddenCallback;
96
97         private PlainTextReceivedCallback plainTextReceivedCallback;
98
99
100         /// <summary>
101         /// Creates a WebView.
102         /// </summary>
103         /// <since_tizen> 9 </since_tizen>
104         public WebView() : this(Interop.WebView.New(), true)
105         {
106             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107         }
108
109         /// <summary>
110         /// Creates a WebView with locale and time-zone.
111         /// </summary>
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)
116         {
117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118         }
119
120         /// <summary>
121         /// Creates a WebView with an args list.
122         /// </summary>
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)
126         {
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128         }
129
130         /// <summary>
131         /// Copy constructor.
132         /// </summary>
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)
136         {
137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138         }
139
140         internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WebView.Upcast(cPtr), cMemoryOwn)
141         {
142             screenshotAcquiredProxyCallback = OnScreenshotAcquired;
143             hitTestFinishedProxyCallback = OnHitTestFinished;
144
145             BackForwardList = new WebBackForwardList(Interop.WebView.GetWebBackForwardList(SwigCPtr), false);
146             Settings = new WebSettings(Interop.WebView.GetWebSettings(SwigCPtr), false);
147         }
148
149         /// <summary>
150         /// Dispose for IDisposable pattern
151         /// </summary>
152         [EditorBrowsable(EditorBrowsableState.Never)]
153         protected override void Dispose(DisposeTypes type)
154         {
155             if (Disposed)
156             {
157                 return;
158             }
159
160             if (type == DisposeTypes.Explicit)
161             {
162                 //Called by User
163                 //Release your own managed resources here.
164                 //You should release all of your own disposable objects here.
165                 BackForwardList.Dispose();
166                 Settings.Dispose();
167             }
168
169             base.Dispose(type);
170         }
171
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)
176         {
177             Interop.WebView.DeleteWebView(swigCPtr);
178         }
179
180         /// <summary>
181         /// The callback function that is invoked when the message is received from the script.
182         /// </summary>
183         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
184         [EditorBrowsable(EditorBrowsableState.Never)]
185         public delegate void JavaScriptMessageHandler(string message);
186
187         /// <summary>
188         /// The callback function that is invoked when the message is received from the script.
189         /// </summary>
190         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
191         [EditorBrowsable(EditorBrowsableState.Never)]
192         public delegate void JavaScriptAlertCallback(string message);
193
194         /// <summary>
195         /// The callback function that is invoked when the message is received from the script.
196         /// </summary>
197         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
198         [EditorBrowsable(EditorBrowsableState.Never)]
199         public delegate void JavaScriptConfirmCallback(string message);
200
201         /// <summary>
202         /// The callback function that is invoked when the message is received from the script.
203         /// </summary>
204         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
205         [EditorBrowsable(EditorBrowsableState.Never)]
206         public delegate void JavaScriptPromptCallback(string message1, string message2);
207
208         /// <summary>
209         /// The callback function that is invoked when screen shot is acquired asynchronously.
210         /// </summary>
211         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
212         [EditorBrowsable(EditorBrowsableState.Never)]
213         public delegate void ScreenshotAcquiredCallback(ImageView image);
214
215         /// <summary>
216         /// The callback function that is invoked when video playing is checked asynchronously.
217         /// </summary>
218         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
219         [EditorBrowsable(EditorBrowsableState.Never)]
220         public delegate void VideoPlayingCallback(bool isPlaying);
221
222         /// <summary>
223         /// The callback function that is invoked when geolocation permission is requested.
224         /// </summary>
225         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
226         [EditorBrowsable(EditorBrowsableState.Never)]
227         public delegate void GeolocationPermissionCallback(string host, string protocol);
228
229         /// <summary>
230         /// The callback function that is invoked when hit test is finished.
231         /// </summary>
232         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
233         [EditorBrowsable(EditorBrowsableState.Never)]
234         public delegate void HitTestFinishedCallback(WebHitTestResult test);
235
236         /// <summary>
237         /// The callback function that is invoked when the plain text of the current page is received.
238         /// </summary>
239         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
240         [EditorBrowsable(EditorBrowsableState.Never)]
241         public delegate void PlainTextReceivedCallback(string plainText);
242
243         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
244         private delegate void WebViewPageLoadCallback(string pageUrl);
245
246         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
247         private delegate void WebViewPageLoadErrorCallback(IntPtr error);
248
249         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
250         private delegate void WebViewScrollEdgeReachedCallback(int edge);
251
252         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
253         private delegate void WebViewUrlChangedCallback(string pageUrl);
254
255         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
256         private delegate void WebViewFormRepostPolicyDecidedCallback(IntPtr maker);
257
258         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
259         private delegate void WebViewFrameRenderedCallback();
260
261         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
262         private delegate void WebViewScreenshotAcquiredProxyCallback(IntPtr data);
263
264         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
265         private delegate void WebViewHitTestFinishedProxyCallback(IntPtr data);
266
267         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
268         private delegate void WebViewPolicyDecidedCallback(IntPtr maker);
269
270         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
271         private delegate void WebViewNewWindowCreatedCallback(out IntPtr outView);
272
273         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
274         private delegate void WebViewCertificateReceivedCallback(IntPtr certificate);
275
276         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
277         private delegate void WebViewHttpAuthRequestedCallback(IntPtr handler);
278
279         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
280         private delegate void WebViewConsoleMessageReceivedCallback(IntPtr message);
281
282         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
283         private delegate void WebViewContextMenuShownCallback(IntPtr menu);
284
285         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
286         private delegate void WebViewContextMenuHiddenCallback(IntPtr menu);
287
288         /// <summary>
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 />
291         /// </summary>
292         /// <since_tizen> 9 </since_tizen>
293         public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
294         {
295             add
296             {
297                 if (pageLoadStartedEventHandler == null)
298                 {
299                     pageLoadStartedCallback = OnPageLoadStarted;
300                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadStartedCallback);
301                     Interop.WebView.RegisterPageLoadStartedCallback(SwigCPtr, new HandleRef(this, ip));
302                 }
303                 pageLoadStartedEventHandler += value;
304             }
305             remove
306             {
307                 pageLoadStartedEventHandler -= value;
308                 if (pageLoadStartedEventHandler == null)
309                 {
310                     IntPtr ip = IntPtr.Zero;
311                     Interop.WebView.RegisterPageLoadStartedCallback(SwigCPtr, new HandleRef(this, ip));
312                 }
313             }
314         }
315
316         /// <summary>
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 />
319         /// </summary>
320         /// <since_tizen> 9 </since_tizen>
321         public event EventHandler<WebViewPageLoadEventArgs> PageLoading
322         {
323             add
324             {
325                 if (pageLoadingEventHandler == null)
326                 {
327                     pageLoadingCallback = OnPageLoading;
328                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadingCallback);
329                     Interop.WebView.RegisterPageLoadInProgressCallback(SwigCPtr, new HandleRef(this, ip));
330                 }
331                 pageLoadingEventHandler += value;
332             }
333             remove
334             {
335                 pageLoadingEventHandler -= value;
336                 if (pageLoadingEventHandler == null)
337                 {
338                     IntPtr ip = IntPtr.Zero;
339                     Interop.WebView.RegisterPageLoadInProgressCallback(SwigCPtr, new HandleRef(this, ip));
340                 }
341             }
342         }
343
344         /// <summary>
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 />
347         /// </summary>
348         /// <since_tizen> 9 </since_tizen>
349         public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
350         {
351             add
352             {
353                 if (pageLoadFinishedEventHandler == null)
354                 {
355                     pageLoadFinishedCallback = (OnPageLoadFinished);
356                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadFinishedCallback);
357                     Interop.WebView.RegisterPageLoadFinishedCallback(SwigCPtr, new HandleRef(this, ip));
358                 }
359                 pageLoadFinishedEventHandler += value;
360             }
361             remove
362             {
363                 pageLoadFinishedEventHandler -= value;
364                 if (pageLoadFinishedEventHandler == null)
365                 {
366                     IntPtr ip = IntPtr.Zero;
367                     Interop.WebView.RegisterPageLoadFinishedCallback(SwigCPtr, new HandleRef(this, ip));
368                 }
369             }
370         }
371
372         /// <summary>
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 />
375         /// </summary>
376         /// <since_tizen> 9 </since_tizen>
377         public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
378         {
379             add
380             {
381                 if (pageLoadErrorEventHandler == null)
382                 {
383                     pageLoadErrorCallback = OnPageLoadError;
384                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(pageLoadErrorCallback);
385                     Interop.WebView.RegisterPageLoadErrorCallback(SwigCPtr, new HandleRef(this, ip));
386                 }
387                 pageLoadErrorEventHandler += value;
388             }
389             remove
390             {
391                 pageLoadErrorEventHandler -= value;
392                 if (pageLoadErrorEventHandler == null)
393                 {
394                     IntPtr ip = IntPtr.Zero;
395                     Interop.WebView.RegisterPageLoadErrorCallback(SwigCPtr, new HandleRef(this, ip));
396                 }
397             }
398         }
399
400         /// <summary>
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 />
403         /// </summary>
404         [EditorBrowsable(EditorBrowsableState.Never)]
405         public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
406         {
407             add
408             {
409                 if (scrollEdgeReachedEventHandler == null)
410                 {
411                     scrollEdgeReachedCallback = OnScrollEdgeReached;
412                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(scrollEdgeReachedCallback);
413                     Interop.WebView.RegisterScrollEdgeReachedCallback(SwigCPtr, new HandleRef(this, ip));
414                 }
415                 scrollEdgeReachedEventHandler += value;
416             }
417             remove
418             {
419                 scrollEdgeReachedEventHandler -= value;
420                 if (scrollEdgeReachedEventHandler == null)
421                 {
422                     IntPtr ip = IntPtr.Zero;
423                     Interop.WebView.RegisterScrollEdgeReachedCallback(SwigCPtr, new HandleRef(this, ip));
424                 }
425             }
426         }
427
428         /// <summary>
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 />
431         /// </summary>
432         [EditorBrowsable(EditorBrowsableState.Never)]
433         public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
434         {
435             add
436             {
437                 if (urlChangedEventHandler == null)
438                 {
439                     urlChangedCallback = OnUrlChanged;
440                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(urlChangedCallback);
441                     Interop.WebView.RegisterUrlChangedCallback(SwigCPtr, new HandleRef(this, ip));
442                 }
443                 urlChangedEventHandler += value;
444             }
445             remove
446             {
447                 urlChangedEventHandler -= value;
448                 if (urlChangedEventHandler == null)
449                 {
450                     IntPtr ip = IntPtr.Zero;
451                     Interop.WebView.RegisterUrlChangedCallback(SwigCPtr, new HandleRef(this, ip));
452                 }
453             }
454         }
455
456         /// <summary>
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 />
459         /// </summary>
460         [EditorBrowsable(EditorBrowsableState.Never)]
461         public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
462         {
463             add
464             {
465                 if (formRepostPolicyDecidedEventHandler == null)
466                 {
467                     formRepostPolicyDecidedCallback = OnFormRepostPolicyDecided;
468                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(formRepostPolicyDecidedCallback);
469                     Interop.WebView.RegisterFormRepostDecidedCallback(SwigCPtr, new HandleRef(this, ip));
470                 }
471                 formRepostPolicyDecidedEventHandler += value;
472             }
473             remove
474             {
475                 formRepostPolicyDecidedEventHandler -= value;
476                 if (formRepostPolicyDecidedEventHandler == null)
477                 {
478                     IntPtr ip = IntPtr.Zero;
479                     Interop.WebView.RegisterFormRepostDecidedCallback(SwigCPtr, new HandleRef(this, ip));
480                 }
481             }
482         }
483
484         /// <summary>
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 />
487         /// </summary>
488         [EditorBrowsable(EditorBrowsableState.Never)]
489         public event EventHandler<EventArgs> FrameRendered
490         {
491             add
492             {
493                 if (frameRenderedEventHandler == null)
494                 {
495                     frameRenderedCallback = OnFrameRendered;
496                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(frameRenderedCallback);
497                     Interop.WebView.RegisterFrameRenderedCallback(SwigCPtr, new HandleRef(this, ip));
498                 }
499                 frameRenderedEventHandler += value;
500             }
501             remove
502             {
503                 frameRenderedEventHandler -= value;
504                 if (frameRenderedEventHandler == null)
505                 {
506                     IntPtr ip = IntPtr.Zero;
507                     Interop.WebView.RegisterFrameRenderedCallback(SwigCPtr, new HandleRef(this, ip));
508                 }
509             }
510         }
511
512         /// <summary>
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 />
515         /// </summary>
516         [EditorBrowsable(EditorBrowsableState.Never)]
517         public event EventHandler<WebViewPolicyDecidedEventArgs> ResponsePolicyDecided
518         {
519             add
520             {
521                 if (responsePolicyDecidedEventHandler == null)
522                 {
523                     responsePolicyDecidedCallback = OnResponsePolicyDecided;
524                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(responsePolicyDecidedCallback);
525                     Interop.WebView.RegisterResponsePolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
526                 }
527                 responsePolicyDecidedEventHandler += value;
528             }
529             remove
530             {
531                 responsePolicyDecidedEventHandler -= value;
532                 if (responsePolicyDecidedEventHandler == null)
533                 {
534                     IntPtr ip = IntPtr.Zero;
535                     Interop.WebView.RegisterResponsePolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
536                 }
537             }
538         }
539
540         /// <summary>
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 />
543         /// </summary>
544         [EditorBrowsable(EditorBrowsableState.Never)]
545         public event EventHandler<WebViewPolicyDecidedEventArgs> NavigationPolicyDecided
546         {
547             add
548             {
549                 if (navigationPolicyDecidedEventHandler == null)
550                 {
551                     navigationPolicyDecidedCallback = OnNavigationPolicyDecided;
552                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(navigationPolicyDecidedCallback);
553                     Interop.WebView.RegisterNavigationPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
554                 }
555                 navigationPolicyDecidedEventHandler += value;
556             }
557             remove
558             {
559                 navigationPolicyDecidedEventHandler -= value;
560                 if (navigationPolicyDecidedEventHandler == null)
561                 {
562                     IntPtr ip = IntPtr.Zero;
563                     Interop.WebView.RegisterNavigationPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
564                 }
565             }
566         }
567
568         /// <summary>
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 />
571         /// </summary>
572         [EditorBrowsable(EditorBrowsableState.Never)]
573         public event EventHandlerWithReturnType<object, EventArgs, WebView> NewWindowCreated
574         {
575             add
576             {
577                 if (newWindowCreatedEventHandler == null)
578                 {
579                     newWindowCreatedCallback = OnNewWindowCreated;
580                     System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(newWindowCreatedCallback);
581                     Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip));
582                 }
583                 newWindowCreatedEventHandler += value;
584             }
585             remove
586             {
587                 newWindowCreatedEventHandler -= value;
588                 if (newWindowCreatedEventHandler == null)
589                 {
590                     IntPtr ip = IntPtr.Zero;
591                     Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip));
592                 }
593             }
594         }
595
596         /// <summary>
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 />
599         /// </summary>
600         [EditorBrowsable(EditorBrowsableState.Never)]
601         public event EventHandler<WebViewCertificateReceivedEventArgs> CertificateConfirmed
602         {
603             add
604             {
605                 if (certificateConfirmedEventHandler == null)
606                 {
607                     certificateConfirmedCallback = OnCertificateConfirmed;
608                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(certificateConfirmedCallback);
609                     Interop.WebView.RegisterCertificateConfirmedCallback(SwigCPtr, new HandleRef(this, ip));
610                 }
611                 certificateConfirmedEventHandler += value;
612             }
613             remove
614             {
615                 certificateConfirmedEventHandler -= value;
616                 if (certificateConfirmedEventHandler == null)
617                 {
618                     IntPtr ip = IntPtr.Zero;
619                     Interop.WebView.RegisterCertificateConfirmedCallback(SwigCPtr, new HandleRef(this, ip));
620                 }
621             }
622         }
623
624         /// <summary>
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 />
627         /// </summary>
628         [EditorBrowsable(EditorBrowsableState.Never)]
629         public event EventHandler<WebViewCertificateReceivedEventArgs> SslCertificateChanged
630         {
631             add
632             {
633                 if (sslCertificateChangedEventHandler == null)
634                 {
635                     sslCertificateChangedCallback = OnSslCertificateChanged;
636                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(sslCertificateChangedCallback);
637                     Interop.WebView.RegisterSslCertificateChangedCallback(SwigCPtr, new HandleRef(this, ip));
638                 }
639                 sslCertificateChangedEventHandler += value;
640             }
641             remove
642             {
643                 sslCertificateChangedEventHandler -= value;
644                 if (sslCertificateChangedEventHandler == null)
645                 {
646                     IntPtr ip = IntPtr.Zero;
647                     Interop.WebView.RegisterSslCertificateChangedCallback(SwigCPtr, new HandleRef(this, ip));
648                 }
649             }
650         }
651
652         /// <summary>
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 />
655         /// </summary>
656         [EditorBrowsable(EditorBrowsableState.Never)]
657         public event EventHandler<WebViewHttpAuthRequestedEventArgs> HttpAuthRequested
658         {
659             add
660             {
661                 if (httpAuthRequestedEventHandler == null)
662                 {
663                     httpAuthRequestedCallback = OnHttpAuthRequested;
664                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(httpAuthRequestedCallback);
665                     Interop.WebView.RegisterHttpAuthHandlerCallback(SwigCPtr, new HandleRef(this, ip));
666                 }
667                 httpAuthRequestedEventHandler += value;
668             }
669             remove
670             {
671                 httpAuthRequestedEventHandler -= value;
672                 if (httpAuthRequestedEventHandler == null)
673                 {
674                     IntPtr ip = IntPtr.Zero;
675                     Interop.WebView.RegisterHttpAuthHandlerCallback(SwigCPtr, new HandleRef(this, ip));
676                 }
677             }
678         }
679
680         /// <summary>
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 />
683         /// </summary>
684         [EditorBrowsable(EditorBrowsableState.Never)]
685         public event EventHandler<WebViewConsoleMessageReceivedEventArgs> ConsoleMessageReceived
686         {
687             add
688             {
689                 if (consoleMessageReceivedEventHandler == null)
690                 {
691                     consoleMessageReceivedCallback = OnConsoleMessageReceived;
692                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(consoleMessageReceivedCallback);
693                     Interop.WebView.RegisterConsoleMessageReceivedCallback(SwigCPtr, new HandleRef(this, ip));
694                 }
695                 consoleMessageReceivedEventHandler += value;
696             }
697             remove
698             {
699                 consoleMessageReceivedEventHandler -= value;
700                 if (consoleMessageReceivedEventHandler == null)
701                 {
702                     IntPtr ip = IntPtr.Zero;
703                     Interop.WebView.RegisterConsoleMessageReceivedCallback(SwigCPtr, new HandleRef(this, ip));
704                 }
705             }
706         }
707
708         /// <summary>
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 />
711         /// </summary>
712         [EditorBrowsable(EditorBrowsableState.Never)]
713         public event EventHandler<WebViewContextMenuShownEventArgs> ContextMenuShown
714         {
715             add
716             {
717                 if (contextMenuShownEventHandler == null)
718                 {
719                     contextMenuShownCallback = OnContextMenuShown;
720                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(contextMenuShownCallback);
721                     Interop.WebView.RegisterContextMenuShownCallback(SwigCPtr, new HandleRef(this, ip));
722                 }
723                 contextMenuShownEventHandler += value;
724             }
725             remove
726             {
727                 contextMenuShownEventHandler -= value;
728                 if (contextMenuShownEventHandler == null)
729                 {
730                     IntPtr ip = IntPtr.Zero;
731                     Interop.WebView.RegisterContextMenuShownCallback(SwigCPtr, new HandleRef(this, ip));
732                 }
733             }
734         }
735
736         /// <summary>
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 />
739         /// </summary>
740         [EditorBrowsable(EditorBrowsableState.Never)]
741         public event EventHandler<WebViewContextMenuHiddenEventArgs> ContextMenuHidden
742         {
743             add
744             {
745                 if (contextMenuHiddenEventHandler == null)
746                 {
747                     contextMenuHiddenCallback = OnContextMenuHidden;
748                     IntPtr ip = Marshal.GetFunctionPointerForDelegate(contextMenuHiddenCallback);
749                     Interop.WebView.RegisterContextMenuHiddenCallback(SwigCPtr, new HandleRef(this, ip));
750                 }
751                 contextMenuHiddenEventHandler += value;
752             }
753             remove
754             {
755                 contextMenuHiddenEventHandler -= value;
756                 if (contextMenuHiddenEventHandler == null)
757                 {
758                     IntPtr ip = IntPtr.Zero;
759                     Interop.WebView.RegisterContextMenuHiddenCallback(SwigCPtr, new HandleRef(this, ip));
760                 }
761             }
762         }
763
764         /// <summary>
765         /// Options for searching texts.
766         /// </summary>
767         [EditorBrowsable(EditorBrowsableState.Never)]
768         public enum FindOption
769         {
770             /// <summary>
771             /// No search flags
772             /// </summary>
773             [EditorBrowsable(EditorBrowsableState.Never)]
774             None = 0,
775
776             /// <summary>
777             /// Case insensitive search
778             /// </summary>
779             [EditorBrowsable(EditorBrowsableState.Never)]
780             CaseInsensitive = 1 << 0,
781
782             /// <summary>
783             /// Search text only at the beginning of the words
784             /// </summary>
785             [EditorBrowsable(EditorBrowsableState.Never)]
786             AtWordStart = 1 << 1,
787
788             /// <summary>
789             /// Treat capital letters in the middle of words as word start
790             /// </summary>
791             [EditorBrowsable(EditorBrowsableState.Never)]
792             TreatMediaCapitalAsWordStart = 1 << 2,
793
794             /// <summary>
795             /// Search backwards
796             /// </summary>
797             [EditorBrowsable(EditorBrowsableState.Never)]
798             Backwards = 1 << 3,
799
800             /// <summary>
801             /// If not present the search stops at the end of the document
802             /// </summary>
803             [EditorBrowsable(EditorBrowsableState.Never)]
804             WrapAround = 1 << 4,
805
806             /// <summary>
807             /// Show overlay
808             /// </summary>
809             [EditorBrowsable(EditorBrowsableState.Never)]
810             ShowOverlay = 1 << 5,
811
812             /// <summary>
813             /// Show indicator
814             /// </summary>
815             [EditorBrowsable(EditorBrowsableState.Never)]
816             ShowFindIndiator = 1 << 6,
817
818             /// <summary>
819             /// Show highlight
820             /// </summary>
821             [EditorBrowsable(EditorBrowsableState.Never)]
822             ShowHighlight = 1 << 7,
823         }
824
825         /// <summary>
826         /// Enumeration for mode of hit test.
827         /// </summary>
828         [EditorBrowsable(EditorBrowsableState.Never)]
829         public enum HitTestMode
830         {
831             /// <summary>
832             /// Link data
833             /// </summary>
834             [EditorBrowsable(EditorBrowsableState.Never)]
835             Default = 1 << 1,
836
837             /// <summary>
838             /// Extra node data(tag name, node value, attribute infomation, etc).
839             /// </summary>
840             [EditorBrowsable(EditorBrowsableState.Never)]
841             NodeData = 1 << 2,
842
843             /// <summary>
844             /// Extra image data(image data, image data length, image file name exteionsion, etc).
845             /// </summary>
846             [EditorBrowsable(EditorBrowsableState.Never)]
847             ImageData = 1 << 3,
848
849             /// <summary>
850             /// All data
851             /// </summary>
852             [EditorBrowsable(EditorBrowsableState.Never)]
853             All = Default | NodeData | ImageData,
854         }
855
856         /// <summary>
857         /// Context.
858         /// </summary>
859         [EditorBrowsable(EditorBrowsableState.Never)]
860         public WebContext Context => context;
861
862         /// <summary>
863         /// CookieManager.
864         /// </summary>
865         [EditorBrowsable(EditorBrowsableState.Never)]
866         public WebCookieManager CookieManager => cookieManager;
867
868         /// <summary>
869         /// BackForwardList.
870         /// </summary>
871         [EditorBrowsable(EditorBrowsableState.Never)]
872         public WebBackForwardList BackForwardList { get; }
873
874         /// <summary>
875         /// BackForwardList.
876         /// </summary>
877         [EditorBrowsable(EditorBrowsableState.Never)]
878         public WebSettings Settings { get; }
879
880         /// <summary>
881         /// The URL to load.
882         /// </summary>
883         /// <since_tizen> 9 </since_tizen>
884         public string Url
885         {
886             get
887             {
888                 return (string)GetValue(UrlProperty);
889             }
890             set
891             {
892                 SetValue(UrlProperty, value);
893                 NotifyPropertyChanged();
894             }
895         }
896
897         /// <summary>
898         /// Deprecated. The cache model of the current WebView.
899         /// </summary>
900         [EditorBrowsable(EditorBrowsableState.Never)]
901         public CacheModel CacheModel
902         {
903             get
904             {
905                 return (CacheModel)GetValue(CacheModelProperty);
906             }
907             set
908             {
909                 SetValue(CacheModelProperty, value);
910                 NotifyPropertyChanged();
911             }
912         }
913
914         private CacheModel InternalCacheModel
915         {
916             get
917             {
918                 return (CacheModel)Context.CacheModel;
919             }
920             set
921             {
922                 Context.CacheModel = (WebContext.CacheModelType)value;
923             }
924         }
925
926         /// <summary>
927         /// Deprecated. The cookie acceptance policy.
928         /// </summary>
929         [EditorBrowsable(EditorBrowsableState.Never)]
930         public CookieAcceptPolicy CookieAcceptPolicy
931         {
932             get
933             {
934                 return (CookieAcceptPolicy)GetValue(CookieAcceptPolicyProperty);
935             }
936             set
937             {
938                 SetValue(CookieAcceptPolicyProperty, value);
939                 NotifyPropertyChanged();
940             }
941         }
942
943         private CookieAcceptPolicy InternalCookieAcceptPolicy
944         {
945             get
946             {
947                 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
948             }
949             set
950             {
951                 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
952             }
953         }
954
955         /// <summary>
956         /// The user agent string.
957         /// </summary>
958         /// <since_tizen> 9 </since_tizen>
959         public string UserAgent
960         {
961             get
962             {
963                 return (string)GetValue(UserAgentProperty);
964             }
965             set
966             {
967                 SetValue(UserAgentProperty, value);
968                 NotifyPropertyChanged();
969             }
970         }
971
972         /// <summary>
973         /// Deprecated. Whether JavaScript is enabled.
974         /// </summary>
975         [EditorBrowsable(EditorBrowsableState.Never)]
976         public bool EnableJavaScript
977         {
978             get
979             {
980                 return (bool)GetValue(EnableJavaScriptProperty);
981             }
982             set
983             {
984                 SetValue(EnableJavaScriptProperty, value);
985                 NotifyPropertyChanged();
986             }
987         }
988
989         private bool InternalEnableJavaScript
990         {
991             get
992             {
993                 return Settings.JavaScriptEnabled;
994             }
995             set
996             {
997                 Settings.JavaScriptEnabled = value;
998             }
999         }
1000
1001         /// <summary>
1002         /// Deprecated. Whether images can be loaded automatically.
1003         /// </summary>
1004         [EditorBrowsable(EditorBrowsableState.Never)]
1005         public bool LoadImagesAutomatically
1006         {
1007             get
1008             {
1009                 return (bool)GetValue(LoadImagesAutomaticallyProperty);
1010             }
1011             set
1012             {
1013                 SetValue(LoadImagesAutomaticallyProperty, value);
1014                 NotifyPropertyChanged();
1015             }
1016         }
1017
1018         private bool InternalLoadImagesAutomatically
1019         {
1020             get
1021             {
1022                 return Settings.AutomaticImageLoadingAllowed;
1023             }
1024             set
1025             {
1026                 Settings.AutomaticImageLoadingAllowed = value;
1027             }
1028         }
1029
1030         /// <summary>
1031         /// The default text encoding name.<br />
1032         /// e.g. "UTF-8"<br />
1033         /// </summary>
1034         [EditorBrowsable(EditorBrowsableState.Never)]
1035         public string DefaultTextEncodingName
1036         {
1037             get
1038             {
1039                 return GetValue(DefaultTextEncodingNameProperty) as string;
1040             }
1041             set
1042             {
1043                 SetValue(DefaultTextEncodingNameProperty, value);
1044                 NotifyPropertyChanged();
1045             }
1046         }
1047
1048         private string InternalDefaultTextEncodingName
1049         {
1050             get
1051             {
1052                 return Settings.DefaultTextEncodingName;
1053             }
1054             set
1055             {
1056                 Settings.DefaultTextEncodingName = value;
1057             }
1058         }
1059
1060         /// <summary>
1061         /// The default font size in pixel.
1062         /// </summary>
1063         [EditorBrowsable(EditorBrowsableState.Never)]
1064         public int DefaultFontSize
1065         {
1066             get
1067             {
1068                 return (int)GetValue(DefaultFontSizeProperty);
1069             }
1070             set
1071             {
1072                 SetValue(DefaultFontSizeProperty, value);
1073                 NotifyPropertyChanged();
1074             }
1075         }
1076
1077         private int InternalDefaultFontSize
1078         {
1079             get
1080             {
1081                 return Settings.DefaultFontSize;
1082             }
1083             set
1084             {
1085                 Settings.DefaultFontSize = value;
1086             }
1087         }
1088
1089         /// <summary>
1090         /// The position of scroll.
1091         /// </summary>
1092         [EditorBrowsable(EditorBrowsableState.Never)]
1093         public Position ScrollPosition
1094         {
1095             get
1096             {
1097                 return GetValue(ScrollPositionProperty) as Position;
1098             }
1099             set
1100             {
1101                 SetValue(ScrollPositionProperty, value);
1102             }
1103         }
1104
1105         private Position InternalScrollPosition
1106         {
1107             get
1108             {
1109                 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
1110                 return new Position(pv.X, pv.Y);
1111             }
1112             set
1113             {
1114                 if (value != null)
1115                 {
1116                     Position pv = value;
1117                     Vector2 vpv = new Vector2(pv.X, pv.Y);
1118                     SetValue(ScrollPositionProperty, vpv);
1119                     NotifyPropertyChanged();
1120                 }
1121             }
1122         }
1123
1124         /// <summary>
1125         /// The size of scroll, read-only.
1126         /// </summary>
1127         [EditorBrowsable(EditorBrowsableState.Never)]
1128         public Size ScrollSize
1129         {
1130             get
1131             {
1132                 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
1133                 return new Size(sv.Width, sv.Height);
1134             }
1135         }
1136
1137         /// <summary>
1138         /// The size of content, read-only.
1139         /// </summary>
1140         [EditorBrowsable(EditorBrowsableState.Never)]
1141         public Size ContentSize
1142         {
1143             get
1144             {
1145                 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
1146                 return new Size(sv.Width, sv.Height);
1147             }
1148         }
1149
1150         /// <summary>
1151         /// Whether video hole is enabled or not.
1152         /// </summary>
1153         [EditorBrowsable(EditorBrowsableState.Never)]
1154         public bool VideoHoleEnabled
1155         {
1156             get
1157             {
1158                 return (bool)GetValue(VideoHoleEnabledProperty);
1159             }
1160             set
1161             {
1162                 SetValue(VideoHoleEnabledProperty, value);
1163                 NotifyPropertyChanged();
1164             }
1165         }
1166
1167         /// <summary>
1168         /// Whether mouse events are enabled or not.
1169         /// </summary>
1170         [EditorBrowsable(EditorBrowsableState.Never)]
1171         public bool MouseEventsEnabled
1172         {
1173             get
1174             {
1175                 return (bool)GetValue(MouseEventsEnabledProperty);
1176             }
1177             set
1178             {
1179                 SetValue(MouseEventsEnabledProperty, value);
1180                 NotifyPropertyChanged();
1181             }
1182         }
1183
1184         /// <summary>
1185         /// Whether key events are enabled or not.
1186         /// </summary>
1187         [EditorBrowsable(EditorBrowsableState.Never)]
1188         public bool KeyEventsEnabled
1189         {
1190             get
1191             {
1192                 return (bool)GetValue(KeyEventsEnabledProperty);
1193             }
1194             set
1195             {
1196                 SetValue(KeyEventsEnabledProperty, value);
1197                 NotifyPropertyChanged();
1198             }
1199         }
1200
1201         /// <summary>
1202         /// Background color of web page.
1203         /// Please note that it only works after LoadUrl, etc.
1204         /// </summary>
1205         [EditorBrowsable(EditorBrowsableState.Never)]
1206         public Color ContentBackgroundColor
1207         {
1208             get
1209             {
1210                 return (Color)GetValue(ContentBackgroundColorProperty);
1211             }
1212             set
1213             {
1214                 SetValue(ContentBackgroundColorProperty, value);
1215                 NotifyPropertyChanged();
1216             }
1217         }
1218
1219         /// <summary>
1220         /// Whether tiles are cleared or not when hidden.
1221         /// </summary>
1222         [EditorBrowsable(EditorBrowsableState.Never)]
1223         public bool TilesClearedWhenHidden
1224         {
1225             get
1226             {
1227                 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1228             }
1229             set
1230             {
1231                 SetValue(TilesClearedWhenHiddenProperty, value);
1232                 NotifyPropertyChanged();
1233             }
1234         }
1235
1236         /// <summary>
1237         /// Multiplier of cover area of tile when web page is rendered.
1238         /// </summary>
1239         [EditorBrowsable(EditorBrowsableState.Never)]
1240         public float TileCoverAreaMultiplier
1241         {
1242             get
1243             {
1244                 return (float)GetValue(TileCoverAreaMultiplierProperty);
1245             }
1246             set
1247             {
1248                 SetValue(TileCoverAreaMultiplierProperty, value);
1249                 NotifyPropertyChanged();
1250             }
1251         }
1252
1253         /// <summary>
1254         /// Whether cursor is enabled or not by client.
1255         /// </summary>
1256         [EditorBrowsable(EditorBrowsableState.Never)]
1257         public bool CursorEnabledByClient
1258         {
1259             get
1260             {
1261                 return (bool)GetValue(CursorEnabledByClientProperty);
1262             }
1263             set
1264             {
1265                 SetValue(CursorEnabledByClientProperty, value);
1266                 NotifyPropertyChanged();
1267             }
1268         }
1269
1270         /// <summary>
1271         /// Gets selected text in web page.
1272         /// </summary>
1273         [EditorBrowsable(EditorBrowsableState.Never)]
1274         public string SelectedText
1275         {
1276             get
1277             {
1278                 return (string)GetValue(SelectedTextProperty);
1279             }
1280         }
1281
1282         /// <summary>
1283         /// Gets title of web page.
1284         /// </summary>
1285         /// <since_tizen> 9 </since_tizen>
1286         public string Title
1287         {
1288             get
1289             {
1290                 return (string)GetValue(TitleProperty);
1291             }
1292         }
1293
1294         /// <summary>
1295         /// Gets favicon of web page.
1296         /// </summary>
1297         /// <since_tizen> 9 </since_tizen>
1298         public ImageView Favicon
1299         {
1300             get
1301             {
1302                 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1303                 if (imageView == IntPtr.Zero)
1304                     return null;
1305                 return new ImageView(imageView, false);
1306             }
1307         }
1308
1309         /// <summary>
1310         /// Zoom factor of web page.
1311         /// </summary>
1312         [EditorBrowsable(EditorBrowsableState.Never)]
1313         public float PageZoomFactor
1314         {
1315             get
1316             {
1317                 return (float)GetValue(PageZoomFactorProperty);
1318             }
1319             set
1320             {
1321                 SetValue(PageZoomFactorProperty, value);
1322                 NotifyPropertyChanged();
1323             }
1324         }
1325
1326         /// <summary>
1327         /// Zoom factor of text in web page.
1328         /// </summary>
1329         [EditorBrowsable(EditorBrowsableState.Never)]
1330         public float TextZoomFactor
1331         {
1332             get
1333             {
1334                 return (float)GetValue(TextZoomFactorProperty);
1335             }
1336             set
1337             {
1338                 SetValue(TextZoomFactorProperty, value);
1339                 NotifyPropertyChanged();
1340             }
1341         }
1342
1343         /// <summary>
1344         /// Gets percentage of loading progress.
1345         /// </summary>
1346         /// <since_tizen> 9 </since_tizen>
1347         public float LoadProgressPercentage
1348         {
1349             get
1350             {
1351                 return (float)GetValue(LoadProgressPercentageProperty);
1352             }
1353         }
1354
1355         internal static new class Property
1356         {
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();
1374         }
1375
1376         private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1377         {
1378             var webview = (WebView)bindable;
1379             if (newValue != null)
1380             {
1381                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1382             }
1383         }),
1384         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1385         {
1386             var webview = (WebView)bindable;
1387             string temp;
1388             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1389             return temp;
1390         }));
1391
1392         private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1393         {
1394             var webview = (WebView)bindable;
1395             if (newValue != null)
1396             {
1397                 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1398             }
1399         }),
1400         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1401         {
1402             var webview = (WebView)bindable;
1403             string temp;
1404             Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1405             return temp;
1406         }));
1407
1408         private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1409         {
1410             var webview = (WebView)bindable;
1411             if (newValue != null)
1412             {
1413                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1414             }
1415         },
1416         defaultValueCreator: (bindable) =>
1417         {
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);
1421             return temp;
1422         });
1423
1424         private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1425         {
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);
1429             return temp;
1430         });
1431
1432         private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1433         {
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);
1437             return temp;
1438         });
1439
1440         private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1441         {
1442             var webview = (WebView)bindable;
1443             string title;
1444             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1445             return title;
1446         });
1447
1448         private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1449         {
1450             var webview = (WebView)bindable;
1451             if (newValue != null)
1452             {
1453                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1454             }
1455         },
1456         defaultValueCreator: (bindable) =>
1457         {
1458             var webview = (WebView)bindable;
1459             bool temp;
1460             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1461             return temp;
1462         });
1463
1464         private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1465         {
1466             var webview = (WebView)bindable;
1467             if (newValue != null)
1468             {
1469                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1470             }
1471         },
1472         defaultValueCreator: (bindable) =>
1473         {
1474             var webview = (WebView)bindable;
1475             bool temp;
1476             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1477             return temp;
1478         });
1479
1480         private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1481         {
1482             var webview = (WebView)bindable;
1483             if (newValue != null)
1484             {
1485                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1486             }
1487         },
1488         defaultValueCreator: (bindable) =>
1489         {
1490             var webview = (WebView)bindable;
1491             bool temp;
1492             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1493             return temp;
1494         });
1495
1496         private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1497         {
1498             var webview = (WebView)bindable;
1499             if (newValue != null)
1500             {
1501                 webview.contentBackgroundColor = (Color)newValue;
1502                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1503             }
1504         },
1505         defaultValueCreator: (bindable) =>
1506         {
1507             var webview = (WebView)bindable;
1508             return webview.contentBackgroundColor;
1509         });
1510
1511         private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1512         {
1513             var webview = (WebView)bindable;
1514             if (newValue != null)
1515             {
1516                 webview.tilesClearedWhenHidden = (bool)newValue;
1517                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1518             }
1519         },
1520         defaultValueCreator: (bindable) =>
1521         {
1522             var webview = (WebView)bindable;
1523             return webview.tilesClearedWhenHidden;
1524         });
1525
1526         private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1527         {
1528             var webview = (WebView)bindable;
1529             if (newValue != null)
1530             {
1531                 webview.tileCoverAreaMultiplier = (float)newValue;
1532                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1533             }
1534         },
1535         defaultValueCreator: (bindable) =>
1536         {
1537             var webview = (WebView)bindable;
1538             return webview.tileCoverAreaMultiplier;
1539         });
1540
1541         private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1542         {
1543             var webview = (WebView)bindable;
1544             if (newValue != null)
1545             {
1546                 webview.cursorEnabledByClient = (bool)newValue;
1547                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1548             }
1549         },
1550         defaultValueCreator: (bindable) =>
1551         {
1552             var webview = (WebView)bindable;
1553             return webview.cursorEnabledByClient;
1554         });
1555
1556         private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1557         {
1558             var webview = (WebView)bindable;
1559             string text;
1560             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1561             return text;
1562         });
1563
1564         private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1565         {
1566             var webview = (WebView)bindable;
1567             if (newValue != null)
1568             {
1569                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1570             }
1571         },
1572         defaultValueCreator: (bindable) =>
1573         {
1574             var webview = (WebView)bindable;
1575             float temp;
1576             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1577             return temp;
1578         });
1579
1580         private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1581         {
1582             var webview = (WebView)bindable;
1583             if (newValue != null)
1584             {
1585                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1586             }
1587         },
1588         defaultValueCreator: (bindable) =>
1589         {
1590             var webview = (WebView)bindable;
1591             float temp;
1592             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1593             return temp;
1594         });
1595
1596         private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1597         {
1598             var webview = (WebView)bindable;
1599             float percentage;
1600             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1601             return percentage;
1602         });
1603
1604         // For rooting handlers
1605         internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1606
1607         /// <summary>
1608         /// Loads a html.
1609         /// </summary>
1610         /// <param name="url">The path of Web</param>
1611         /// <remarks>
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.
1616         /// </remarks>
1617         /// <since_tizen> 9 </since_tizen>
1618         public void LoadUrl(string url)
1619         {
1620             Interop.WebView.LoadUrl(SwigCPtr, url);
1621             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1622         }
1623
1624         /// <summary>
1625         /// Deprecated. Loads a html by string.
1626         /// </summary>
1627         /// <param name="data">The data of Web</param>
1628         [EditorBrowsable(EditorBrowsableState.Never)]
1629         public void LoadHTMLString(string data)
1630         {
1631             Interop.WebView.LoadHtmlString(SwigCPtr, data);
1632             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1633         }
1634
1635         /// <summary>
1636         /// Loads a html by string.
1637         /// </summary>
1638         /// <param name="data">The data of Web</param>
1639         /// <since_tizen> 9 </since_tizen>
1640         public void LoadHtmlString(string data)
1641         {
1642             Interop.WebView.LoadHtmlString(SwigCPtr, data);
1643             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1644         }
1645
1646         /// <summary>
1647         /// Loads the specified html as the content of the view to override current history entry.
1648         /// </summary>
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)
1654         {
1655             bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1656             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1657             return result;
1658         }
1659
1660         /// <summary>
1661         /// Requests to load the given contents by MIME type.
1662         /// </summary>
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)
1669         {
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();
1673             return result;
1674         }
1675
1676         /// <summary>
1677         /// Requests to load the given contents by MIME type.
1678         /// </summary>
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)
1686         {
1687             bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1688             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1689             return result;
1690         }
1691
1692         /// <summary>
1693         /// Reloads the Web
1694         /// </summary>
1695         [EditorBrowsable(EditorBrowsableState.Never)]
1696         public void Reload()
1697         {
1698             Interop.WebView.Reload(SwigCPtr);
1699             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1700         }
1701
1702         /// <summary>
1703         /// Reloads the current page's document without cache
1704         /// </summary>
1705         [EditorBrowsable(EditorBrowsableState.Never)]
1706         public bool ReloadWithoutCache()
1707         {
1708             bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1709             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1710             return result;
1711         }
1712
1713         /// <summary>
1714         /// Stops loading the Web
1715         /// </summary>
1716         [EditorBrowsable(EditorBrowsableState.Never)]
1717         public void StopLoading()
1718         {
1719             Interop.WebView.StopLoading(SwigCPtr);
1720             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1721         }
1722
1723         /// <summary>
1724         /// Suspends the operation.
1725         /// </summary>
1726         [EditorBrowsable(EditorBrowsableState.Never)]
1727         public void Suspend()
1728         {
1729             Interop.WebView.Suspend(SwigCPtr);
1730             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1731         }
1732
1733         /// <summary>
1734         /// Resumes the operation after calling Suspend()
1735         /// </summary>
1736         [EditorBrowsable(EditorBrowsableState.Never)]
1737         public void Resume()
1738         {
1739             Interop.WebView.Resume(SwigCPtr);
1740             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1741         }
1742
1743         /// <summary>
1744         /// Suspends all network loading.
1745         /// </summary>
1746         [EditorBrowsable(EditorBrowsableState.Never)]
1747         public void SuspendNetworkLoading()
1748         {
1749             Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1750             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1751         }
1752
1753         /// <summary>
1754         /// Resumes all network loading.
1755         /// </summary>
1756         [EditorBrowsable(EditorBrowsableState.Never)]
1757         public void ResumeNetworkLoading()
1758         {
1759             Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1760             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1761         }
1762
1763         /// <summary>
1764         /// Adds custom header.
1765         /// </summary>
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)
1770         {
1771             bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1772             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1773             return result;
1774         }
1775
1776         /// <summary>
1777         /// Removes custom header.
1778         /// </summary>
1779         /// <param name="name">The name of custom header</param>
1780         [EditorBrowsable(EditorBrowsableState.Never)]
1781         public bool RemoveCustomHeader(string name)
1782         {
1783             bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1784             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1785             return result;
1786         }
1787
1788         /// <summary>
1789         /// Starts the inspector server.
1790         /// </summary>
1791         /// <param name="port">The port number</param>
1792         [EditorBrowsable(EditorBrowsableState.Never)]
1793         public uint StartInspectorServer(uint port)
1794         {
1795             uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1796             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1797             return result;
1798         }
1799
1800         /// <summary>
1801         /// Stops the inspector server.
1802         /// </summary>
1803         [EditorBrowsable(EditorBrowsableState.Never)]
1804         public bool StopInspectorServer()
1805         {
1806             bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1807             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1808             return result;
1809         }
1810
1811         /// <summary>
1812         /// Scrolls page of web view by deltaX and detlaY.
1813         /// </summary>
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)
1818         {
1819             Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1820             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1821         }
1822
1823         /// <summary>
1824         /// Scrolls edge of web view by deltaX and deltaY.
1825         /// </summary>
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)
1830         {
1831             bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1832             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1833             return result;
1834         }
1835
1836         /// <summary>
1837         /// Goes to the back
1838         /// </summary>
1839         [EditorBrowsable(EditorBrowsableState.Never)]
1840         public void GoBack()
1841         {
1842             Interop.WebView.GoBack(SwigCPtr);
1843             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1844         }
1845
1846         /// <summary>
1847         /// Goes to the forward
1848         /// </summary>
1849         [EditorBrowsable(EditorBrowsableState.Never)]
1850         public void GoForward()
1851         {
1852             Interop.WebView.GoForward(SwigCPtr);
1853             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1854         }
1855
1856         /// <summary>
1857         /// Returns whether backward is possible.
1858         /// </summary>
1859         /// <returns>True if backward is possible, false otherwise</returns>
1860         [EditorBrowsable(EditorBrowsableState.Never)]
1861         public bool CanGoBack()
1862         {
1863             bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1864             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1865             return ret;
1866         }
1867
1868         /// <summary>
1869         /// Returns whether forward is possible.
1870         /// </summary>
1871         /// <returns>True if forward is possible, false otherwise</returns>
1872         [EditorBrowsable(EditorBrowsableState.Never)]
1873         public bool CanGoForward()
1874         {
1875             bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1876             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1877             return ret;
1878         }
1879
1880         /// <summary>
1881         /// Evaluates JavaScript code represented as a string.
1882         /// </summary>
1883         /// <param name="script">The JavaScript code</param>
1884         [EditorBrowsable(EditorBrowsableState.Never)]
1885         public void EvaluateJavaScript(string script)
1886         {
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();
1889         }
1890
1891         /// <summary>
1892         /// Evaluates JavaScript code represented as a string.
1893         /// </summary>
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)
1898         {
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();
1902         }
1903
1904         /// <summary>
1905         /// Add a message handler into the WebView.
1906         /// </summary>
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)
1911         {
1912             if (handlerRootMap.ContainsKey(objectName))
1913             {
1914                 return;
1915             }
1916
1917             handlerRootMap.Add(objectName, handler);
1918
1919             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1920             Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1921
1922             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1923         }
1924
1925         /// <summary>
1926         /// Registers a callback for JS alert.
1927         /// </summary>
1928         /// <param name="callback">The callback function</param>
1929         [EditorBrowsable(EditorBrowsableState.Never)]
1930         public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1931         {
1932             IntPtr ip = IntPtr.Zero;
1933             if (callback != null)
1934             {
1935                 ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1936             }
1937             Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1938             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1939         }
1940
1941         /// <summary>
1942         /// Reply for alert popup.
1943         /// </summary>
1944         [EditorBrowsable(EditorBrowsableState.Never)]
1945         public void JavaScriptAlertReply()
1946         {
1947             Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1948             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1949         }
1950
1951         /// <summary>
1952         /// Registers a callback for JS confirm.
1953         /// </summary>
1954         /// <param name="callback">The callback function</param>
1955         [EditorBrowsable(EditorBrowsableState.Never)]
1956         public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1957         {
1958             IntPtr ip = IntPtr.Zero;
1959             if (callback != null)
1960             {
1961                 ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1962             }
1963             Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1964             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1965         }
1966
1967         /// <summary>
1968         /// Reply for confirm popup.
1969         /// </summary>
1970         /// <param name="confirmed">Confirmed or not</param>
1971         [EditorBrowsable(EditorBrowsableState.Never)]
1972         public void JavaScriptConfirmReply(bool confirmed)
1973         {
1974             Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1975             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1976         }
1977
1978         /// <summary>
1979         /// Registers a callback for JS promt.
1980         /// </summary>
1981         /// <param name="callback">The callback function</param>
1982         [EditorBrowsable(EditorBrowsableState.Never)]
1983         public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1984         {
1985             IntPtr ip = IntPtr.Zero;
1986             if (callback != null)
1987             {
1988                 ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1989             }
1990             Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1991             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1992         }
1993
1994         /// <summary>
1995         /// Reply for prompt popup.
1996         /// </summary>
1997         /// <param name="result">Text in prompt input field.</param>
1998         [EditorBrowsable(EditorBrowsableState.Never)]
1999         public void JavaScriptPromptReply(string result)
2000         {
2001             Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
2002             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2003         }
2004
2005         /// <summary>
2006         /// Clears title resources of current WebView.
2007         /// </summary>
2008         [EditorBrowsable(EditorBrowsableState.Never)]
2009         public void ClearAllTilesResources()
2010         {
2011             Interop.WebView.ClearAllTilesResources(SwigCPtr);
2012             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2013         }
2014
2015         /// <summary>
2016         /// Clears the history of current WebView.
2017         /// </summary>
2018         [EditorBrowsable(EditorBrowsableState.Never)]
2019         public void ClearHistory()
2020         {
2021             Interop.WebView.ClearHistory(SwigCPtr);
2022             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2023         }
2024
2025         /// <summary>
2026         /// Scales the current page, centered at the given point.
2027         /// </summary>
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)
2032         {
2033             Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
2034             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2035         }
2036
2037         /// <summary>
2038         /// Gets the current scale factor of the page.
2039         /// </summary>
2040         [EditorBrowsable(EditorBrowsableState.Never)]
2041         public float GetScaleFactor()
2042         {
2043             float result = Interop.WebView.GetScaleFactor(SwigCPtr);
2044             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2045             return result;
2046         }
2047
2048         /// <summary>
2049         /// Requests to activate/deactivate the accessibility usage set by web app.
2050         /// </summary>
2051         /// <param name="activated">The new factor to be scaled</param>
2052         [EditorBrowsable(EditorBrowsableState.Never)]
2053         public void ActivateAccessibility(bool activated)
2054         {
2055             Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
2056             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2057         }
2058
2059         /// <summary>
2060         /// Searches and highlights the given string in the document.
2061         /// </summary>
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)
2067         {
2068             bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
2069             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2070             return result;
2071         }
2072
2073         /// <summary>
2074         /// Adds dynamic certificate path.
2075         /// </summary>
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)
2080         {
2081             Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
2082             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2083         }
2084
2085         /// <summary>
2086         /// Get snapshot of the specified viewArea of page.
2087         /// </summary>
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)
2092         {
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();
2096             return imageView;
2097         }
2098
2099         /// <summary>
2100         /// Get snapshot of the specified viewArea of page.
2101         /// </summary>
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)
2107         {
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();
2112             return result;
2113         }
2114
2115         /// <summary>
2116         /// Asynchronously requests to check if there is a video playing in the given view.
2117         /// </summary>
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)
2121         {
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();
2125             return result;
2126         }
2127
2128         /// <summary>
2129         /// Registers callback which will be called upon geolocation permission request.
2130         /// </summary>
2131         /// <param name="callback">The callback for requesting geolocation permission</param>
2132         [EditorBrowsable(EditorBrowsableState.Never)]
2133         public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
2134         {
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();
2138         }
2139
2140         /// <summary>
2141         /// Does hit test synchronously.
2142         /// </summary>
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)
2148         {
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);
2152         }
2153
2154         /// <summary>
2155         /// Does hit test asynchronously.
2156         /// </summary>
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)
2163         {
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();
2168             return result;
2169         }
2170
2171         /// <summary>
2172         /// Deprecated. Clears the cache of current WebView.
2173         /// </summary>
2174         [EditorBrowsable(EditorBrowsableState.Never)]
2175         public void ClearCache()
2176         {
2177             Context.ClearCache();
2178         }
2179
2180         /// <summary>
2181         /// Deprecated. Clears all the cookies of current WebView.
2182         /// </summary>
2183         [EditorBrowsable(EditorBrowsableState.Never)]
2184         public void ClearCookies()
2185         {
2186             CookieManager.ClearCookies();
2187         }
2188
2189         /// <summary>
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.
2193         /// </summary>
2194         /// <param name="focused">Focused or not</param>
2195         [EditorBrowsable(EditorBrowsableState.Never)]
2196         public void SetTtsFocus(bool focused)
2197         {
2198             Interop.WebView.SetTtsFocus(SwigCPtr, focused);
2199             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2200         }
2201
2202         /// <summary>
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.
2205         /// </summary>
2206         /// <param name="callback">The callback for getting plain text</param>
2207         [EditorBrowsable(EditorBrowsableState.Never)]
2208         public void GetPlainTextAsynchronously(PlainTextReceivedCallback callback)
2209         {
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();
2214         }
2215
2216         internal static WebView DownCast(BaseHandle handle)
2217         {
2218             WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2219             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2220             return ret;
2221         }
2222
2223         internal WebView Assign(WebView webView)
2224         {
2225             WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2226             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2227             return ret;
2228         }
2229
2230         private void OnPageLoadStarted(string pageUrl)
2231         {
2232             WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2233
2234             e.WebView = this;
2235             e.PageUrl = pageUrl;
2236
2237             pageLoadStartedEventHandler?.Invoke(this, e);
2238         }
2239
2240         private void OnPageLoading(string pageUrl)
2241         {
2242             pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2243         }
2244
2245         private void OnPageLoadFinished(string pageUrl)
2246         {
2247             WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2248
2249             e.WebView = this;
2250             e.PageUrl = pageUrl;
2251
2252             pageLoadFinishedEventHandler?.Invoke(this, e);
2253         }
2254
2255         private void OnPageLoadError(IntPtr error)
2256         {
2257             pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, true)));
2258         }
2259
2260         private void OnScrollEdgeReached(int edge)
2261         {
2262             scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2263         }
2264
2265         private void OnUrlChanged(string pageUrl)
2266         {
2267             urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2268         }
2269
2270         private void OnFormRepostPolicyDecided(IntPtr decision)
2271         {
2272             formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, true)));
2273         }
2274
2275         private void OnFrameRendered()
2276         {
2277             frameRenderedEventHandler?.Invoke(this, new EventArgs());
2278         }
2279
2280         private void OnScreenshotAcquired(IntPtr data)
2281         {
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
2285         }
2286
2287         private void OnResponsePolicyDecided(IntPtr maker)
2288         {
2289             responsePolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2290         }
2291
2292         private void OnNavigationPolicyDecided(IntPtr maker)
2293         {
2294             navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2295         }
2296
2297         private void OnNewWindowCreated(out IntPtr viewHandle)
2298         {
2299             WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs());
2300             viewHandle = (IntPtr)view.SwigCPtr;
2301         }
2302
2303         private void OnCertificateConfirmed(IntPtr certificate)
2304         {
2305             certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2306         }
2307
2308         private void OnSslCertificateChanged(IntPtr certificate)
2309         {
2310             sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2311         }
2312
2313         private void OnHttpAuthRequested(IntPtr handler)
2314         {
2315             httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, true)));
2316         }
2317
2318         private void OnConsoleMessageReceived(IntPtr message)
2319         {
2320             consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, true)));
2321         }
2322
2323         private void OnContextMenuShown(IntPtr menu)
2324         {
2325             contextMenuShownEventHandler?.Invoke(this, new WebViewContextMenuShownEventArgs(new WebContextMenu(menu, true)));
2326         }
2327
2328         private void OnContextMenuHidden(IntPtr menu)
2329         {
2330             contextMenuHiddenEventHandler?.Invoke(this, new WebViewContextMenuHiddenEventArgs(new WebContextMenu(menu, true)));
2331         }
2332
2333         private void OnHitTestFinished(IntPtr test)
2334         {
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
2338         }
2339     }
2340 }