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