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