engine
 
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | Protected 成员函数 | 所有成员列表
IWebBrowserWindow类 参考abstract

Interface for dealing with a Web Browser window 更多...

#include <IWebBrowserWindow.h>

Public 类型

typedef TMap< FString, FString > FRequestHeaders
 A delegate that is invoked before the browser loads a resource. 更多...
 

Public 成员函数

virtual void BindUObject (const FString &Name, UObject *Object, bool bIsPermanent=true)=0
 Expose a UObject instance to the browser runtime. 更多...
 
virtual bool CanGoBack () const =0
 Returns true if the browser can navigate backwards.
 
virtual bool CanGoForward () const =0
 Returns true if the browser can navigate forwards.
 
virtual void CloseBrowser (bool bForce)=0
 Close this window so that it can no longer be used. 更多...
 
 DECLARE_DELEGATE_FourParams (FOnResourceLoadCompleteDelegate, FString, FString, FString, int64)
 A delegate that is invoked on completion of browser resource loads. 更多...
 
 DECLARE_DELEGATE_RetVal (bool, FOnCheckVisibility)
 A delegate that is invoked to check the visibility of the native browser
 
 DECLARE_DELEGATE_RetVal (bool, FOnSuppressContextMenu)
 Should return true if this dialog wants to suppress the context menu
 
 DECLARE_DELEGATE_RetVal_OneParam (bool, FOnCloseWindow, const TWeakPtr< IWebBrowserWindow > &) virtual FOnCloseWindow &OnCloseWindow()=0
 A delegate that is invoked when closing created popup windows.
 
 DECLARE_DELEGATE_RetVal_OneParam (bool, FOnDragWindow, const FPointerEvent &) virtual FOnDragWindow &OnDragWindow()=0
 A delegate that is invoked when drag is detected in an area specified as a drag region on the web page.
 
 DECLARE_DELEGATE_RetVal_OneParam (bool, FOnUnhandledKeyChar, const FCharacterEvent &)
 A delegate that is invoked for each key char event not handled by the browser, return true if event is handled to prevent it from bubbling up.
 
 DECLARE_DELEGATE_RetVal_OneParam (bool, FOnUnhandledKeyDown, const FKeyEvent &)
 A delegate that is invoked for each key down event not handled by the browser, return true if event is handled to prevent it from bubbling up.
 
 DECLARE_DELEGATE_RetVal_OneParam (bool, FOnUnhandledKeyUp, const FKeyEvent &)
 A delegate that is invoked for each up down event not handled by the browser, return true if event is handled to prevent it from bubbling up.
 
 DECLARE_DELEGATE_RetVal_OneParam (EWebBrowserDialogEventResponse, FOnShowDialog, const TWeakPtr< IWebBrowserDialog > &) virtual FOnShowDialog &OnShowDialog()=0
 A delegate that is invoked when the browser needs to show a dialog.
 
 DECLARE_DELEGATE_RetVal_ThreeParams (bool, FOnLoadUrl, const FString &, const FString &, FString &) virtual FOnLoadUrl &OnLoadUrl()=0
 A delegate that is invoked to allow user code to override the contents of a Url.
 
 DECLARE_DELEGATE_RetVal_TwoParams (bool, FOnBeforeBrowse, const FString &, const FWebNavigationRequest &) virtual FOnBeforeBrowse &OnBeforeBrowse()=0
 A delegate that is invoked prior to browser navigation.
 
 DECLARE_DELEGATE_RetVal_TwoParams (bool, FOnBeforePopupDelegate, FString, FString)
 A delegate that is invoked when a popup window is attempting to open.
 
 DECLARE_DELEGATE_RetVal_TwoParams (bool, FOnCreateWindow, const TWeakPtr< IWebBrowserWindow > &, const TWeakPtr< IWebBrowserPopupFeatures > &) virtual FOnCreateWindow &OnCreateWindow()=0
 A delegate that is invoked when an existing browser requests creation of a new browser window.
 
 DECLARE_DELEGATE_ThreeParams (FOnConsoleMessageDelegate, const FString &, const FString &, int)
 A delegate that is invoked for each console message
 
 DECLARE_EVENT_OneParam (IWebBrowserWindow, FOnDocumentStateChanged, EWebBrowserDocumentState)
 A delegate that is invoked when the loading state of a document changed.
 
 DECLARE_EVENT_OneParam (IWebBrowserWindow, FOnShowPopup, const FIntRect &) virtual FOnShowPopup &OnShowPopup()=0
 A delegate that is invoked when the browser needs to show a popup menu.
 
 DECLARE_EVENT_OneParam (IWebBrowserWindow, FOnTitleChanged, FString)
 A delegate to allow callbacks when a browser title changes.
 
 DECLARE_EVENT_OneParam (IWebBrowserWindow, FOnToolTip, FString)
 A delegate to allow callbacks when a frame url changes.
 
 DECLARE_EVENT_OneParam (IWebBrowserWindow, FOnUrlChanged, FString)
 A delegate to allow callbacks when a frame url changes.
 
