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