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