virtual void ExecuteJavascript (const FString &Script)=0
 Execute Javascript on the page.
 
virtual EWebBrowserDocumentState GetDocumentLoadingState () const =0
 Gets the loading state of the current document.
 
virtual int GetLoadError ()=0
 Get current load error. 更多...
 
virtual TSharedPtr< class SWindow > GetParentWindow () const =0
 Get parent SWindow for this window
 
virtual void GetSource (TFunction< void(const FString &)> Callback) const =0
 Gets the source of the main frame as raw HTML. 更多...
 
virtual bool GetSupportsMouseWheel () const =0
 Returns whether mouse wheel events should be handled by the window
 
virtual FSlateShaderResource * GetTexture (bool bIsPopup=false)=0
 Gets interface to the texture representation of the browser 更多...
 
virtual FString GetTitle () const =0
 Gets the current title of the Browser page
 
virtual FString GetUrl () const =0
 Gets the currently loaded URL. 更多...
 
virtual FIntPoint GetViewportSize () const =0
 Gets the current size of the web browser viewport if available, FIntPoint::NoneValue otherwise 更多...
 
virtual void GoBack ()=0
 Navigate backwards.
 
virtual void GoForward ()=0
 Navigate forwards.
 
virtual bool IsClosing () const =0
 Checks whether the web browser is currently being shut down
 
virtual bool IsInitialized () const =0
 Checks whether the web browser has finished loaded the initial page.
 
virtual bool IsLoading () const =0
 Returns true if the browser is currently loading.
 
virtual bool IsValid () const =0
 Checks whether the web browser is valid and ready for use
 
virtual void LoadString (FString Contents, FString DummyURL)=0
 Load a string as data to create a web page 更多...
 
virtual void LoadURL (FString NewURL)=0
 Load the specified URL 更多...
 
virtual void OnCaptureLost ()=0
 Called when Capture lost
 
virtual FCursorReply OnCursorQuery (const FGeometry &MyGeometry, const FPointerEvent &CursorEvent)=0
 The system asks each widget under the mouse to provide a cursor. 更多...
 
virtual FOnDismissAllDialogs & OnDismissAllDialogs ()=0
 A delegate that is invoked when the browser needs to dismiss and reset all dialogs.
 
virtual FOnDismissPopup & OnDismissPopup ()=0
 A delegate that is invoked when the browser no longer wants to show the popup menu.
 
virtual void OnFocus (bool SetFocus, bool bIsPopup)=0
 Called when browser receives/loses focus 更多...
 
virtual bool OnKeyChar (const FCharacterEvent &InCharacterEvent)=0
 Notify the browser of a character event 更多...
 
virtual bool OnKeyDown (const FKeyEvent &InKeyEvent)=0
 Notify the browser that a key has been pressed 更多...
 
virtual bool OnKeyUp (const FKeyEvent &InKeyEvent)=0
 Notify the browser that a key has been released 更多...
 
virtual FReply OnMouseButtonDoubleClick (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent, bool bIsPopup)=0
 Notify the browser of a double click event 更多...
 
virtual FReply OnMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent, bool bIsPopup)=0
 Notify the browser that a mouse button was pressed within it 更多...
 
virtual FReply OnMouseButtonUp (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent, bool bIsPopup)=0
 Notify the browser that a mouse button was released within it 更多...
 
virtual void OnMouseLeave (const FPointerEvent &MouseEvent)=0
 Notify the browser that a mouse has left the window 更多...
 
virtual FReply OnMouseMove (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent, bool bIsPopup)=0
 Notify the browser that a mouse moved within it 更多...
 
virtual FReply OnMouseWheel (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent, bool bIsPopup)=0
 Called when the mouse wheel is spun 更多...
 
virtual FOnNeedsRedraw & OnNeedsRedraw ()=0
 A delegate that is invoked when the off-screen window has been repainted and requires an update.
 
virtual void Reload ()=0
 Reload the current page.
 
virtual void SetIsDisabled (bool bValue)=0
 Disable or enable web view. 更多...
 
