[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ClearHistory")]
public static extern void ClearHistory(global::System.Runtime.InteropServices.HandleRef jarg1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ExitFullscreen")]
+ public static extern void ExitFullscreen(global::System.Runtime.InteropServices.HandleRef jarg1);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SetScaleFactor")]
public static extern void SetScaleFactor(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
[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_RegisterNewWindowPolicyDecidedCallback")]
+ public static extern void RegisterNewWindowPolicyDecidedCallback(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_RegisterContextMenuHiddenCallback")]
public static extern void RegisterContextMenuHiddenCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterFullscreenEnteredCallback")]
+ public static extern void RegisterFullscreenEnteredCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterFullscreenExitedCallback")]
+ public static extern void RegisterFullscreenExitedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterTextFoundCallback")]
+ public static extern void RegisterTextFoundCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetPlainTextAsynchronously")]
public static extern void GetPlainTextAsynchronously(global::System.Runtime.InteropServices.HandleRef webViewRef, global::System.Runtime.InteropServices.HandleRef callbackRef);
}
private EventHandler<WebViewPolicyDecidedEventArgs> navigationPolicyDecidedEventHandler;
private WebViewPolicyDecidedCallback navigationPolicyDecidedCallback;
+ private EventHandler<WebViewPolicyDecidedEventArgs> newWindowPolicyDecidedEventHandler;
+ private WebViewPolicyDecidedCallback newWindowPolicyDecidedCallback;
+
private EventHandlerWithReturnType<object, EventArgs, WebView> newWindowCreatedEventHandler;
private WebViewNewWindowCreatedCallback newWindowCreatedCallback;
private EventHandler<WebViewContextMenuHiddenEventArgs> contextMenuHiddenEventHandler;
private WebViewContextMenuHiddenCallback contextMenuHiddenCallback;
- private PlainTextReceivedCallback plainTextReceivedCallback;
+ private EventHandler<EventArgs> fullscreenEnteredEventHandler;
+ private WebViewFullscreenEnteredCallback fullscreenEnteredCallback;
+
+ private EventHandler<EventArgs> fullscreenExitedEventHandler;
+ private WebViewFullscreenExitedCallback fullscreenExitedCallback;
+ private EventHandler<WebViewTextFoundEventArgs> textFoundEventHandler;
+ private WebViewTextFoundCallback textFoundCallback;
+
+ private PlainTextReceivedCallback plainTextReceivedCallback;
/// <summary>
/// Creates a WebView.
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void WebViewContextMenuHiddenCallback(IntPtr menu);
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void WebViewFullscreenEnteredCallback();
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void WebViewFullscreenExitedCallback();
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void WebViewTextFoundCallback(uint count);
+
/// <summary>
/// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.<br />
/// This signal is emitted when page loading has started.<br />
}
/// <summary>
+ /// Event for the NewWindowPolicyDecided signal which can be used to subscribe or unsubscribe the event handler.<br />
+ /// This signal is emitted when new window policy would be decided.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<WebViewPolicyDecidedEventArgs> NewWindowPolicyDecided
+ {
+ add
+ {
+ if (newWindowPolicyDecidedEventHandler == null)
+ {
+ newWindowPolicyDecidedCallback = OnNewWindowPolicyDecided;
+ IntPtr ip = Marshal.GetFunctionPointerForDelegate(newWindowPolicyDecidedCallback);
+ Interop.WebView.RegisterNewWindowPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ newWindowPolicyDecidedEventHandler += value;
+ }
+ remove
+ {
+ newWindowPolicyDecidedEventHandler -= value;
+ if (newWindowPolicyDecidedEventHandler == null)
+ {
+ IntPtr ip = IntPtr.Zero;
+ Interop.WebView.RegisterNewWindowPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ }
+ }
+
+ /// <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>
}
/// <summary>
+ /// Event for the FullscreenEntered signal which can be used to subscribe or unsubscribe the event handler.<br />
+ /// This signal is emitted when fullscreen is entered.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<EventArgs> FullscreenEntered
+ {
+ add
+ {
+ if (fullscreenEnteredEventHandler == null)
+ {
+ fullscreenEnteredCallback = OnFullscreenEntered;
+ IntPtr ip = Marshal.GetFunctionPointerForDelegate(fullscreenEnteredCallback);
+ Interop.WebView.RegisterFullscreenEnteredCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ fullscreenEnteredEventHandler += value;
+ }
+ remove
+ {
+ fullscreenEnteredEventHandler -= value;
+ if (fullscreenEnteredEventHandler == null)
+ {
+ IntPtr ip = IntPtr.Zero;
+ Interop.WebView.RegisterFullscreenEnteredCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Event for the FullscreenExited signal which can be used to subscribe or unsubscribe the event handler.<br />
+ /// This signal is emitted when fullscreen is exited.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<EventArgs> FullscreenExited
+ {
+ add
+ {
+ if (fullscreenExitedEventHandler == null)
+ {
+ fullscreenExitedCallback = OnFullscreenExited;
+ IntPtr ip = Marshal.GetFunctionPointerForDelegate(fullscreenExitedCallback);
+ Interop.WebView.RegisterFullscreenExitedCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ fullscreenExitedEventHandler += value;
+ }
+ remove
+ {
+ fullscreenExitedEventHandler -= value;
+ if (fullscreenExitedEventHandler == null)
+ {
+ IntPtr ip = IntPtr.Zero;
+ Interop.WebView.RegisterFullscreenExitedCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Event for the TextFound signal which can be used to subscribe or unsubscribe the event handler.<br />
+ /// This signal is emitted when text is found.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<WebViewTextFoundEventArgs> TextFound
+ {
+ add
+ {
+ if (textFoundEventHandler == null)
+ {
+ textFoundCallback = OnTextFound;
+ IntPtr ip = Marshal.GetFunctionPointerForDelegate(textFoundCallback);
+ Interop.WebView.RegisterTextFoundCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ textFoundEventHandler += value;
+ }
+ remove
+ {
+ textFoundEventHandler -= value;
+ if (textFoundEventHandler == null)
+ {
+ IntPtr ip = IntPtr.Zero;
+ Interop.WebView.RegisterTextFoundCallback(SwigCPtr, new HandleRef(this, ip));
+ }
+ }
+ }
+
+ /// <summary>
/// Options for searching texts.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
}
/// <summary>
+ /// Exit fullscreen.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ExitFullscreen()
+ {
+ Interop.WebView.ExitFullscreen(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
/// Scales the current page, centered at the given point.
/// </summary>
/// <param name="scaleFactor">The new factor to be scaled</param>
navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
}
+ private void OnNewWindowPolicyDecided(IntPtr maker)
+ {
+ newWindowPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true)));
+ }
+
private void OnNewWindowCreated(out IntPtr viewHandle)
{
WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs());
hitTestFinishedCallback?.Invoke(new WebHitTestResult(test, true));
#pragma warning restore CA2000 // Dispose objects before losing scope
}
+
+ private void OnFullscreenEntered()
+ {
+ fullscreenEnteredEventHandler?.Invoke(this, new EventArgs());
+ }
+
+ private void OnFullscreenExited()
+ {
+ fullscreenExitedEventHandler?.Invoke(this, new EventArgs());
+ }
+
+ private void OnTextFound(uint count)
+ {
+ textFoundEventHandler?.Invoke(this, new WebViewTextFoundEventArgs(count));
+ }
}
}