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