virtual void SetParentWindow (TSharedPtr< class SWindow > Window)=0
 Set parent SWindow for this window
 
virtual void SetSupportsMouseWheel (bool bValue)=0
 Sets whether mouse wheel events should be handled by the window
 
virtual void SetViewportSize (FIntPoint WindowSize, FIntPoint WindowPos=FIntPoint::NoneValue)=0
 Set the desired size of the web browser viewport 更多...
 
virtual void StopLoad ()=0
 Stop loading the page.
 
virtual void UnbindUObject (const FString &Name, UObject *Object, bool bIsPermanent=true)=0
 Remove an existing script binding registered by BindUObject. 更多...
 

Protected 成员函数

virtual ~IWebBrowserWindow ()
 Virtual Destructor.
 

详细描述

Interface for dealing with a Web Browser window

成员类型定义说明

◆ FRequestHeaders

A delegate that is invoked before the browser loads a resource.

Its primary purpose is to inject headers into the request.

成员函数说明

◆ BindUObject()

virtual void IWebBrowserWindow::BindUObject ( const FString &  Name,
UObject *  Object,
bool  bIsPermanent = true 
)
pure virtual

Expose a UObject instance to the browser runtime.

Properties and Functions will be accessible from JavaScript side. As all communication with the rendering procesis asynchronous, return values (both for properties and function results) are wrapped into JS Future objects.

参数
NameThe name of the object. The object will show up as window.ue4.{Name} on the javascript side. If there is an existing object of the same name, this object will replace it. If bIsPermanent is false and there is an existing permanent binding, the permanent binding will be restored when the temporary one is removed.
ObjectThe object instance.
bIsPermanentIf true, the object will be visible to all pages loaded through this browser widget, otherwise, it will be deleted when navigating away from the current page. Non-permanent bindings should be registered from inside an OnLoadStarted event handler in order to be available before JS code starts loading.

◆ CloseBrowser()

virtual void IWebBrowserWindow::CloseBrowser ( bool  bForce)
pure virtual

Close this window so that it can no longer be used.

参数
bForceDesignates whether the web browser close should be forced.

◆ DECLARE_DELEGATE_FourParams()

IWebBrowserWindow::DECLARE_DELEGATE_FourParams ( FOnResourceLoadCompleteDelegate  ,
FString  ,
FString  ,
FString  ,
int64   
)

A delegate that is invoked on completion of browser resource loads.

Its primary purpose is to allow response to failures.

◆ GetLoadError()

virtual int IWebBrowserWindow::GetLoadError ( )
pure virtual

Get current load error.

返回
an error code if the last page load resulted in an error, otherwise 0.

◆ GetSource()

virtual void IWebBrowserWindow::GetSource ( TFunction< void(const FString &)>  Callback) const
pure virtual

Gets the source of the main frame as raw HTML.

This method has to be called asynchronously by passing a callback function, which will be called at a later point when the result is ready.

参数
CallbackA callable that takes a single string reference for handling the result.

◆ GetTexture()

virtual FSlateShaderResource * IWebBrowserWindow::GetTexture ( bool  bIsPopup = false)
pure virtual

Gets interface to the texture representation of the browser

参数
bISpopupWhether to return the popup menu texture instead of the main browser window.
返回
A slate shader resource that can be rendered

◆ GetUrl()

virtual FString IWebBrowserWindow::GetUrl ( ) const
pure virtual

Gets the currently loaded URL.

返回
The URL, or empty string if no document is loaded.

◆ GetViewportSize()

virtual FIntPoint IWebBrowserWindow::GetViewportSize ( ) const
pure virtual

Gets the current size of the web browser viewport if available, FIntPoint::NoneValue otherwise

参数
WindowSizeDesired viewport size

◆ LoadString()

virtual void IWebBrowserWindow::LoadString ( FString  Contents,
FString  DummyURL 
)
pure virtual

Load a string as data to create a web page

参数
ContentsString to load
DummyURLDummy URL for the page

◆ LoadURL()

virtual void IWebBrowserWindow::LoadURL ( FString  NewURL)
pure virtual

Load the specified URL

参数
NewURLNew URL to load

◆ OnCursorQuery()

virtual FCursorReply IWebBrowserWindow::OnCursorQuery ( const FGeometry &  MyGeometry,
const FPointerEvent &  CursorEvent 
)
pure virtual

The system asks each widget under the mouse to provide a cursor.

This event is bubbled.

返回
FCursorReply::Unhandled() if the event is not handled; return FCursorReply::Cursor() otherwise.

