[NUI] Add BindableProperties to all public Properties
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / WebView / WebView.cs
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using System.Runtime.InteropServices;
22 using Tizen.NUI.Binding;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// WebView allows presenting content with embedded web browser, both local files and remote websites.
28     /// </summary>
29     /// <since_tizen> 9 </since_tizen>
30     public partial class WebView : View
31     {
32         private 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)GetValue(CacheModelProperty);
766             }
767             set
768             {
769                 SetValue(CacheModelProperty, value);
770                 NotifyPropertyChanged();
771             }
772         }
773
774         private CacheModel InternalCacheModel
775         {
776             get
777             {
778                 return (CacheModel)Context.CacheModel;
779             }
780             set
781             {
782                 Context.CacheModel = (WebContext.CacheModelType)value;
783             }
784         }
785
786         /// <summary>
787         /// Deprecated. The cookie acceptance policy.
788         /// </summary>
789         [EditorBrowsable(EditorBrowsableState.Never)]
790         public CookieAcceptPolicy CookieAcceptPolicy
791         {
792             get
793             {
794                 return (CookieAcceptPolicy)GetValue(CookieAcceptPolicyProperty);
795             }
796             set
797             {
798                 SetValue(CookieAcceptPolicyProperty, value);
799                 NotifyPropertyChanged();
800             }
801         }
802
803         private CookieAcceptPolicy InternalCookieAcceptPolicy
804         {
805             get
806             {
807                 return (CookieAcceptPolicy)CookieManager.CookieAcceptPolicy;
808             }
809             set
810             {
811                 CookieManager.CookieAcceptPolicy = (WebCookieManager.CookieAcceptPolicyType)value;
812             }
813         }
814
815         /// <summary>
816         /// The user agent string.
817         /// </summary>
818         /// <since_tizen> 9 </since_tizen>
819         public string UserAgent
820         {
821             get
822             {
823                 return (string)GetValue(UserAgentProperty);
824             }
825             set
826             {
827                 SetValue(UserAgentProperty, value);
828                 NotifyPropertyChanged();
829             }
830         }
831
832         /// <summary>
833         /// Deprecated. Whether JavaScript is enabled.
834         /// </summary>
835         [EditorBrowsable(EditorBrowsableState.Never)]
836         public bool EnableJavaScript
837         {
838             get
839             {
840                 return (bool)GetValue(EnableJavaScriptProperty);
841             }
842             set
843             {
844                 SetValue(EnableJavaScriptProperty, value);
845                 NotifyPropertyChanged();
846             }
847         }
848
849         private bool InternalEnableJavaScript
850         {
851             get
852             {
853                 return Settings.JavaScriptEnabled;
854             }
855             set
856             {
857                 Settings.JavaScriptEnabled = value;
858             }
859         }
860
861         /// <summary>
862         /// Deprecated. Whether images can be loaded automatically.
863         /// </summary>
864         [EditorBrowsable(EditorBrowsableState.Never)]
865         public bool LoadImagesAutomatically
866         {
867             get
868             {
869                 return (bool)GetValue(LoadImagesAutomaticallyProperty);
870             }
871             set
872             {
873                 SetValue(LoadImagesAutomaticallyProperty, value);
874                 NotifyPropertyChanged();
875             }
876         }
877
878         private bool InternalLoadImagesAutomatically
879         {
880             get
881             {
882                 return Settings.AutomaticImageLoadingAllowed;
883             }
884             set
885             {
886                 Settings.AutomaticImageLoadingAllowed = value;
887             }
888         }
889
890         /// <summary>
891         /// The default text encoding name.<br />
892         /// e.g. "UTF-8"<br />
893         /// </summary>
894         [EditorBrowsable(EditorBrowsableState.Never)]
895         public string DefaultTextEncodingName
896         {
897             get
898             {
899                 return GetValue(DefaultTextEncodingNameProperty) as string;
900             }
901             set
902             {
903                 SetValue(DefaultTextEncodingNameProperty, value);
904                 NotifyPropertyChanged();
905             }
906         }
907
908         private string InternalDefaultTextEncodingName
909         {
910             get
911             {
912                 return Settings.DefaultTextEncodingName;
913             }
914             set
915             {
916                 Settings.DefaultTextEncodingName = value;
917             }
918         }
919
920         /// <summary>
921         /// The default font size in pixel.
922         /// </summary>
923         [EditorBrowsable(EditorBrowsableState.Never)]
924         public int DefaultFontSize
925         {
926             get
927             {
928                 return (int)GetValue(DefaultFontSizeProperty);
929             }
930             set
931             {
932                 SetValue(DefaultFontSizeProperty, value);
933                 NotifyPropertyChanged();
934             }
935         }
936
937         private int InternalDefaultFontSize
938         {
939             get
940             {
941                 return Settings.DefaultFontSize;
942             }
943             set
944             {
945                 Settings.DefaultFontSize = value;
946             }
947         }
948
949         /// <summary>
950         /// The position of scroll.
951         /// </summary>
952         [EditorBrowsable(EditorBrowsableState.Never)]
953         public Position ScrollPosition
954         {
955             get
956             {
957                 return GetValue(ScrollPositionProperty) as Position;
958             }
959             set
960             {
961                 SetValue(ScrollPositionProperty, value);
962             }
963         }
964
965         private Position InternalScrollPosition
966         {
967             get
968             {
969                 Vector2 pv = (Vector2)GetValue(ScrollPositionProperty);
970                 return new Position(pv.X, pv.Y);
971             }
972             set
973             {
974                 if (value != null)
975                 {
976                     Position pv = value;
977                     Vector2 vpv = new Vector2(pv.X, pv.Y);
978                     SetValue(ScrollPositionProperty, vpv);
979                     NotifyPropertyChanged();
980                 }
981             }
982         }
983
984         /// <summary>
985         /// The size of scroll, read-only.
986         /// </summary>
987         [EditorBrowsable(EditorBrowsableState.Never)]
988         public Size ScrollSize
989         {
990             get
991             {
992                 Vector2 sv = (Vector2)GetValue(ScrollSizeProperty);
993                 return new Size(sv.Width, sv.Height);
994             }
995         }
996
997         /// <summary>
998         /// The size of content, read-only.
999         /// </summary>
1000         [EditorBrowsable(EditorBrowsableState.Never)]
1001         public Size ContentSize
1002         {
1003             get
1004             {
1005                 Vector2 sv = (Vector2)GetValue(ContentSizeProperty);
1006                 return new Size(sv.Width, sv.Height);
1007             }
1008         }
1009
1010         /// <summary>
1011         /// Whether video hole is enabled or not.
1012         /// </summary>
1013         [EditorBrowsable(EditorBrowsableState.Never)]
1014         public bool VideoHoleEnabled
1015         {
1016             get
1017             {
1018                 return (bool)GetValue(VideoHoleEnabledProperty);
1019             }
1020             set
1021             {
1022                 SetValue(VideoHoleEnabledProperty, value);
1023                 NotifyPropertyChanged();
1024             }
1025         }
1026
1027         /// <summary>
1028         /// Whether mouse events are enabled or not.
1029         /// </summary>
1030         [EditorBrowsable(EditorBrowsableState.Never)]
1031         public bool MouseEventsEnabled
1032         {
1033             get
1034             {
1035                 return (bool)GetValue(MouseEventsEnabledProperty);
1036             }
1037             set
1038             {
1039                 SetValue(MouseEventsEnabledProperty, value);
1040                 NotifyPropertyChanged();
1041             }
1042         }
1043
1044         /// <summary>
1045         /// Whether key events are enabled or not.
1046         /// </summary>
1047         [EditorBrowsable(EditorBrowsableState.Never)]
1048         public bool KeyEventsEnabled
1049         {
1050             get
1051             {
1052                 return (bool)GetValue(KeyEventsEnabledProperty);
1053             }
1054             set
1055             {
1056                 SetValue(KeyEventsEnabledProperty, value);
1057                 NotifyPropertyChanged();
1058             }
1059         }
1060
1061         /// <summary>
1062         /// Background color of web page.
1063         /// </summary>
1064         [EditorBrowsable(EditorBrowsableState.Never)]
1065         public Color ContentBackgroundColor
1066         {
1067             get
1068             {
1069                 return (Color)GetValue(ContentBackgroundColorProperty);
1070             }
1071             set
1072             {
1073                 SetValue(ContentBackgroundColorProperty, value);
1074                 NotifyPropertyChanged();
1075             }
1076         }
1077
1078         /// <summary>
1079         /// Whether tiles are cleared or not when hidden.
1080         /// </summary>
1081         [EditorBrowsable(EditorBrowsableState.Never)]
1082         public bool TilesClearedWhenHidden
1083         {
1084             get
1085             {
1086                 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1087             }
1088             set
1089             {
1090                 SetValue(TilesClearedWhenHiddenProperty, value);
1091                 NotifyPropertyChanged();
1092             }
1093         }
1094
1095         /// <summary>
1096         /// Multiplier of cover area of tile when web page is rendered.
1097         /// </summary>
1098         [EditorBrowsable(EditorBrowsableState.Never)]
1099         public float TileCoverAreaMultiplier
1100         {
1101             get
1102             {
1103                 return (float)GetValue(TileCoverAreaMultiplierProperty);
1104             }
1105             set
1106             {
1107                 SetValue(TileCoverAreaMultiplierProperty, value);
1108                 NotifyPropertyChanged();
1109             }
1110         }
1111
1112         /// <summary>
1113         /// Whether cursor is enabled or not by client.
1114         /// </summary>
1115         [EditorBrowsable(EditorBrowsableState.Never)]
1116         public bool CursorEnabledByClient
1117         {
1118             get
1119             {
1120                 return (bool)GetValue(CursorEnabledByClientProperty);
1121             }
1122             set
1123             {
1124                 SetValue(CursorEnabledByClientProperty, value);
1125                 NotifyPropertyChanged();
1126             }
1127         }
1128
1129         /// <summary>
1130         /// Gets selected text in web page.
1131         /// </summary>
1132         [EditorBrowsable(EditorBrowsableState.Never)]
1133         public string SelectedText
1134         {
1135             get
1136             {
1137                 return (string)GetValue(SelectedTextProperty);
1138             }
1139         }
1140
1141         /// <summary>
1142         /// Gets title of web page.
1143         /// </summary>
1144         /// <since_tizen> 9 </since_tizen>
1145         public string Title
1146         {
1147             get
1148             {
1149                 return (string)GetValue(TitleProperty);
1150             }
1151         }
1152
1153         /// <summary>
1154         /// Gets favicon of web page.
1155         /// </summary>
1156         /// <since_tizen> 9 </since_tizen>
1157         public ImageView Favicon
1158         {
1159             get
1160             {
1161                 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1162                 if (imageView == IntPtr.Zero)
1163                     return null;
1164                 return new ImageView(imageView, false);
1165             }
1166         }
1167
1168         /// <summary>
1169         /// Zoom factor of web page.
1170         /// </summary>
1171         [EditorBrowsable(EditorBrowsableState.Never)]
1172         public float PageZoomFactor
1173         {
1174             get
1175             {
1176                 return (float)GetValue(PageZoomFactorProperty);
1177             }
1178             set
1179             {
1180                 SetValue(PageZoomFactorProperty, value);
1181                 NotifyPropertyChanged();
1182             }
1183         }
1184
1185         /// <summary>
1186         /// Zoom factor of text in web page.
1187         /// </summary>
1188         [EditorBrowsable(EditorBrowsableState.Never)]
1189         public float TextZoomFactor
1190         {
1191             get
1192             {
1193                 return (float)GetValue(TextZoomFactorProperty);
1194             }
1195             set
1196             {
1197                 SetValue(TextZoomFactorProperty, value);
1198                 NotifyPropertyChanged();
1199             }
1200         }
1201
1202         /// <summary>
1203         /// Gets percentage of loading progress.
1204         /// </summary>
1205         /// <since_tizen> 9 </since_tizen>
1206         public float LoadProgressPercentage
1207         {
1208             get
1209             {
1210                 return (float)GetValue(LoadProgressPercentageProperty);
1211             }
1212         }
1213
1214         internal static new class Property
1215         {
1216             internal static readonly int Url = Interop.WebView.UrlGet();
1217             internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
1218             internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
1219             internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
1220             internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
1221             internal static readonly int Title = Interop.WebView.TitleGet();
1222             internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
1223             internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
1224             internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
1225             internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
1226             internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
1227             internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
1228             internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
1229             internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
1230             internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
1231             internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
1232             internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
1233         }
1234
1235         private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1236         {
1237             var webview = (WebView)bindable;
1238             if (newValue != null)
1239             {
1240                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1241             }
1242         }),
1243         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1244         {
1245             var webview = (WebView)bindable;
1246             string temp;
1247             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1248             return temp;
1249         }));
1250
1251         private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1252         {
1253             var webview = (WebView)bindable;
1254             if (newValue != null)
1255             {
1256                 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1257             }
1258         }),
1259         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1260         {
1261             var webview = (WebView)bindable;
1262             string temp;
1263             Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1264             return temp;
1265         }));
1266
1267         private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1268         {
1269             var webview = (WebView)bindable;
1270             if (newValue != null)
1271             {
1272                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1273             }
1274         },
1275         defaultValueCreator: (bindable) =>
1276         {
1277             var webview = (WebView)bindable;
1278             Vector2 temp = new Vector2(0.0f, 0.0f);
1279             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
1280             return temp;
1281         });
1282
1283         private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1284         {
1285             var webview = (WebView)bindable;
1286             Vector2 temp = new Vector2(0.0f, 0.0f);
1287             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
1288             return temp;
1289         });
1290
1291         private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1292         {
1293             var webview = (WebView)bindable;
1294             Vector2 temp = new Vector2(0.0f, 0.0f);
1295             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
1296             return temp;
1297         });
1298
1299         private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1300         {
1301             var webview = (WebView)bindable;
1302             string title;
1303             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1304             return title;
1305         });
1306
1307         private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1308         {
1309             var webview = (WebView)bindable;
1310             if (newValue != null)
1311             {
1312                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1313             }
1314         },
1315         defaultValueCreator: (bindable) =>
1316         {
1317             var webview = (WebView)bindable;
1318             bool temp;
1319             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1320             return temp;
1321         });
1322
1323         private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1324         {
1325             var webview = (WebView)bindable;
1326             if (newValue != null)
1327             {
1328                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1329             }
1330         },
1331         defaultValueCreator: (bindable) =>
1332         {
1333             var webview = (WebView)bindable;
1334             bool temp;
1335             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1336             return temp;
1337         });
1338
1339         private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1340         {
1341             var webview = (WebView)bindable;
1342             if (newValue != null)
1343             {
1344                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1345             }
1346         },
1347         defaultValueCreator: (bindable) =>
1348         {
1349             var webview = (WebView)bindable;
1350             bool temp;
1351             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1352             return temp;
1353         });
1354
1355         private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1356         {
1357             var webview = (WebView)bindable;
1358             if (newValue != null)
1359             {
1360                 webview.contentBackgroundColor = (Color)newValue;
1361                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1362             }
1363         },
1364         defaultValueCreator: (bindable) =>
1365         {
1366             var webview = (WebView)bindable;
1367             return webview.contentBackgroundColor;
1368         });
1369
1370         private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1371         {
1372             var webview = (WebView)bindable;
1373             if (newValue != null)
1374             {
1375                 webview.tilesClearedWhenHidden = (bool)newValue;
1376                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1377             }
1378         },
1379         defaultValueCreator: (bindable) =>
1380         {
1381             var webview = (WebView)bindable;
1382             return webview.tilesClearedWhenHidden;
1383         });
1384
1385         private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1386         {
1387             var webview = (WebView)bindable;
1388             if (newValue != null)
1389             {
1390                 webview.tileCoverAreaMultiplier = (float)newValue;
1391                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1392             }
1393         },
1394         defaultValueCreator: (bindable) =>
1395         {
1396             var webview = (WebView)bindable;
1397             return webview.tileCoverAreaMultiplier;
1398         });
1399
1400         private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1401         {
1402             var webview = (WebView)bindable;
1403             if (newValue != null)
1404             {
1405                 webview.cursorEnabledByClient = (bool)newValue;
1406                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1407             }
1408         },
1409         defaultValueCreator: (bindable) =>
1410         {
1411             var webview = (WebView)bindable;
1412             return webview.cursorEnabledByClient;
1413         });
1414
1415         private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1416         {
1417             var webview = (WebView)bindable;
1418             string text;
1419             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1420             return text;
1421         });
1422
1423         private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1424         {
1425             var webview = (WebView)bindable;
1426             if (newValue != null)
1427             {
1428                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1429             }
1430         },
1431         defaultValueCreator: (bindable) =>
1432         {
1433             var webview = (WebView)bindable;
1434             float temp;
1435             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1436             return temp;
1437         });
1438
1439         private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1440         {
1441             var webview = (WebView)bindable;
1442             if (newValue != null)
1443             {
1444                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1445             }
1446         },
1447         defaultValueCreator: (bindable) =>
1448         {
1449             var webview = (WebView)bindable;
1450             float temp;
1451             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1452             return temp;
1453         });
1454
1455         private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1456         {
1457             var webview = (WebView)bindable;
1458             float percentage;
1459             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1460             return percentage;
1461         });
1462
1463         // For rooting handlers
1464         internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1465
1466         /// <summary>
1467         /// Loads a html.
1468         /// </summary>
1469         /// <param name="url">The path of Web</param>
1470         /// <remarks>
1471         /// The following privileges are required:
1472         /// http://tizen.org/privilege/internet for remote web pages of websites.
1473         /// http://tizen.org/privilege/mediastorage for local files in media storage.
1474         /// http://tizen.org/privilege/externalstorage for local files in external storage.
1475         /// </remarks>
1476         /// <since_tizen> 9 </since_tizen>
1477         public void LoadUrl(string url)
1478         {
1479             Interop.WebView.LoadUrl(SwigCPtr, url);
1480             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1481         }
1482
1483         /// <summary>
1484         /// Deprecated. Loads a html by string.
1485         /// <param name="data">The data of Web</param>
1486         /// </summary>
1487         [EditorBrowsable(EditorBrowsableState.Never)]
1488         public void LoadHTMLString(string data)
1489         {
1490             Interop.WebView.LoadHtmlString(SwigCPtr, data);
1491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1492         }
1493
1494         /// <summary>
1495         /// Loads a html by string.
1496         /// </summary>
1497         /// <param name="data">The data of Web</param>
1498         /// <since_tizen> 9 </since_tizen>
1499         public void LoadHtmlString(string data)
1500         {
1501             Interop.WebView.LoadHtmlString(SwigCPtr, data);
1502             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1503         }
1504
1505         /// <summary>
1506         /// Loads the specified html as the content of the view to override current history entry.
1507         /// <param name="html">The html to be loaded</param>
1508         /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1509         /// <param name="unreachableUri">URL that could not be reached</param>
1510         /// </summary>
1511         [EditorBrowsable(EditorBrowsableState.Never)]
1512         public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1513         {
1514             bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1515             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1516             return result;
1517         }
1518
1519         /// <summary>
1520         /// Requests to load the given contents by MIME type.
1521         /// <param name="contents">The contents to be loaded</param>
1522         /// <param name="contentSize">The size of contents (in bytes)</param>
1523         /// <param name="mimeType">The type of contents, "text/html" is assumed if null</param>
1524         /// <param name="encoding">The encoding for contents, "UTF-8" is assumed if null</param>
1525         /// <param name="baseUri">The base URI to use for relative resources</param>
1526         /// </summary>
1527         [EditorBrowsable(EditorBrowsableState.Never)]
1528         public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1529         {
1530             bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1531             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1532             return result;
1533         }
1534
1535         /// <summary>
1536         /// Reloads the Web
1537         /// </summary>
1538         [EditorBrowsable(EditorBrowsableState.Never)]
1539         public void Reload()
1540         {
1541             Interop.WebView.Reload(SwigCPtr);
1542             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1543         }
1544
1545         /// <summary>
1546         /// Reloads the current page's document without cache
1547         /// </summary>
1548         [EditorBrowsable(EditorBrowsableState.Never)]
1549         public bool ReloadWithoutCache()
1550         {
1551             bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1552             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1553             return result;
1554         }
1555
1556         /// <summary>
1557         /// Stops loading the Web
1558         /// </summary>
1559         [EditorBrowsable(EditorBrowsableState.Never)]
1560         public void StopLoading()
1561         {
1562             Interop.WebView.StopLoading(SwigCPtr);
1563             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1564         }
1565
1566         /// <summary>
1567         /// Suspends the operation.
1568         /// </summary>
1569         [EditorBrowsable(EditorBrowsableState.Never)]
1570         public void Suspend()
1571         {
1572             Interop.WebView.Suspend(SwigCPtr);
1573             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1574         }
1575
1576         /// <summary>
1577         /// Resumes the operation after calling Suspend()
1578         /// </summary>
1579         [EditorBrowsable(EditorBrowsableState.Never)]
1580         public void Resume()
1581         {
1582             Interop.WebView.Resume(SwigCPtr);
1583             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1584         }
1585
1586         /// <summary>
1587         /// Suspends all network loading.
1588         /// </summary>
1589         [EditorBrowsable(EditorBrowsableState.Never)]
1590         public void SuspendNetworkLoading()
1591         {
1592             Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1593             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1594         }
1595
1596         /// <summary>
1597         /// Resumes all network loading.
1598         /// </summary>
1599         [EditorBrowsable(EditorBrowsableState.Never)]
1600         public void ResumeNetworkLoading()
1601         {
1602             Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1603             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1604         }
1605
1606         /// <summary>
1607         /// Adds custom header.
1608         /// <param name="name">The name of custom header</param>
1609         /// <param name="value">The value of custom header</param>
1610         /// </summary>
1611         [EditorBrowsable(EditorBrowsableState.Never)]
1612         public bool AddCustomHeader(string name, string value)
1613         {
1614             bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1615             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1616             return result;
1617         }
1618
1619         /// <summary>
1620         /// Removes custom header.
1621         /// <param name="name">The name of custom header</param>
1622         /// </summary>
1623         [EditorBrowsable(EditorBrowsableState.Never)]
1624         public bool RemoveCustomHeader(string name)
1625         {
1626             bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1627             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1628             return result;
1629         }
1630
1631         /// <summary>
1632         /// Starts the inspector server.
1633         /// <param name="port">The port number</param>
1634         /// </summary>
1635         [EditorBrowsable(EditorBrowsableState.Never)]
1636         public uint StartInspectorServer(uint port)
1637         {
1638             uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1639             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1640             return result;
1641         }
1642
1643         /// <summary>
1644         /// Stops the inspector server.
1645         /// </summary>
1646         [EditorBrowsable(EditorBrowsableState.Never)]
1647         public bool StopInspectorServer()
1648         {
1649             bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1650             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1651             return result;
1652         }
1653
1654         /// <summary>
1655         /// Scrolls page of web view by deltaX and detlaY.
1656         /// <param name="deltaX">The deltaX of scroll</param>
1657         /// <param name="deltaY">The deltaY of scroll</param>
1658         /// </summary>
1659         [EditorBrowsable(EditorBrowsableState.Never)]
1660         public void ScrollBy(int deltaX, int deltaY)
1661         {
1662             Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1663             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1664         }
1665
1666         /// <summary>
1667         /// Scrolls edge of web view by deltaX and deltaY.
1668         /// <param name="deltaX">The deltaX of scroll</param>
1669         /// <param name="deltaY">The deltaY of scroll</param>
1670         /// </summary>
1671         [EditorBrowsable(EditorBrowsableState.Never)]
1672         public bool ScrollEdgeBy(int deltaX, int deltaY)
1673         {
1674             bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1675             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1676             return result;
1677         }
1678
1679         /// <summary>
1680         /// Goes to the back
1681         /// </summary>
1682         [EditorBrowsable(EditorBrowsableState.Never)]
1683         public void GoBack()
1684         {
1685             Interop.WebView.GoBack(SwigCPtr);
1686             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1687         }
1688
1689         /// <summary>
1690         /// Goes to the forward
1691         /// </summary>
1692         [EditorBrowsable(EditorBrowsableState.Never)]
1693         public void GoForward()
1694         {
1695             Interop.WebView.GoForward(SwigCPtr);
1696             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1697         }
1698
1699         /// <summary>
1700         /// Returns whether backward is possible.
1701         /// <returns>True if backward is possible, false otherwise</returns>
1702         /// </summary>
1703         [EditorBrowsable(EditorBrowsableState.Never)]
1704         public bool CanGoBack()
1705         {
1706             bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1707             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1708             return ret;
1709         }
1710
1711         /// <summary>
1712         /// Returns whether forward is possible.
1713         /// <returns>True if forward is possible, false otherwise</returns>
1714         /// </summary>
1715         [EditorBrowsable(EditorBrowsableState.Never)]
1716         public bool CanGoForward()
1717         {
1718             bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1719             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1720             return ret;
1721         }
1722
1723         /// <summary>
1724         /// Evaluates JavaScript code represented as a string.
1725         /// <param name="script">The JavaScript code</param>
1726         /// </summary>
1727         [EditorBrowsable(EditorBrowsableState.Never)]
1728         public void EvaluateJavaScript(string script)
1729         {
1730             Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1731             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1732         }
1733
1734         /// <summary>
1735         /// Add a message handler into the WebView.
1736         /// <param name="objectName">The name of exposed object</param>
1737         /// <param name="handler">The callback function</param>
1738         /// </summary>
1739         [EditorBrowsable(EditorBrowsableState.Never)]
1740         public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1741         {
1742             if (handlerRootMap.ContainsKey(objectName))
1743             {
1744                 return;
1745             }
1746
1747             handlerRootMap.Add(objectName, handler);
1748
1749             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1750             Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1751
1752             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1753         }
1754
1755         /// <summary>
1756         /// Add a message handler into the WebView.
1757         /// <param name="callback">The callback function</param>
1758         /// </summary>
1759         [EditorBrowsable(EditorBrowsableState.Never)]
1760         public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1761         {
1762             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1763             Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1764
1765             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1766         }
1767
1768         /// <summary>
1769         /// Reply for alert popup.
1770         /// </summary>
1771         [EditorBrowsable(EditorBrowsableState.Never)]
1772         public void JavaScriptAlertReply()
1773         {
1774             Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1775             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1776         }
1777
1778         /// <summary>
1779         /// Add a message handler into the WebView.
1780         /// <param name="callback">The callback function</param>
1781         /// </summary>
1782         [EditorBrowsable(EditorBrowsableState.Never)]
1783         public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1784         {
1785             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1786             Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1787
1788             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1789         }
1790
1791         /// <summary>
1792         /// Reply for confirm popup.
1793         /// <param name="confirmed">confirmed or not</param>
1794         /// </summary>
1795         [EditorBrowsable(EditorBrowsableState.Never)]
1796         public void JavaScriptConfirmReply(bool confirmed)
1797         {
1798             Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1799             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1800         }
1801
1802         /// <summary>
1803         /// Add a message handler into the WebView.
1804         /// <param name="callback">The callback function</param>
1805         /// </summary>
1806         [EditorBrowsable(EditorBrowsableState.Never)]
1807         public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1808         {
1809             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1810             Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1811
1812             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1813         }
1814
1815         /// <summary>
1816         /// Reply for prompt popup.
1817         /// <param name="result">text in prompt input field.</param>
1818         /// </summary>
1819         [EditorBrowsable(EditorBrowsableState.Never)]
1820         public void JavaScriptPromptReply(string result)
1821         {
1822             Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
1823             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1824         }
1825
1826         /// <summary>
1827         /// Clears title resources of current WebView.
1828         /// </summary>
1829         [EditorBrowsable(EditorBrowsableState.Never)]
1830         public void ClearAllTilesResources()
1831         {
1832             Interop.WebView.ClearAllTilesResources(SwigCPtr);
1833             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1834         }
1835
1836         /// <summary>
1837         /// Clears the history of current WebView.
1838         /// </summary>
1839         [EditorBrowsable(EditorBrowsableState.Never)]
1840         public void ClearHistory()
1841         {
1842             Interop.WebView.ClearHistory(SwigCPtr);
1843             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1844         }
1845
1846         /// <summary>
1847         /// Scales the current page, centered at the given point.
1848         /// <param name="scaleFactor">The new factor to be scaled</param>
1849         /// <param name="point">The center coordinate</param>
1850         /// </summary>
1851         [EditorBrowsable(EditorBrowsableState.Never)]
1852         public void SetScaleFactor(float scaleFactor, Vector2 point)
1853         {
1854             Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
1855             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1856         }
1857
1858         /// <summary>
1859         /// Gets the current scale factor of the page.
1860         /// </summary>
1861         [EditorBrowsable(EditorBrowsableState.Never)]
1862         public float GetScaleFactor()
1863         {
1864             float result = Interop.WebView.GetScaleFactor(SwigCPtr);
1865             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1866             return result;
1867         }
1868
1869         /// <summary>
1870         /// Requests to activate/deactivate the accessibility usage set by web app.
1871         /// <param name="activated">The new factor to be scaled</param>
1872         /// </summary>
1873         [EditorBrowsable(EditorBrowsableState.Never)]
1874         public void ActivateAccessibility(bool activated)
1875         {
1876             Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
1877             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1878         }
1879
1880         /// <summary>
1881         /// Searches and highlights the given string in the document.
1882         /// <param name="text">The text to be searched</param>
1883         /// <param name="options">The options to search</param>
1884         /// <param name="maxMatchCount">The maximum match count to search</param>
1885         /// </summary>
1886         [EditorBrowsable(EditorBrowsableState.Never)]
1887         public bool HighlightText(string text, FindOption options, uint maxMatchCount)
1888         {
1889             bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
1890             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1891             return result;
1892         }
1893
1894         /// <summary>
1895         /// Adds dynamic certificate path.
1896         /// <param name="host">Host that required client authentication</param>
1897         /// <param name="certPath">The file path stored certificate</param>
1898         /// </summary>
1899         [EditorBrowsable(EditorBrowsableState.Never)]
1900         public void AddDynamicCertificatePath(string host, string certPath)
1901         {
1902             Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
1903             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1904         }
1905
1906         /// <summary>
1907         /// Get snapshot of the specified viewArea of page.
1908         /// <param name="viewArea">Host that required client authentication</param>
1909         /// <param name="scaleFactor">The file path stored certificate</param>
1910         /// </summary>
1911         [EditorBrowsable(EditorBrowsableState.Never)]
1912         public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
1913         {
1914             IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
1915             ImageView imageView = new ImageView(image, true);
1916             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1917             return imageView;
1918         }
1919
1920         /// <summary>
1921         /// Get snapshot of the specified viewArea of page.
1922         /// <param name="viewArea">Host that required client authentication</param>
1923         /// <param name="scaleFactor">The file path stored certificate</param>
1924         /// <param name="callback">The callback for getting screen shot</param>
1925         /// </summary>
1926         [EditorBrowsable(EditorBrowsableState.Never)]
1927         public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
1928         {
1929             screenshotAcquiredCallback = callback;
1930             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(screenshotAcquiredProxyCallback);
1931             bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
1932             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1933             return result;
1934         }
1935
1936         /// <summary>
1937         /// Asynchronous requests to check if there is a video playing in the given view.
1938         /// <param name="callback">The callback called after checking if video is playing or not</param>
1939         /// </summary>
1940         [EditorBrowsable(EditorBrowsableState.Never)]
1941         public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
1942         {
1943             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1944             bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
1945             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1946             return result;
1947         }
1948
1949         /// <summary>
1950         /// Registers callback which will be called upon geolocation permission request.
1951         /// <param name="callback">The callback for requesting geolocation permission</param>
1952         /// </summary>
1953         [EditorBrowsable(EditorBrowsableState.Never)]
1954         public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
1955         {
1956             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
1957             Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
1958             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1959         }
1960
1961         /// <summary>
1962         /// Does hit test synchronously.
1963         /// <param name="x">the horizontal position to query</param>
1964         /// <param name="y">the vertical position to query</param>
1965         /// <param name="mode">the mode of hit test</param>
1966         /// </summary>
1967         [EditorBrowsable(EditorBrowsableState.Never)]
1968         public WebHitTestResult HitTest(int x, int y, HitTestMode mode)
1969         {
1970             System.IntPtr result = Interop.WebView.CreateHitTest(SwigCPtr, x, y, (int)mode);
1971             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1972             return new WebHitTestResult(result, true);
1973         }
1974
1975         /// <summary>
1976         /// Does hit test asynchronously.
1977         /// <param name="x">the horizontal position to query</param>
1978         /// <param name="y">the vertical position to query</param>
1979         /// <param name="mode">the mode of hit test</param>
1980         /// <param name="callback">the callback that is called after hit test is finished.</param>
1981         /// </summary>
1982         [EditorBrowsable(EditorBrowsableState.Never)]
1983         public bool HitTestAsynchronously(int x, int y, HitTestMode mode, HitTestFinishedCallback callback)
1984         {
1985             hitTestFinishedCallback = callback;
1986             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(hitTestFinishedProxyCallback);
1987             bool result = Interop.WebView.CreateHitTestAsynchronously(SwigCPtr, x, y, (int)mode, new HandleRef(this, ip));
1988             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1989             return result;
1990         }
1991
1992         /// <summary>
1993         /// Deprecated. Clears the cache of current WebView.
1994         /// </summary>
1995         [EditorBrowsable(EditorBrowsableState.Never)]
1996         public void ClearCache()
1997         {
1998             Context.ClearCache();
1999         }
2000
2001         /// <summary>
2002         /// Deprecated. Clears all the cookies of current WebView.
2003         /// </summary>
2004         [EditorBrowsable(EditorBrowsableState.Never)]
2005         public void ClearCookies()
2006         {
2007             CookieManager.ClearCookies();
2008         }
2009
2010         /// <summary>
2011         /// Sets the tts focus to the webview.
2012         /// Please note that it only works when the webview does not have keyinput focus.
2013         /// If the webview has a keyinput focus, it also has tts focus so calling SetTtsFocus(false) is ignored.
2014         /// </summary>
2015         [EditorBrowsable(EditorBrowsableState.Never)]
2016         public void SetTtsFocus(bool focused)
2017         {
2018             Interop.WebView.SetTtsFocus(SwigCPtr, focused);
2019             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2020         }
2021
2022         /// <summary>
2023         /// Get a plain text of current web page asynchronously.
2024         /// Please note that it gets plain text of currently loaded page so please call this method after page load finished.
2025         /// <param name="callback">The callback for getting plain text</param>
2026         /// </summary>
2027         [EditorBrowsable(EditorBrowsableState.Never)]
2028         public void GetPlainTextAsynchronously(PlainTextReceivedCallback callback)
2029         {
2030             plainTextReceivedCallback = callback;
2031             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(plainTextReceivedCallback);
2032             Interop.WebView.GetPlainTextAsynchronously(SwigCPtr, new HandleRef(this, ip));
2033             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2034         }
2035
2036         internal static WebView DownCast(BaseHandle handle)
2037         {
2038             WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2039             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2040             return ret;
2041         }
2042
2043         internal WebView Assign(WebView webView)
2044         {
2045             WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2046             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2047             return ret;
2048         }
2049
2050         private void OnPageLoadStarted(string pageUrl)
2051         {
2052             WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2053
2054             e.WebView = this;
2055             e.PageUrl = pageUrl;
2056
2057             pageLoadStartedEventHandler?.Invoke(this, e);
2058         }
2059
2060         private void OnPageLoading(string pageUrl)
2061         {
2062             pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2063         }
2064
2065         private void OnPageLoadFinished(string pageUrl)
2066         {
2067             WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2068
2069             e.WebView = this;
2070             e.PageUrl = pageUrl;
2071
2072             pageLoadFinishedEventHandler?.Invoke(this, e);
2073         }
2074
2075         private void OnPageLoadError(IntPtr error)
2076         {
2077             pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, true)));
2078         }
2079
2080         private void OnScrollEdgeReached(int edge)
2081         {
2082             scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2083         }
2084
2085         private void OnUrlChanged(string pageUrl)
2086         {
2087             urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2088         }
2089
2090         private void OnFormRepostPolicyDecided(IntPtr decision)
2091         {
2092             formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, true)));
2093         }
2094
2095         private void OnFrameRendered()
2096         {
2097             frameRenderedEventHandler?.Invoke(this, new EventArgs());
2098         }
2099
2100         private void OnScreenshotAcquired(IntPtr data)
2101         {
2102 #pragma warning disable CA2000 // Dispose objects before losing scope
2103             screenshotAcquiredCallback?.Invoke(new ImageView(data, true));
2104 #pragma warning restore CA2000 // Dispose objects before losing scope
2105         }
2106
2107         private void OnResponsePolicyDecided(IntPtr maker)
2108         {
2109             responsePolicyDecidedEventHandler?.Invoke(this, new WebViewResponsePolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2110         }
2111
2112         private void OnCertificateConfirmed(IntPtr certificate)
2113         {
2114             certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2115         }
2116
2117         private void OnSslCertificateChanged(IntPtr certificate)
2118         {
2119             sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2120         }
2121
2122         private void OnHttpAuthRequested(IntPtr handler)
2123         {
2124             httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, true)));
2125         }
2126
2127         private void OnConsoleMessageReceived(IntPtr message)
2128         {
2129             consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, true)));
2130         }
2131
2132         private void OnContextMenuShown(IntPtr menu)
2133         {
2134             contextMenuShownEventHandler?.Invoke(this, new WebViewContextMenuShownEventArgs(new WebContextMenu(menu, true)));
2135         }
2136
2137         private void OnContextMenuHidden(IntPtr menu)
2138         {
2139             contextMenuHiddenEventHandler?.Invoke(this, new WebViewContextMenuHiddenEventArgs(new WebContextMenu(menu, true)));
2140         }
2141
2142         private void OnHitTestFinished(IntPtr test)
2143         {
2144 #pragma warning disable CA2000 // Dispose objects before losing scope
2145             hitTestFinishedCallback?.Invoke(new WebHitTestResult(test, true));
2146 #pragma warning restore CA2000 // Dispose objects before losing scope
2147         }
2148     }
2149 }