0358b7ab9688025d1fd6b0b540af7cfbf40e9c45
[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         /// </summary>
1119         [EditorBrowsable(EditorBrowsableState.Never)]
1120         public Color ContentBackgroundColor
1121         {
1122             get
1123             {
1124                 return (Color)GetValue(ContentBackgroundColorProperty);
1125             }
1126             set
1127             {
1128                 SetValue(ContentBackgroundColorProperty, value);
1129                 NotifyPropertyChanged();
1130             }
1131         }
1132
1133         /// <summary>
1134         /// Whether tiles are cleared or not when hidden.
1135         /// </summary>
1136         [EditorBrowsable(EditorBrowsableState.Never)]
1137         public bool TilesClearedWhenHidden
1138         {
1139             get
1140             {
1141                 return (bool)GetValue(TilesClearedWhenHiddenProperty);
1142             }
1143             set
1144             {
1145                 SetValue(TilesClearedWhenHiddenProperty, value);
1146                 NotifyPropertyChanged();
1147             }
1148         }
1149
1150         /// <summary>
1151         /// Multiplier of cover area of tile when web page is rendered.
1152         /// </summary>
1153         [EditorBrowsable(EditorBrowsableState.Never)]
1154         public float TileCoverAreaMultiplier
1155         {
1156             get
1157             {
1158                 return (float)GetValue(TileCoverAreaMultiplierProperty);
1159             }
1160             set
1161             {
1162                 SetValue(TileCoverAreaMultiplierProperty, value);
1163                 NotifyPropertyChanged();
1164             }
1165         }
1166
1167         /// <summary>
1168         /// Whether cursor is enabled or not by client.
1169         /// </summary>
1170         [EditorBrowsable(EditorBrowsableState.Never)]
1171         public bool CursorEnabledByClient
1172         {
1173             get
1174             {
1175                 return (bool)GetValue(CursorEnabledByClientProperty);
1176             }
1177             set
1178             {
1179                 SetValue(CursorEnabledByClientProperty, value);
1180                 NotifyPropertyChanged();
1181             }
1182         }
1183
1184         /// <summary>
1185         /// Gets selected text in web page.
1186         /// </summary>
1187         [EditorBrowsable(EditorBrowsableState.Never)]
1188         public string SelectedText
1189         {
1190             get
1191             {
1192                 return (string)GetValue(SelectedTextProperty);
1193             }
1194         }
1195
1196         /// <summary>
1197         /// Gets title of web page.
1198         /// </summary>
1199         /// <since_tizen> 9 </since_tizen>
1200         public string Title
1201         {
1202             get
1203             {
1204                 return (string)GetValue(TitleProperty);
1205             }
1206         }
1207
1208         /// <summary>
1209         /// Gets favicon of web page.
1210         /// </summary>
1211         /// <since_tizen> 9 </since_tizen>
1212         public ImageView Favicon
1213         {
1214             get
1215             {
1216                 global::System.IntPtr imageView = Interop.WebView.GetFavicon(SwigCPtr);
1217                 if (imageView == IntPtr.Zero)
1218                     return null;
1219                 return new ImageView(imageView, false);
1220             }
1221         }
1222
1223         /// <summary>
1224         /// Zoom factor of web page.
1225         /// </summary>
1226         [EditorBrowsable(EditorBrowsableState.Never)]
1227         public float PageZoomFactor
1228         {
1229             get
1230             {
1231                 return (float)GetValue(PageZoomFactorProperty);
1232             }
1233             set
1234             {
1235                 SetValue(PageZoomFactorProperty, value);
1236                 NotifyPropertyChanged();
1237             }
1238         }
1239
1240         /// <summary>
1241         /// Zoom factor of text in web page.
1242         /// </summary>
1243         [EditorBrowsable(EditorBrowsableState.Never)]
1244         public float TextZoomFactor
1245         {
1246             get
1247             {
1248                 return (float)GetValue(TextZoomFactorProperty);
1249             }
1250             set
1251             {
1252                 SetValue(TextZoomFactorProperty, value);
1253                 NotifyPropertyChanged();
1254             }
1255         }
1256
1257         /// <summary>
1258         /// Gets percentage of loading progress.
1259         /// </summary>
1260         /// <since_tizen> 9 </since_tizen>
1261         public float LoadProgressPercentage
1262         {
1263             get
1264             {
1265                 return (float)GetValue(LoadProgressPercentageProperty);
1266             }
1267         }
1268
1269         internal static new class Property
1270         {
1271             internal static readonly int Url = Interop.WebView.UrlGet();
1272             internal static readonly int UserAgent = Interop.WebView.UserAgentGet();
1273             internal static readonly int ScrollPosition = Interop.WebView.ScrollPositionGet();
1274             internal static readonly int ScrollSize = Interop.WebView.ScrollSizeGet();
1275             internal static readonly int ContentSize = Interop.WebView.ContentSizeGet();
1276             internal static readonly int Title = Interop.WebView.TitleGet();
1277             internal static readonly int VideoHoleEnabled = Interop.WebView.VideoHoleEnabledGet();
1278             internal static readonly int MouseEventsEnabled = Interop.WebView.MouseEventsEnabledGet();
1279             internal static readonly int KeyEventsEnabled = Interop.WebView.KeyEventsEnabledGet();
1280             internal static readonly int DocumentBackgroundColor = Interop.WebView.DocumentBackgroundColorGet();
1281             internal static readonly int TilesClearedWhenHidden = Interop.WebView.TilesClearedWhenHiddenGet();
1282             internal static readonly int TileCoverAreaMultiplier = Interop.WebView.TileCoverAreaMultiplierGet();
1283             internal static readonly int CursorEnabledByClient = Interop.WebView.CursorEnabledByClientGet();
1284             internal static readonly int SelectedText = Interop.WebView.SelectedTextGet();
1285             internal static readonly int PageZoomFactor = Interop.WebView.PageZoomFactorGet();
1286             internal static readonly int TextZoomFactor = Interop.WebView.TextZoomFactorGet();
1287             internal static readonly int LoadProgressPercentage = Interop.WebView.LoadProgressPercentageGet();
1288         }
1289
1290         private static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1291         {
1292             var webview = (WebView)bindable;
1293             if (newValue != null)
1294             {
1295                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.Url, new Tizen.NUI.PropertyValue((string)newValue));
1296             }
1297         }),
1298         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1299         {
1300             var webview = (WebView)bindable;
1301             string temp;
1302             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Url).Get(out temp);
1303             return temp;
1304         }));
1305
1306         private static readonly BindableProperty UserAgentProperty = BindableProperty.Create(nameof(UserAgent), typeof(string), typeof(WebView), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1307         {
1308             var webview = (WebView)bindable;
1309             if (newValue != null)
1310             {
1311                 Tizen.NUI.Object.SetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent, new Tizen.NUI.PropertyValue((string)newValue));
1312             }
1313         }),
1314         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1315         {
1316             var webview = (WebView)bindable;
1317             string temp;
1318             Tizen.NUI.Object.GetProperty((HandleRef)webview.SwigCPtr, WebView.Property.UserAgent).Get(out temp);
1319             return temp;
1320         }));
1321
1322         private static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1323         {
1324             var webview = (WebView)bindable;
1325             if (newValue != null)
1326             {
1327                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue));
1328             }
1329         },
1330         defaultValueCreator: (bindable) =>
1331         {
1332             var webview = (WebView)bindable;
1333             Vector2 temp = new Vector2(0.0f, 0.0f);
1334             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollPosition).Get(temp);
1335             return temp;
1336         });
1337
1338         private static readonly BindableProperty ScrollSizeProperty = BindableProperty.Create(nameof(ScrollSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1339         {
1340             var webview = (WebView)bindable;
1341             Vector2 temp = new Vector2(0.0f, 0.0f);
1342             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ScrollSize).Get(temp);
1343             return temp;
1344         });
1345
1346         private static readonly BindableProperty ContentSizeProperty = BindableProperty.Create(nameof(ContentSize), typeof(Vector2), typeof(WebView), null, defaultValueCreator: (bindable) =>
1347         {
1348             var webview = (WebView)bindable;
1349             Vector2 temp = new Vector2(0.0f, 0.0f);
1350             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.ContentSize).Get(temp);
1351             return temp;
1352         });
1353
1354         private static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1355         {
1356             var webview = (WebView)bindable;
1357             string title;
1358             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.Title).Get(out title);
1359             return title;
1360         });
1361
1362         private static readonly BindableProperty VideoHoleEnabledProperty = BindableProperty.Create(nameof(VideoHoleEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1363         {
1364             var webview = (WebView)bindable;
1365             if (newValue != null)
1366             {
1367                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1368             }
1369         },
1370         defaultValueCreator: (bindable) =>
1371         {
1372             var webview = (WebView)bindable;
1373             bool temp;
1374             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.VideoHoleEnabled).Get(out temp);
1375             return temp;
1376         });
1377
1378         private static readonly BindableProperty MouseEventsEnabledProperty = BindableProperty.Create(nameof(MouseEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1379         {
1380             var webview = (WebView)bindable;
1381             if (newValue != null)
1382             {
1383                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1384             }
1385         },
1386         defaultValueCreator: (bindable) =>
1387         {
1388             var webview = (WebView)bindable;
1389             bool temp;
1390             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.MouseEventsEnabled).Get(out temp);
1391             return temp;
1392         });
1393
1394         private static readonly BindableProperty KeyEventsEnabledProperty = BindableProperty.Create(nameof(KeyEventsEnabled), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1395         {
1396             var webview = (WebView)bindable;
1397             if (newValue != null)
1398             {
1399                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled, new Tizen.NUI.PropertyValue((bool)newValue));
1400             }
1401         },
1402         defaultValueCreator: (bindable) =>
1403         {
1404             var webview = (WebView)bindable;
1405             bool temp;
1406             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.KeyEventsEnabled).Get(out temp);
1407             return temp;
1408         });
1409
1410         private static readonly BindableProperty ContentBackgroundColorProperty = BindableProperty.Create(nameof(ContentBackgroundColor), typeof(Color), typeof(WebView), null, propertyChanged: (bindable, oldValue, newValue) =>
1411         {
1412             var webview = (WebView)bindable;
1413             if (newValue != null)
1414             {
1415                 webview.contentBackgroundColor = (Color)newValue;
1416                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.DocumentBackgroundColor, new Tizen.NUI.PropertyValue((Color)newValue));
1417             }
1418         },
1419         defaultValueCreator: (bindable) =>
1420         {
1421             var webview = (WebView)bindable;
1422             return webview.contentBackgroundColor;
1423         });
1424
1425         private static readonly BindableProperty TilesClearedWhenHiddenProperty = BindableProperty.Create(nameof(TilesClearedWhenHidden), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1426         {
1427             var webview = (WebView)bindable;
1428             if (newValue != null)
1429             {
1430                 webview.tilesClearedWhenHidden = (bool)newValue;
1431                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TilesClearedWhenHidden, new Tizen.NUI.PropertyValue((bool)newValue));
1432             }
1433         },
1434         defaultValueCreator: (bindable) =>
1435         {
1436             var webview = (WebView)bindable;
1437             return webview.tilesClearedWhenHidden;
1438         });
1439
1440         private static readonly BindableProperty TileCoverAreaMultiplierProperty = BindableProperty.Create(nameof(TileCoverAreaMultiplier), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1441         {
1442             var webview = (WebView)bindable;
1443             if (newValue != null)
1444             {
1445                 webview.tileCoverAreaMultiplier = (float)newValue;
1446                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TileCoverAreaMultiplier, new Tizen.NUI.PropertyValue((float)newValue));
1447             }
1448         },
1449         defaultValueCreator: (bindable) =>
1450         {
1451             var webview = (WebView)bindable;
1452             return webview.tileCoverAreaMultiplier;
1453         });
1454
1455         private static readonly BindableProperty CursorEnabledByClientProperty = BindableProperty.Create(nameof(CursorEnabledByClient), typeof(bool), typeof(WebView), true, propertyChanged: (bindable, oldValue, newValue) =>
1456         {
1457             var webview = (WebView)bindable;
1458             if (newValue != null)
1459             {
1460                 webview.cursorEnabledByClient = (bool)newValue;
1461                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.CursorEnabledByClient, new Tizen.NUI.PropertyValue((bool)newValue));
1462             }
1463         },
1464         defaultValueCreator: (bindable) =>
1465         {
1466             var webview = (WebView)bindable;
1467             return webview.cursorEnabledByClient;
1468         });
1469
1470         private static readonly BindableProperty SelectedTextProperty = BindableProperty.Create(nameof(SelectedText), typeof(string), typeof(WebView), string.Empty, defaultValueCreator: (bindable) =>
1471         {
1472             var webview = (WebView)bindable;
1473             string text;
1474             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.SelectedText).Get(out text);
1475             return text;
1476         });
1477
1478         private static readonly BindableProperty PageZoomFactorProperty = BindableProperty.Create(nameof(PageZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1479         {
1480             var webview = (WebView)bindable;
1481             if (newValue != null)
1482             {
1483                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1484             }
1485         },
1486         defaultValueCreator: (bindable) =>
1487         {
1488             var webview = (WebView)bindable;
1489             float temp;
1490             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.PageZoomFactor).Get(out temp);
1491             return temp;
1492         });
1493
1494         private static readonly BindableProperty TextZoomFactorProperty = BindableProperty.Create(nameof(TextZoomFactor), typeof(float), typeof(WebView), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
1495         {
1496             var webview = (WebView)bindable;
1497             if (newValue != null)
1498             {
1499                 Tizen.NUI.Object.SetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor, new Tizen.NUI.PropertyValue((float)newValue));
1500             }
1501         },
1502         defaultValueCreator: (bindable) =>
1503         {
1504             var webview = (WebView)bindable;
1505             float temp;
1506             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.TextZoomFactor).Get(out temp);
1507             return temp;
1508         });
1509
1510         private static readonly BindableProperty LoadProgressPercentageProperty = BindableProperty.Create(nameof(LoadProgressPercentage), typeof(float), typeof(WebView), 0.0f, defaultValueCreator: (bindable) =>
1511         {
1512             var webview = (WebView)bindable;
1513             float percentage;
1514             Tizen.NUI.Object.GetProperty(webview.SwigCPtr, WebView.Property.LoadProgressPercentage).Get(out percentage);
1515             return percentage;
1516         });
1517
1518         // For rooting handlers
1519         internal Dictionary<string, JavaScriptMessageHandler> handlerRootMap = new Dictionary<string, JavaScriptMessageHandler>();
1520
1521         /// <summary>
1522         /// Loads a html.
1523         /// </summary>
1524         /// <param name="url">The path of Web</param>
1525         /// <remarks>
1526         /// The following privileges are required:
1527         /// http://tizen.org/privilege/internet for remote web pages of websites.
1528         /// http://tizen.org/privilege/mediastorage for local files in media storage.
1529         /// http://tizen.org/privilege/externalstorage for local files in external storage.
1530         /// </remarks>
1531         /// <since_tizen> 9 </since_tizen>
1532         public void LoadUrl(string url)
1533         {
1534             Interop.WebView.LoadUrl(SwigCPtr, url);
1535             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1536         }
1537
1538         /// <summary>
1539         /// Deprecated. Loads a html by string.
1540         /// </summary>
1541         /// <param name="data">The data of Web</param>
1542         [EditorBrowsable(EditorBrowsableState.Never)]
1543         public void LoadHTMLString(string data)
1544         {
1545             Interop.WebView.LoadHtmlString(SwigCPtr, data);
1546             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1547         }
1548
1549         /// <summary>
1550         /// Loads a html by string.
1551         /// </summary>
1552         /// <param name="data">The data of Web</param>
1553         /// <since_tizen> 9 </since_tizen>
1554         public void LoadHtmlString(string data)
1555         {
1556             Interop.WebView.LoadHtmlString(SwigCPtr, data);
1557             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1558         }
1559
1560         /// <summary>
1561         /// Loads the specified html as the content of the view to override current history entry.
1562         /// </summary>
1563         /// <param name="html">The html to be loaded</param>
1564         /// <param name="baseUri">Base URL used for relative paths to external objects</param>
1565         /// <param name="unreachableUri">URL that could not be reached</param>
1566         [EditorBrowsable(EditorBrowsableState.Never)]
1567         public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
1568         {
1569             bool result = Interop.WebView.LoadHtmlStringOverrideCurrentEntry(SwigCPtr, html, baseUri, unreachableUri);
1570             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1571             return result;
1572         }
1573
1574         /// <summary>
1575         /// Requests to load the given contents by MIME type.
1576         /// </summary>
1577         /// <param name="contents">The contents to be loaded</param>
1578         /// <param name="contentSize">The size of contents (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(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
1584         {
1585             bool result = Interop.WebView.LoadContents(SwigCPtr, contents, contentSize, mimeType, encoding, baseUri);
1586             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1587             return result;
1588         }
1589
1590         /// <summary>
1591         /// Reloads the Web
1592         /// </summary>
1593         [EditorBrowsable(EditorBrowsableState.Never)]
1594         public void Reload()
1595         {
1596             Interop.WebView.Reload(SwigCPtr);
1597             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1598         }
1599
1600         /// <summary>
1601         /// Reloads the current page's document without cache
1602         /// </summary>
1603         [EditorBrowsable(EditorBrowsableState.Never)]
1604         public bool ReloadWithoutCache()
1605         {
1606             bool result = Interop.WebView.ReloadWithoutCache(SwigCPtr);
1607             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1608             return result;
1609         }
1610
1611         /// <summary>
1612         /// Stops loading the Web
1613         /// </summary>
1614         [EditorBrowsable(EditorBrowsableState.Never)]
1615         public void StopLoading()
1616         {
1617             Interop.WebView.StopLoading(SwigCPtr);
1618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1619         }
1620
1621         /// <summary>
1622         /// Suspends the operation.
1623         /// </summary>
1624         [EditorBrowsable(EditorBrowsableState.Never)]
1625         public void Suspend()
1626         {
1627             Interop.WebView.Suspend(SwigCPtr);
1628             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1629         }
1630
1631         /// <summary>
1632         /// Resumes the operation after calling Suspend()
1633         /// </summary>
1634         [EditorBrowsable(EditorBrowsableState.Never)]
1635         public void Resume()
1636         {
1637             Interop.WebView.Resume(SwigCPtr);
1638             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1639         }
1640
1641         /// <summary>
1642         /// Suspends all network loading.
1643         /// </summary>
1644         [EditorBrowsable(EditorBrowsableState.Never)]
1645         public void SuspendNetworkLoading()
1646         {
1647             Interop.WebView.SuspendNetworkLoading(SwigCPtr);
1648             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1649         }
1650
1651         /// <summary>
1652         /// Resumes all network loading.
1653         /// </summary>
1654         [EditorBrowsable(EditorBrowsableState.Never)]
1655         public void ResumeNetworkLoading()
1656         {
1657             Interop.WebView.ResumeNetworkLoading(SwigCPtr);
1658             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1659         }
1660
1661         /// <summary>
1662         /// Adds custom header.
1663         /// </summary>
1664         /// <param name="name">The name of custom header</param>
1665         /// <param name="value">The value of custom header</param>
1666         [EditorBrowsable(EditorBrowsableState.Never)]
1667         public bool AddCustomHeader(string name, string value)
1668         {
1669             bool result = Interop.WebView.AddCustomHeader(SwigCPtr, name, value);
1670             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1671             return result;
1672         }
1673
1674         /// <summary>
1675         /// Removes custom header.
1676         /// </summary>
1677         /// <param name="name">The name of custom header</param>
1678         [EditorBrowsable(EditorBrowsableState.Never)]
1679         public bool RemoveCustomHeader(string name)
1680         {
1681             bool result = Interop.WebView.RemoveCustomHeader(SwigCPtr, name);
1682             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1683             return result;
1684         }
1685
1686         /// <summary>
1687         /// Starts the inspector server.
1688         /// </summary>
1689         /// <param name="port">The port number</param>
1690         [EditorBrowsable(EditorBrowsableState.Never)]
1691         public uint StartInspectorServer(uint port)
1692         {
1693             uint result = Interop.WebView.StartInspectorServer(SwigCPtr, port);
1694             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1695             return result;
1696         }
1697
1698         /// <summary>
1699         /// Stops the inspector server.
1700         /// </summary>
1701         [EditorBrowsable(EditorBrowsableState.Never)]
1702         public bool StopInspectorServer()
1703         {
1704             bool result = Interop.WebView.StopInspectorServer(SwigCPtr);
1705             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1706             return result;
1707         }
1708
1709         /// <summary>
1710         /// Scrolls page of web view by deltaX and detlaY.
1711         /// </summary>
1712         /// <param name="deltaX">The deltaX of scroll</param>
1713         /// <param name="deltaY">The deltaY of scroll</param>
1714         [EditorBrowsable(EditorBrowsableState.Never)]
1715         public void ScrollBy(int deltaX, int deltaY)
1716         {
1717             Interop.WebView.ScrollBy(SwigCPtr, deltaX, deltaY);
1718             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1719         }
1720
1721         /// <summary>
1722         /// Scrolls edge of web view by deltaX and deltaY.
1723         /// </summary>
1724         /// <param name="deltaX">The deltaX of scroll</param>
1725         /// <param name="deltaY">The deltaY of scroll</param>
1726         [EditorBrowsable(EditorBrowsableState.Never)]
1727         public bool ScrollEdgeBy(int deltaX, int deltaY)
1728         {
1729             bool result = Interop.WebView.ScrollEdgeBy(SwigCPtr, deltaX, deltaY);
1730             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1731             return result;
1732         }
1733
1734         /// <summary>
1735         /// Goes to the back
1736         /// </summary>
1737         [EditorBrowsable(EditorBrowsableState.Never)]
1738         public void GoBack()
1739         {
1740             Interop.WebView.GoBack(SwigCPtr);
1741             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1742         }
1743
1744         /// <summary>
1745         /// Goes to the forward
1746         /// </summary>
1747         [EditorBrowsable(EditorBrowsableState.Never)]
1748         public void GoForward()
1749         {
1750             Interop.WebView.GoForward(SwigCPtr);
1751             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1752         }
1753
1754         /// <summary>
1755         /// Returns whether backward is possible.
1756         /// </summary>
1757         /// <returns>True if backward is possible, false otherwise</returns>
1758         [EditorBrowsable(EditorBrowsableState.Never)]
1759         public bool CanGoBack()
1760         {
1761             bool ret = Interop.WebView.CanGoBack(SwigCPtr);
1762             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1763             return ret;
1764         }
1765
1766         /// <summary>
1767         /// Returns whether forward is possible.
1768         /// </summary>
1769         /// <returns>True if forward is possible, false otherwise</returns>
1770         [EditorBrowsable(EditorBrowsableState.Never)]
1771         public bool CanGoForward()
1772         {
1773             bool ret = Interop.WebView.CanGoForward(SwigCPtr);
1774             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1775             return ret;
1776         }
1777
1778         /// <summary>
1779         /// Evaluates JavaScript code represented as a string.
1780         /// </summary>
1781         /// <param name="script">The JavaScript code</param>
1782         [EditorBrowsable(EditorBrowsableState.Never)]
1783         public void EvaluateJavaScript(string script)
1784         {
1785             Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero));
1786             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1787         }
1788
1789         /// <summary>
1790         /// Evaluates JavaScript code represented as a string.
1791         /// </summary>
1792         /// <param name="script">The JavaScript code</param>
1793         /// <param name="handler">The callback for result of JavaScript code evaluation</param>
1794         [EditorBrowsable(EditorBrowsableState.Never)]
1795         public void EvaluateJavaScript(string script, JavaScriptMessageHandler handler)
1796         {
1797             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1798             Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(this, ip));
1799             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1800         }
1801
1802         /// <summary>
1803         /// Add a message handler into the WebView.
1804         /// </summary>
1805         /// <param name="objectName">The name of exposed object</param>
1806         /// <param name="handler">The callback function</param>
1807         [EditorBrowsable(EditorBrowsableState.Never)]
1808         public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler)
1809         {
1810             if (handlerRootMap.ContainsKey(objectName))
1811             {
1812                 return;
1813             }
1814
1815             handlerRootMap.Add(objectName, handler);
1816
1817             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler);
1818             Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip));
1819
1820             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1821         }
1822
1823         /// <summary>
1824         /// Registers a callback for JS alert.
1825         /// </summary>
1826         /// <param name="callback">The callback function</param>
1827         [EditorBrowsable(EditorBrowsableState.Never)]
1828         public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback)
1829         {
1830             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1831             Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1832
1833             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1834         }
1835
1836         /// <summary>
1837         /// Reply for alert popup.
1838         /// </summary>
1839         [EditorBrowsable(EditorBrowsableState.Never)]
1840         public void JavaScriptAlertReply()
1841         {
1842             Interop.WebView.JavaScriptAlertReply(SwigCPtr);
1843             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1844         }
1845
1846         /// <summary>
1847         /// Registers a callback for JS confirm.
1848         /// </summary>
1849         /// <param name="callback">The callback function</param>
1850         [EditorBrowsable(EditorBrowsableState.Never)]
1851         public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback)
1852         {
1853             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1854             Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1855
1856             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1857         }
1858
1859         /// <summary>
1860         /// Reply for confirm popup.
1861         /// </summary>
1862         /// <param name="confirmed">Confirmed or not</param>
1863         [EditorBrowsable(EditorBrowsableState.Never)]
1864         public void JavaScriptConfirmReply(bool confirmed)
1865         {
1866             Interop.WebView.JavaScriptConfirmReply(SwigCPtr, confirmed);
1867             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1868         }
1869
1870         /// <summary>
1871         /// Registers a callback for JS promt.
1872         /// </summary>
1873         /// <param name="callback">The callback function</param>
1874         [EditorBrowsable(EditorBrowsableState.Never)]
1875         public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback)
1876         {
1877             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback);
1878             Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
1879
1880             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1881         }
1882
1883         /// <summary>
1884         /// Reply for prompt popup.
1885         /// </summary>
1886         /// <param name="result">Text in prompt input field.</param>
1887         [EditorBrowsable(EditorBrowsableState.Never)]
1888         public void JavaScriptPromptReply(string result)
1889         {
1890             Interop.WebView.JavaScriptPromptReply(SwigCPtr, result);
1891             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1892         }
1893
1894         /// <summary>
1895         /// Clears title resources of current WebView.
1896         /// </summary>
1897         [EditorBrowsable(EditorBrowsableState.Never)]
1898         public void ClearAllTilesResources()
1899         {
1900             Interop.WebView.ClearAllTilesResources(SwigCPtr);
1901             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1902         }
1903
1904         /// <summary>
1905         /// Clears the history of current WebView.
1906         /// </summary>
1907         [EditorBrowsable(EditorBrowsableState.Never)]
1908         public void ClearHistory()
1909         {
1910             Interop.WebView.ClearHistory(SwigCPtr);
1911             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1912         }
1913
1914         /// <summary>
1915         /// Scales the current page, centered at the given point.
1916         /// </summary>
1917         /// <param name="scaleFactor">The new factor to be scaled</param>
1918         /// <param name="point">The center coordinate</param>
1919         [EditorBrowsable(EditorBrowsableState.Never)]
1920         public void SetScaleFactor(float scaleFactor, Vector2 point)
1921         {
1922             Interop.WebView.SetScaleFactor(SwigCPtr, scaleFactor, Vector2.getCPtr(point));
1923             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1924         }
1925
1926         /// <summary>
1927         /// Gets the current scale factor of the page.
1928         /// </summary>
1929         [EditorBrowsable(EditorBrowsableState.Never)]
1930         public float GetScaleFactor()
1931         {
1932             float result = Interop.WebView.GetScaleFactor(SwigCPtr);
1933             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1934             return result;
1935         }
1936
1937         /// <summary>
1938         /// Requests to activate/deactivate the accessibility usage set by web app.
1939         /// </summary>
1940         /// <param name="activated">The new factor to be scaled</param>
1941         [EditorBrowsable(EditorBrowsableState.Never)]
1942         public void ActivateAccessibility(bool activated)
1943         {
1944             Interop.WebView.ActivateAccessibility(SwigCPtr, activated);
1945             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1946         }
1947
1948         /// <summary>
1949         /// Searches and highlights the given string in the document.
1950         /// </summary>
1951         /// <param name="text">The text to be searched</param>
1952         /// <param name="options">The options to search</param>
1953         /// <param name="maxMatchCount">The maximum match count to search</param>
1954         [EditorBrowsable(EditorBrowsableState.Never)]
1955         public bool HighlightText(string text, FindOption options, uint maxMatchCount)
1956         {
1957             bool result = Interop.WebView.HighlightText(SwigCPtr, text, (int)options, maxMatchCount);
1958             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1959             return result;
1960         }
1961
1962         /// <summary>
1963         /// Adds dynamic certificate path.
1964         /// </summary>
1965         /// <param name="host">Host that required client authentication</param>
1966         /// <param name="certPath">The file path stored certificate</param>
1967         [EditorBrowsable(EditorBrowsableState.Never)]
1968         public void AddDynamicCertificatePath(string host, string certPath)
1969         {
1970             Interop.WebView.AddDynamicCertificatePath(SwigCPtr, host, certPath);
1971             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1972         }
1973
1974         /// <summary>
1975         /// Get snapshot of the specified viewArea of page.
1976         /// </summary>
1977         /// <param name="viewArea">Host that required client authentication</param>
1978         /// <param name="scaleFactor">The file path stored certificate</param>
1979         [EditorBrowsable(EditorBrowsableState.Never)]
1980         public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
1981         {
1982             IntPtr image = Interop.WebView.GetScreenshot(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor);
1983             ImageView imageView = new ImageView(image, true);
1984             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1985             return imageView;
1986         }
1987
1988         /// <summary>
1989         /// Get snapshot of the specified viewArea of page.
1990         /// </summary>
1991         /// <param name="viewArea">Host that required client authentication</param>
1992         /// <param name="scaleFactor">The file path stored certificate</param>
1993         /// <param name="callback">The callback for getting screen shot</param>
1994         [EditorBrowsable(EditorBrowsableState.Never)]
1995         public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, ScreenshotAcquiredCallback callback)
1996         {
1997             screenshotAcquiredCallback = callback;
1998             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(screenshotAcquiredProxyCallback);
1999             bool result = Interop.WebView.GetScreenshotAsynchronously(SwigCPtr, Rectangle.getCPtr(viewArea), scaleFactor, new HandleRef(this, ip));
2000             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2001             return result;
2002         }
2003
2004         /// <summary>
2005         /// Asynchronously requests to check if there is a video playing in the given view.
2006         /// </summary>
2007         /// <param name="callback">The callback called after checking if video is playing or not</param>
2008         [EditorBrowsable(EditorBrowsableState.Never)]
2009         public bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback)
2010         {
2011             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
2012             bool result = Interop.WebView.CheckVideoPlayingAsynchronously(SwigCPtr, new HandleRef(this, ip));
2013             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2014             return result;
2015         }
2016
2017         /// <summary>
2018         /// Registers callback which will be called upon geolocation permission request.
2019         /// </summary>
2020         /// <param name="callback">The callback for requesting geolocation permission</param>
2021         [EditorBrowsable(EditorBrowsableState.Never)]
2022         public void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
2023         {
2024             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
2025             Interop.WebView.RegisterGeolocationPermissionCallback(SwigCPtr, new HandleRef(this, ip));
2026             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2027         }
2028
2029         /// <summary>
2030         /// Does hit test synchronously.
2031         /// </summary>
2032         /// <param name="x">the horizontal position to query</param>
2033         /// <param name="y">the vertical position to query</param>
2034         /// <param name="mode">the mode of hit test</param>
2035         [EditorBrowsable(EditorBrowsableState.Never)]
2036         public WebHitTestResult HitTest(int x, int y, HitTestMode mode)
2037         {
2038             System.IntPtr result = Interop.WebView.CreateHitTest(SwigCPtr, x, y, (int)mode);
2039             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2040             return new WebHitTestResult(result, true);
2041         }
2042
2043         /// <summary>
2044         /// Does hit test asynchronously.
2045         /// </summary>
2046         /// <param name="x">the horizontal position to query</param>
2047         /// <param name="y">the vertical position to query</param>
2048         /// <param name="mode">the mode of hit test</param>
2049         /// <param name="callback">the callback that is called after hit test is finished.</param>
2050         [EditorBrowsable(EditorBrowsableState.Never)]
2051         public bool HitTestAsynchronously(int x, int y, HitTestMode mode, HitTestFinishedCallback callback)
2052         {
2053             hitTestFinishedCallback = callback;
2054             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(hitTestFinishedProxyCallback);
2055             bool result = Interop.WebView.CreateHitTestAsynchronously(SwigCPtr, x, y, (int)mode, new HandleRef(this, ip));
2056             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2057             return result;
2058         }
2059
2060         /// <summary>
2061         /// Deprecated. Clears the cache of current WebView.
2062         /// </summary>
2063         [EditorBrowsable(EditorBrowsableState.Never)]
2064         public void ClearCache()
2065         {
2066             Context.ClearCache();
2067         }
2068
2069         /// <summary>
2070         /// Deprecated. Clears all the cookies of current WebView.
2071         /// </summary>
2072         [EditorBrowsable(EditorBrowsableState.Never)]
2073         public void ClearCookies()
2074         {
2075             CookieManager.ClearCookies();
2076         }
2077
2078         /// <summary>
2079         /// Sets the tts focus to the webview.
2080         /// Please note that it only works when the webview does not have keyinput focus.
2081         /// If the webview has a keyinput focus, it also has tts focus so calling SetTtsFocus(false) is ignored.
2082         /// </summary>
2083         /// <param name="focused">Focused or not</param>
2084         [EditorBrowsable(EditorBrowsableState.Never)]
2085         public void SetTtsFocus(bool focused)
2086         {
2087             Interop.WebView.SetTtsFocus(SwigCPtr, focused);
2088             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2089         }
2090
2091         /// <summary>
2092         /// Get a plain text of current web page asynchronously.
2093         /// Please note that it gets plain text of currently loaded page so please call this method after page load finished.
2094         /// </summary>
2095         /// <param name="callback">The callback for getting plain text</param>
2096         [EditorBrowsable(EditorBrowsableState.Never)]
2097         public void GetPlainTextAsynchronously(PlainTextReceivedCallback callback)
2098         {
2099             plainTextReceivedCallback = callback;
2100             System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(plainTextReceivedCallback);
2101             Interop.WebView.GetPlainTextAsynchronously(SwigCPtr, new HandleRef(this, ip));
2102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2103         }
2104
2105         internal static WebView DownCast(BaseHandle handle)
2106         {
2107             WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true);
2108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2109             return ret;
2110         }
2111
2112         internal WebView Assign(WebView webView)
2113         {
2114             WebView ret = new WebView(Interop.WebView.Assign(SwigCPtr, WebView.getCPtr(webView)), false);
2115             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2116             return ret;
2117         }
2118
2119         private void OnPageLoadStarted(string pageUrl)
2120         {
2121             WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2122
2123             e.WebView = this;
2124             e.PageUrl = pageUrl;
2125
2126             pageLoadStartedEventHandler?.Invoke(this, e);
2127         }
2128
2129         private void OnPageLoading(string pageUrl)
2130         {
2131             pageLoadingEventHandler?.Invoke(this, new WebViewPageLoadEventArgs());
2132         }
2133
2134         private void OnPageLoadFinished(string pageUrl)
2135         {
2136             WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
2137
2138             e.WebView = this;
2139             e.PageUrl = pageUrl;
2140
2141             pageLoadFinishedEventHandler?.Invoke(this, e);
2142         }
2143
2144         private void OnPageLoadError(IntPtr error)
2145         {
2146             pageLoadErrorEventHandler?.Invoke(this, new WebViewPageLoadErrorEventArgs(new WebPageLoadError(error, true)));
2147         }
2148
2149         private void OnScrollEdgeReached(int edge)
2150         {
2151             scrollEdgeReachedEventHandler?.Invoke(this, new WebViewScrollEdgeReachedEventArgs((WebViewScrollEdgeReachedEventArgs.Edge)edge));
2152         }
2153
2154         private void OnUrlChanged(string pageUrl)
2155         {
2156             urlChangedEventHandler?.Invoke(this, new WebViewUrlChangedEventArgs(pageUrl));
2157         }
2158
2159         private void OnFormRepostPolicyDecided(IntPtr decision)
2160         {
2161             formRepostPolicyDecidedEventHandler?.Invoke(this, new WebViewFormRepostPolicyDecidedEventArgs(new WebFormRepostPolicyDecisionMaker(decision, true)));
2162         }
2163
2164         private void OnFrameRendered()
2165         {
2166             frameRenderedEventHandler?.Invoke(this, new EventArgs());
2167         }
2168
2169         private void OnScreenshotAcquired(IntPtr data)
2170         {
2171 #pragma warning disable CA2000 // Dispose objects before losing scope
2172             screenshotAcquiredCallback?.Invoke(new ImageView(data, true));
2173 #pragma warning restore CA2000 // Dispose objects before losing scope
2174         }
2175
2176         private void OnResponsePolicyDecided(IntPtr maker)
2177         {
2178             responsePolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2179         }
2180
2181         private void OnNavigationPolicyDecided(IntPtr maker)
2182         {
2183             navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
2184         }
2185
2186         private void OnNewWindowCreated(out IntPtr viewHandle)
2187         {
2188             WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs());
2189             viewHandle = (IntPtr)view.SwigCPtr;
2190         }
2191
2192         private void OnCertificateConfirmed(IntPtr certificate)
2193         {
2194             certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2195         }
2196
2197         private void OnSslCertificateChanged(IntPtr certificate)
2198         {
2199             sslCertificateChangedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));
2200         }
2201
2202         private void OnHttpAuthRequested(IntPtr handler)
2203         {
2204             httpAuthRequestedEventHandler?.Invoke(this, new WebViewHttpAuthRequestedEventArgs(new WebHttpAuthHandler(handler, true)));
2205         }
2206
2207         private void OnConsoleMessageReceived(IntPtr message)
2208         {
2209             consoleMessageReceivedEventHandler?.Invoke(this, new WebViewConsoleMessageReceivedEventArgs(new WebConsoleMessage(message, true)));
2210         }
2211
2212         private void OnContextMenuShown(IntPtr menu)
2213         {
2214             contextMenuShownEventHandler?.Invoke(this, new WebViewContextMenuShownEventArgs(new WebContextMenu(menu, true)));
2215         }
2216
2217         private void OnContextMenuHidden(IntPtr menu)
2218         {
2219             contextMenuHiddenEventHandler?.Invoke(this, new WebViewContextMenuHiddenEventArgs(new WebContextMenu(menu, true)));
2220         }
2221
2222         private void OnHitTestFinished(IntPtr test)
2223         {
2224 #pragma warning disable CA2000 // Dispose objects before losing scope
2225             hitTestFinishedCallback?.Invoke(new WebHitTestResult(test, true));
2226 #pragma warning restore CA2000 // Dispose objects before losing scope
2227         }
2228     }
2229 }