◆ OnFocus()

virtual void IWebBrowserWindow::OnFocus ( bool  SetFocus,
bool  bIsPopup 
)
pure virtual

Called when browser receives/loses focus

参数
SetFocusWhether the window gained or lost focus.
bIsPopupTrue if the coordinates are relative to a popup menu window, otherwise false.

◆ OnKeyChar()

virtual bool IWebBrowserWindow::OnKeyChar ( const FCharacterEvent &  InCharacterEvent)
pure virtual

Notify the browser of a character event

参数
InCharacterEventCharacter event

◆ OnKeyDown()

virtual bool IWebBrowserWindow::OnKeyDown ( const FKeyEvent &  InKeyEvent)
pure virtual

Notify the browser that a key has been pressed

参数
InKeyEventKey event

◆ OnKeyUp()

virtual bool IWebBrowserWindow::OnKeyUp ( const FKeyEvent &  InKeyEvent)
pure virtual

Notify the browser that a key has been released

参数
InKeyEventKey event

◆ OnMouseButtonDoubleClick()

virtual FReply IWebBrowserWindow::OnMouseButtonDoubleClick ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent,
bool  bIsPopup 
)
pure virtual

Notify the browser of a double click event

参数
MyGeometryThe Geometry of the browser
MouseEventInformation about the input event
bIsPopupTrue if the coordinates are relative to a popup menu window, otherwise false.
返回
FReply::Handled() if the mouse event was handled, FReply::Unhandled() oterwise

◆ OnMouseButtonDown()

virtual FReply IWebBrowserWindow::OnMouseButtonDown ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent,
bool  bIsPopup 
)
pure virtual

Notify the browser that a mouse button was pressed within it

参数
MyGeometryThe Geometry of the browser
MouseEventInformation about the input event
bIsPopupTrue if the coordinates are relative to a popup menu window, otherwise false.
返回
FReply::Handled() if the mouse event was handled, FReply::Unhandled() oterwise

◆ OnMouseButtonUp()

virtual FReply IWebBrowserWindow::OnMouseButtonUp ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent,
bool  bIsPopup 
)
pure virtual

Notify the browser that a mouse button was released within it

参数
MyGeometryThe Geometry of the browser
MouseEventInformation about the input event
bIsPopupTrue if the coordinates are relative to a popup menu window, otherwise false.
返回
FReply::Handled() if the mouse event was handled, FReply::Unhandled() oterwise

◆ OnMouseLeave()

virtual void IWebBrowserWindow::OnMouseLeave ( const FPointerEvent &  MouseEvent)
pure virtual

Notify the browser that a mouse has left the window

参数
MouseEventInformation about the input event

◆ OnMouseMove()

virtual FReply IWebBrowserWindow::OnMouseMove ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent,
bool  bIsPopup 
)
pure virtual

Notify the browser that a mouse moved within it

参数
MyGeometryThe Geometry of the browser
MouseEventInformation about the input event
bIsPopupTrue if the coordinates are relative to a popup menu window, otherwise false.
返回
FReply::Handled() if the mouse event was handled, FReply::Unhandled() oterwise

◆ OnMouseWheel()

virtual FReply IWebBrowserWindow::OnMouseWheel ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent,
bool  bIsPopup 
)
pure virtual

Called when the mouse wheel is spun

参数
MyGeometryThe Geometry of the browser
MouseEventInformation about the input event
bIsPopupTrue if the coordinates are relative to a popup menu window, otherwise false.
返回
FReply::Handled() if the mouse event was handled, FReply::Unhandled() oterwise

◆ SetIsDisabled()

virtual void IWebBrowserWindow::SetIsDisabled ( bool  bValue)
pure virtual

Disable or enable web view.

参数
bValueSetting this to true will prevent any updates from the background web browser.

◆ SetViewportSize()

virtual void IWebBrowserWindow::SetViewportSize ( FIntPoint  WindowSize,
FIntPoint  WindowPos = FIntPoint::NoneValue 
)
pure virtual

Set the desired size of the web browser viewport

参数
WindowSizeDesired viewport size

◆ UnbindUObject()

virtual void IWebBrowserWindow::UnbindUObject ( const FString &  Name,
UObject *  Object,
bool  bIsPermanent = true 
)
pure virtual

Remove an existing script binding registered by BindUObject.

参数
NameThe name of the object to remove.
ObjectThe object will only be removed if it is the same object as the one passed in.
bIsPermanentMust match the bIsPermanent argument passed to BindUObject.

该类的文档由以下文件生成: