[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterNavigationPolicyDecidedCallback")]
public static extern void RegisterNavigationPolicyDecidedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterNewWindowCreatedCallback")]
+ public static extern void RegisterNewWindowCreatedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterCertificateConfirmedCallback")]
public static extern void RegisterCertificateConfirmedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
private EventHandler<WebViewPolicyDecidedEventArgs> navigationPolicyDecidedEventHandler;
private WebViewPolicyDecidedCallback navigationPolicyDecidedCallback;
+ private EventHandlerWithReturnType<object, EventArgs, WebView> newWindowCreatedEventHandler;
+ private WebViewNewWindowCreatedCallback newWindowCreatedCallback;
+
private EventHandler<WebViewCertificateReceivedEventArgs> certificateConfirmedEventHandler;
private WebViewCertificateReceivedCallback certificateConfirmedCallback;
private delegate void WebViewPolicyDecidedCallback(IntPtr maker);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void WebViewNewWindowCreatedCallback(out IntPtr outView);
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void WebViewCertificateReceivedCallback(IntPtr certificate);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
}
/// <summary>
+ /// Event for the NewWindowCreated signal which can be used to subscribe or unsubscribe the event handler.<br />
+ /// This signal is emitted when a new window would be created.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandlerWithReturnType<object, EventArgs, WebView> NewWindowCreated
+ {
+ add
+ {
+ if (newWindowCreatedEventHandler == null)
+ {
+ newWindowCreatedCallback = OnNewWindowCreated;
+ System.IntPtr ip = Marshal.GetFunctionPointerForDelegate(newWindowCreatedCallback);
+ Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ newWindowCreatedEventHandler += value;
+ }
+ remove
+ {
+ newWindowCreatedEventHandler -= value;
+ }
+ }
+
+ /// <summary>
/// Event for the CertificateConfirmed signal which can be used to subscribe or unsubscribe the event handler.<br />
/// This signal is emitted when certificate would be confirmed.<br />
/// </summary>
navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
}
+ private void OnNewWindowCreated(out IntPtr viewHandle)
+ {
+ WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs());
+ viewHandle = (IntPtr)view.SwigCPtr;
+ }
+
private void OnCertificateConfirmed(IntPtr certificate)
{
certificateConfirmedEventHandler?.Invoke(this, new WebViewCertificateReceivedEventArgs(new WebCertificate(certificate, true)));