UCefView
Loading...
Searching...
No Matches
SCefView

A Slate widget that embeds a Chromium Embedded Framework (CEF) browser. More...

#include <SCefView.h>

Classes

struct  FArguments
 Represents the construction arguments of SCefView. More...
 

Public Types

using FOnLoadStateChangedEvent = (*)( const int64& InBrowserId , bool bInIsLoading , bool bInCanGoBack , bool bInCanGoForward )
 The callback type of loading state changed.
 
using FOnLoadStartEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InTransitionType )
 The callback type of loading starts.
 
using FOnLoadEndEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InHttpStatusCode )
 The callback type of loading ends.
 
using FOnLoadErrorEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InErrorCode , const FString& InErrorMsg , const FString& InOutFailedUrl , bool& InOutHandled )
 The callback type of loading failed due to error.
 
using FOnDraggableRegionChangedEvent = void(*)( const FVector4& InDraggableRegion , const FVector4& InNonDraggableRegion )
 The callback type of draggable region changed.
 
using FOnAddressChangedEvent = void(*)( const FCefFrameId& InFrameId , const FString& InUrl )
 The callback type of the address changed.
 
using FOnTitleChangedEvent = void(*)( const FString& InTitle )
 The callback type of title changed.
 
using FOnFaviconUrlChangedEvent = void(*)( const TArray<FString>& InUrls )
 The callback type of favicon URL changed.
 
using FOnFullscreenModeChangedEvent = void(*)( bool bInIsFullscreen )
 The callback type of fullscreen mode changed.
 
using FOnStatusMessageEvent = void(*)( const FString& InMessage )
 The callback type of status message changed.
 
using FOnConsoleMessageEvent = void(*)( const FString& InMessage , int32 InLevel )
 The callback type of console message from the web content.
 
using FOnLoadingProgressChangedEvent = void(*)( double InProgress )
 The callback type of loading progress changed.
 
using FOnUrlRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InQuery )
 The callback type of built-in scheme URL access.
 
using FOnQueryRequestEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const int64& InQueryId , const FString& InRequest )
 The callback type of new UCefQuery request.
 
using FOnInvokeMethodEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InMethod , const TArray<TSharedPtr<FJsonValue>>& InArguments )
 The callback type of invoking method request from web content (JavaScript).
 
using FOnReportJavascriptResultEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InContext , const TSharedPtr<FJsonValue>& InResult )
 The callback type of the result of the JavaScript executed with executeJavascriptWithResult returned.
 
using FOnNativeBrowserCreatedEvent = void(*)()
 The callback type of the native browser window created event. This callback does not work for OSR mode.
 

Public Member Functions

 SCefView ()
 Default constructor for SCefView.
 
 ~SCefView ()
 Destructor for SCefView.
 
void Construct (const FArguments &InArgs)
 Constructs the widget with the specified arguments.
 
void SetUrl (const FString &InUrl)
 Sets the URL to be loaded in the browser.
 
FString GetUrl () const
 Gets the current URL loaded in the browser.
 
void SetFrameRate (int32 InFrameRate)
 Sets the frame rate for browser rendering.
 
int32 GetFrameRate () const
 Gets the current frame rate for browser rendering.
 
void SetEnableContextMenu (bool bInEnableContextMenu)
 Enables or disables the context menu in the browser.
 
bool IsContextMenuEnabled () const
 Checks if the context menu is enabled.
 
void SetAcceptDrops (bool bInAcceptDrops)
 Enables or disables accepting drag-and-drop operations.
 
bool IsAcceptDrops () const
 Checks if drag-and-drop is accepted.
 
void SetAllowDrag (bool bInAllowDrag)
 Enables or disables allowing drag operations.
 
bool IsAllowDrag () const
 Checks if drag operations are allowed.
 
void AddLocalFolderResource (const FString &InFolderPath, const FString &InTargetUrl, int32 InPriority=0)
 Adds a local folder as a web resource mapping.
 
void AddArchiveFileResource (const FString &InArchivePath, const FString &InTargetUrl, const FString &InPassword="", int32 InPriority=0)
 Adds an archive file (.zip) as a web resource mapping.
 
int64 GetBrowserId () const
 Gets the unique browser ID.
 
void NavigateToUrl (const FString &InTargetUrl)
 Navigates the browser to the specified URL.
 
bool BrowserCanGoBack ()
 Checks if the browser can navigate back in its history.
 
bool BrowserCanGoForward ()
 Checks if the browser can navigate forward in its history.
 
void BrowserGoBack ()
 Navigates the browser back in its history.
 
void BrowserGoForward ()
 Navigates the browser forward in its history.
 
bool IsBrowserLoading ()
 Checks if the browser is currently loading a page.
 
void BrowserReload ()
 Reloads the current page in the browser.
 
void BrowserStopLoad ()
 Stops the current page load in the browser.
 
bool TriggerEventForFrame (const FString &InName, const TArray< TSharedPtr< FJsonValue > > &InArgs, const FCefFrameId &InFrameId)
 Triggers a custom event for a specific frame in the browser.
 
bool TriggerEventForMainFrame (const FString &InName, const TArray< TSharedPtr< FJsonValue > > &InArgs)
 Triggers a custom event for the main frame in the browser.
 
bool BroadcastEvent (const FString &InName, const TArray< TSharedPtr< FJsonValue > > &InArgs)
 Broadcasts a custom event to all frames in the browser.
 
bool ResponseUCefQuery (const int64 InQueryId, const bool bInIsSuccess, const FString &InResponse, const int32 InError)
 Responds to a UCefQuery request from the browser.
 
bool ExecuteJavascript (const FCefFrameId &InFrameId, const FString &InJavascriptCode, const FString &InTargetUrl)
 Executes JavaScript code in a specific frame.
 
bool ExecuteJavascriptWithResult (const FCefFrameId &InFrameId, const FString &InJavascriptCode, const FString &InTargetUrl, const FString &InExecuteContext)
 Executes JavaScript code in a specific frame and returns the result.
 
bool SetPreference (const FString &InPreferenceName, const FString &InPreferenceValue, FString &OutError)
 Sets a browser preference.
 
void SetDisablePopupContextMenu (bool bInIsDisable)
 Sets whether to disable the context menu for pop-up browsers.
 
bool IsPopupContextMenuDisabled ()
 Checks if the context menu is disabled for pop-up browsers.
 
bool HasDevTools ()
 Checks if the browser's developer tools are open.
 
void ShowDevTools ()
 Opens the browser's developer tools dialog.
 
void CloseDevTools ()
 Closes the browser's developer tools dialog.
 

Static Public Attributes

static const FCefFrameId MainFrameID
 The main frame identity.
 
static const FCefFrameId AllFrameID
 The identifier for all frames.
 

Protected Member Functions

void CreateNativeBrowser (const FSlateCefViewSettings &InCefViewSettings)
 Creates the native CEF browser instance with the specified settings.
 
void DestroyNativeBrowser ()
 Destroys the native CEF browser instance.
 
void OnNewBrowser (const FCefFrameId &InSourceFrameId, const FString &InTargetUrl, const FString &InFrameName, ECefWindowOpenDisposition InTargetDisposition, FIntRect &InDesiredRect)
 Called when a new browser is created (e.g., via window.open).
 
bool OnNewPopup (const FCefFrameId &InSourceFrameId, const FString &InTargetUrl, FString &InFrameName, ECefWindowOpenDisposition InTargetDisposition, FIntRect &InDesiredRect, FSlateCefViewSettings &InBrowserSettings, bool &bInDisableJavascriptAccess)
 Called before a pop-up browser is created (only for browser created by JavaScript).
 
bool OnRequestCloseFromWeb ()
 Called when a close request is received from the web content.
 
void SetVisibility (TAttribute< EVisibility > InVisibility) override
 Sets the visibility.
 
void Tick (const FGeometry &InAllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
 Tick function.
 
FChildren * GetChildren () override
 GetChildren function.
 
void OnArrangeChildren (const FGeometry &InAllottedGeometry, FArrangedChildren &InArrangedChildren) const override
 OnArrangeChildren function.
 
FVector2D ComputeDesiredSize (float InLayoutScaleMultiplier) const override
 ComputeDesiredSize function.
 
int32 OnPaint (const FPaintArgs &InArgs, const FGeometry &InAllottedGeometry, const FSlateRect &InMyCullingRect, FSlateWindowElementList &InOutDrawElements, int32 InLayerId, const FWidgetStyle &InWidgetStyle, bool bInParentEnabled) const override
 OnPaint function.
 
TOptional< TSharedRef< SWidget > > OnMapCursor (const FCursorReply &InCursorReply) const
 OnMapCursor function.
 
bool SupportsKeyboardFocus () const override
 SupportsKeyboardFocus function.
 
FReply OnFocusReceived (const FGeometry &InGeometry, const FFocusEvent &InFocusEvent) override
 OnFocusReceived function.
 
void OnFocusLost (const FFocusEvent &InFocusEvent) override
 OnFocusLost function.
 
FNavigationReply OnNavigation (const FGeometry &InGeometry, const FNavigationEvent &InNavigationEvent) override
 OnNavigation function.
 
void OnMouseEnter (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnMouseEnter function.
 
void OnMouseLeave (const FPointerEvent &InMouseEvent) override
 OnMouseLeave function.
 
FReply OnMouseMove (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnMouseMove function.
 
FReply OnPreviewMouseButtonDown (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnPreviewMouseButtonDown function.
 
FReply OnMouseButtonDown (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnMouseButtonDown function.
 
FReply OnMouseButtonUp (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnMouseButtonUp function.
 
FReply OnMouseButtonDoubleClick (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnMouseButtonDoubleClick function.
 
FReply OnMouseWheel (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 OnMouseWheel function.
 
FReply OnPreviewKeyDown (const FGeometry &InGeometry, const FKeyEvent &InKeyEvent) override
 OnPreviewKeyDown function.
 
FReply OnKeyDown (const FGeometry &InGeometry, const FKeyEvent &InKeyEvent) override
 OnKeyDown function.
 
FReply OnKeyChar (const FGeometry &InGeometry, const FCharacterEvent &InCharacterEvent) override
 OnKeyChar function.
 
FReply OnKeyUp (const FGeometry &InGeometry, const FKeyEvent &InKeyEvent) override
 OnKeyUp function.
 
void OnDragEnter (const FGeometry &InGeometry, const FDragDropEvent &InDragDropEvent) override
 
FReply OnDragOver (const FGeometry &InGeometry, const FDragDropEvent &InDragDropEvent) override
 
FReply OnDrop (const FGeometry &InGeometry, const FDragDropEvent &InDragDropEvent) override
 
void OnDragLeave (const FDragDropEvent &DragDropEvent) override
 
FReply OnDragDetected (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 

Protected Attributes

FOnLoadStateChangedEvent OnLoadStateChanged
 On load state changed event.
 
FOnLoadStartEvent OnLoadStart
 On load start event.
 
FOnLoadEndEvent OnLoadEnd
 On load end event.
 
FOnLoadErrorEvent OnLoadError
 On load error event.
 
FOnDraggableRegionChangedEvent OnDraggableRegionChanged
 On draggable region changed event.
 
FOnAddressChangedEvent OnAddressChanged
 On address changed event.
 
FOnTitleChangedEvent OnTitleChanged
 On title changed event.
 
FOnFaviconUrlChangedEvent OnFaviconUrlChanged
 On favicon URL changed event.
 
FOnFullscreenModeChangedEvent OnFullscreenModeChanged
 On fullscreen mode changed event.
 
FOnStatusMessageEvent OnStatusMessage
 On status message event.
 
FOnConsoleMessageEvent OnConsoleMessage
 On console message event.
 
FOnLoadingProgressChangedEvent OnLoadingProgressChanged
 On loading progress changed event.
 
FOnUrlRequestEvent OnUrlRequest
 On URL request event.
 
FOnQueryRequestEvent OnQueryRequest
 On query request event.
 
FOnInvokeMethodEvent OnInvokeMethod
 On invoke method event.
 
FOnReportJavascriptResultEvent OnReportJavascriptResult
 On report JavaScript result event.
 
FOnNativeBrowserCreatedEvent OnNativeBrowserCreated
 On native browser created event.
 

Detailed Description

A Slate widget that embeds a Chromium Embedded Framework (CEF) browser.

This widget provides methods to control browser navigation, execute JavaScript, handle browser events, and manage resource mappings for local and archive files. It exposes a variety of delegates for browser state changes, navigation, and communication between the browser and the host application.

Member Typedef Documentation

◆ FOnAddressChangedEvent

using SCefView::FOnAddressChangedEvent = void(*)( const FCefFrameId& InFrameId , const FString& InUrl )

The callback type of the address changed.

Parameters
InFrameIdThe frame ID.
InUrlThe address.

◆ FOnConsoleMessageEvent

using SCefView::FOnConsoleMessageEvent = void(*)( const FString& InMessage , int32 InLevel )

The callback type of console message from the web content.

Parameters
InMessageThe message.
InLevelThe level.

◆ FOnDraggableRegionChangedEvent

using SCefView::FOnDraggableRegionChangedEvent = void(*)( const FVector4& InDraggableRegion , const FVector4& InNonDraggableRegion )

The callback type of draggable region changed.

Parameters
InDraggableRegionThe new draggable region.
InNonDraggableRegionThe new non-draggable region.

◆ FOnFaviconUrlChangedEvent

using SCefView::FOnFaviconUrlChangedEvent = void(*)( const TArray<FString>& InUrls )

The callback type of favicon URL changed.

Parameters
InUrlsThe URLs.

◆ FOnFullscreenModeChangedEvent

using SCefView::FOnFullscreenModeChangedEvent = void(*)( bool bInIsFullscreen )

The callback type of fullscreen mode changed.

Parameters
bInIsFullscreenThe current fullscreen mode.

◆ FOnInvokeMethodEvent

using SCefView::FOnInvokeMethodEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InMethod , const TArray<TSharedPtr<FJsonValue>>& InArguments )

The callback type of invoking method request from web content (JavaScript).

Parameters
InBrowserIdThe browser ID.
InFrameIdThe frame ID.
InMethodThe method name.
InArgumentsThe arguments list.

◆ FOnLoadEndEvent

using SCefView::FOnLoadEndEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InHttpStatusCode )

The callback type of loading ends.

Parameters
InBrowserIdIndicates the browser ID.
InFrameIdIndicates the frame ID.
bInIsMainFrameIndicates whether this is the main frame.
InHttpStatusCodeThe HTTP status code.

◆ FOnLoadErrorEvent

using SCefView::FOnLoadErrorEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InErrorCode , const FString& InErrorMsg , const FString& InOutFailedUrl , bool& InOutHandled )

The callback type of loading failed due to error.

Parameters
InBrowserIdIndicates the browser ID.
InFrameIdIndicates the frame ID.
bInIsMainFrameIndicates whether this is the main frame.
InErrorCodeThe error code.
InErrorMsgThe error message.
InFailedUrlThe URL that caused the failure.
InOutHandledWhether this error was handled or not.

◆ FOnLoadingProgressChangedEvent

using SCefView::FOnLoadingProgressChangedEvent = void(*)( double InProgress )

The callback type of loading progress changed.

Parameters
InProgressCurrent progress.

◆ FOnLoadStartEvent

using SCefView::FOnLoadStartEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InTransitionType )

The callback type of loading starts.

Parameters
InBrowserIdIndicates the browser ID.
InFrameIdIndicates the frame ID.
bInIsMainFrameIndicates whether this is the main frame.
InTransitionTypeTransition type.

◆ FOnLoadStateChangedEvent

using SCefView::FOnLoadStateChangedEvent = (*)( const int64& InBrowserId , bool bInIsLoading , bool bInCanGoBack , bool bInCanGoForward )

The callback type of loading state changed.

Parameters
InBrowserIdIndicates the browser ID.
bInIsLoadingIndicates the browser is loading.
bInCanGoBackIndicates the browser can go back.
bInCanGoForwardIndicates the browser can go forward.

◆ FOnNativeBrowserCreatedEvent

The callback type of the native browser window created event. This callback does not work for OSR mode.

◆ FOnQueryRequestEvent

using SCefView::FOnQueryRequestEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const int64& InQueryId , const FString& InRequest )

The callback type of new UCefQuery request.

Parameters
InBrowserIdThe browser ID.
InFrameIdThe frame ID.
InQueryIdThe query ID.
InRequestThe query request.

◆ FOnReportJavascriptResultEvent

using SCefView::FOnReportJavascriptResultEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InContext , const TSharedPtr<FJsonValue>& InResult )

The callback type of the result of the JavaScript executed with executeJavascriptWithResult returned.

Parameters
InBrowserIdThe browser ID.
InFrameIdThe frame ID.
InContextThe context.
InResultThe result.

◆ FOnStatusMessageEvent

using SCefView::FOnStatusMessageEvent = void(*)( const FString& InMessage )

The callback type of status message changed.

Parameters
InMessageThe status message.

◆ FOnTitleChangedEvent

using SCefView::FOnTitleChangedEvent = void(*)( const FString& InTitle )

The callback type of title changed.

Parameters
InTitleThe title.

◆ FOnUrlRequestEvent

using SCefView::FOnUrlRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InQuery )

The callback type of built-in scheme URL access.

Parameters
InBrowserIdThe browser ID.
InFrameIdThe frame ID.
InQueryThe full URL.

Constructor & Destructor Documentation

◆ SCefView()

SCefView::SCefView ( )

Default constructor for SCefView.

◆ ~SCefView()

SCefView::~SCefView ( )

Destructor for SCefView.

Member Function Documentation

◆ AddArchiveFileResource()

void SCefView::AddArchiveFileResource ( const FString & InArchivePath,
const FString & InTargetUrl,
const FString & InPassword = "",
int32 InPriority = 0 )

Adds an archive file (.zip) as a web resource mapping.

Parameters
InArchivePathPath to the archive file.
InTargetUrlURL to map the archive to.
InPasswordPassword for the archive (default: empty).
InPriorityPriority of the mapping (default: 0).

◆ AddLocalFolderResource()

void SCefView::AddLocalFolderResource ( const FString & InFolderPath,
const FString & InTargetUrl,
int32 InPriority = 0 )

Adds a local folder as a web resource mapping.

Parameters
InFolderPathPath to the local folder.
InTargetUrlURL to map the folder to.
InPriorityPriority of the mapping (default: 0).

◆ BroadcastEvent()

bool SCefView::BroadcastEvent ( const FString & InName,
const TArray< TSharedPtr< FJsonValue > > & InArgs )

Broadcasts a custom event to all frames in the browser.

Parameters
InNameName of the event.
InArgsArguments to pass to the event.
Returns
True if the event was broadcast successfully, false otherwise.

◆ BrowserCanGoBack()

bool SCefView::BrowserCanGoBack ( )

Checks if the browser can navigate back in its history.

Returns
True if it can go back, false otherwise.

◆ BrowserCanGoForward()

bool SCefView::BrowserCanGoForward ( )

Checks if the browser can navigate forward in its history.

Returns
True if it can go forward, false otherwise.

◆ BrowserGoBack()

void SCefView::BrowserGoBack ( )

Navigates the browser back in its history.

◆ BrowserGoForward()

void SCefView::BrowserGoForward ( )

Navigates the browser forward in its history.

◆ BrowserReload()

void SCefView::BrowserReload ( )

Reloads the current page in the browser.

◆ BrowserStopLoad()

void SCefView::BrowserStopLoad ( )

Stops the current page load in the browser.

◆ CloseDevTools()

void SCefView::CloseDevTools ( )

Closes the browser's developer tools dialog.

◆ ComputeDesiredSize()

FVector2D SCefView::ComputeDesiredSize ( float InLayoutScaleMultiplier) const
overrideprotected

ComputeDesiredSize function.

Parameters
InLayoutScaleMultiplierThe layout scale multiplier.
Returns
The desired size.

◆ Construct()

void SCefView::Construct ( const FArguments & InArgs)

Constructs the widget with the specified arguments.

Parameters
InArgsThe construction arguments.

◆ CreateNativeBrowser()

void SCefView::CreateNativeBrowser ( const FSlateCefViewSettings & InCefViewSettings)
protected

Creates the native CEF browser instance with the specified settings.

Parameters
InCefViewSettingsThe CEF browser settings.

◆ DestroyNativeBrowser()

void SCefView::DestroyNativeBrowser ( )
protected

Destroys the native CEF browser instance.

◆ ExecuteJavascript()

bool SCefView::ExecuteJavascript ( const FCefFrameId & InFrameId,
const FString & InJavascriptCode,
const FString & InTargetUrl )

Executes JavaScript code in a specific frame.

Parameters
InFrameIdFrame ID to execute the code in.
InJavascriptCodeJavaScript code to execute.
InTargetUrlURL to associate with the code.
Returns
True if the code was executed successfully, false otherwise.

◆ ExecuteJavascriptWithResult()

bool SCefView::ExecuteJavascriptWithResult ( const FCefFrameId & InFrameId,
const FString & InJavascriptCode,
const FString & InTargetUrl,
const FString & InExecuteContext )

Executes JavaScript code in a specific frame and returns the result.

Parameters
InFrameIdFrame ID to execute the code in.
InJavascriptCodeJavaScript code to execute.
InTargetUrlURL to associate with the code.
InExecuteContextContext in which to execute the code.
Returns
True if the code was executed successfully, false otherwise.

◆ GetBrowserId()

int64 SCefView::GetBrowserId ( ) const

Gets the unique browser ID.

Returns
The browser ID.

◆ GetChildren()

FChildren * SCefView::GetChildren ( )
overrideprotected

GetChildren function.

Returns
The children.

◆ GetFrameRate()

int32 SCefView::GetFrameRate ( ) const

Gets the current frame rate for browser rendering.

Returns
The frame rate.

◆ GetUrl()

FString SCefView::GetUrl ( ) const

Gets the current URL loaded in the browser.

Returns
The current URL.

◆ HasDevTools()

bool SCefView::HasDevTools ( )

Checks if the browser's developer tools are open.

Returns
True if open, false otherwise.

◆ IsAcceptDrops()

bool SCefView::IsAcceptDrops ( ) const

Checks if drag-and-drop is accepted.

Returns
True if accepted, false otherwise.

◆ IsAllowDrag()

bool SCefView::IsAllowDrag ( ) const

Checks if drag operations are allowed.

Returns
True if allowed, false otherwise.

◆ IsBrowserLoading()

bool SCefView::IsBrowserLoading ( )

Checks if the browser is currently loading a page.

Returns
True if loading, false otherwise.

◆ IsContextMenuEnabled()

bool SCefView::IsContextMenuEnabled ( ) const

Checks if the context menu is enabled.

Returns
True if enabled, false otherwise.

◆ IsPopupContextMenuDisabled()

bool SCefView::IsPopupContextMenuDisabled ( )

Checks if the context menu is disabled for pop-up browsers.

Returns
True if disabled, false otherwise.

◆ NavigateToUrl()

void SCefView::NavigateToUrl ( const FString & InTargetUrl)

Navigates the browser to the specified URL.

Parameters
InTargetUrlThe URL to navigate to.

◆ OnArrangeChildren()

void SCefView::OnArrangeChildren ( const FGeometry & InAllottedGeometry,
FArrangedChildren & InArrangedChildren ) const
overrideprotected

OnArrangeChildren function.

Parameters
InAllottedGeometryThe allotted geometry.
InArrangedChildrenThe arranged children.

◆ OnDragDetected()

FReply SCefView::OnDragDetected ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

◆ OnDragEnter()

void SCefView::OnDragEnter ( const FGeometry & InGeometry,
const FDragDropEvent & InDragDropEvent )
overrideprotected

◆ OnDragLeave()

void SCefView::OnDragLeave ( const FDragDropEvent & DragDropEvent)
overrideprotected

◆ OnDragOver()

FReply SCefView::OnDragOver ( const FGeometry & InGeometry,
const FDragDropEvent & InDragDropEvent )
overrideprotected

◆ OnDrop()

FReply SCefView::OnDrop ( const FGeometry & InGeometry,
const FDragDropEvent & InDragDropEvent )
overrideprotected

◆ OnFocusLost()

void SCefView::OnFocusLost ( const FFocusEvent & InFocusEvent)
overrideprotected

OnFocusLost function.

Parameters
InFocusEventThe focus event.

◆ OnFocusReceived()

FReply SCefView::OnFocusReceived ( const FGeometry & InGeometry,
const FFocusEvent & InFocusEvent )
overrideprotected

OnFocusReceived function.

Parameters
InGeometryThe geometry.
InFocusEventThe focus event.
Returns
The reply.

◆ OnKeyChar()

FReply SCefView::OnKeyChar ( const FGeometry & InGeometry,
const FCharacterEvent & InCharacterEvent )
overrideprotected

OnKeyChar function.

Parameters
InGeometryThe geometry.
InCharacterEventThe character event.
Returns
The reply.

◆ OnKeyDown()

FReply SCefView::OnKeyDown ( const FGeometry & InGeometry,
const FKeyEvent & InKeyEvent )
overrideprotected

OnKeyDown function.

Parameters
InGeometryThe geometry.
InKeyEventThe key event.
Returns
The reply.

◆ OnKeyUp()

FReply SCefView::OnKeyUp ( const FGeometry & InGeometry,
const FKeyEvent & InKeyEvent )
overrideprotected

OnKeyUp function.

Parameters
InGeometryThe geometry.
InKeyEventThe key event.
Returns
The reply.

◆ OnMapCursor()

TOptional< TSharedRef< SWidget > > SCefView::OnMapCursor ( const FCursorReply & InCursorReply) const
protected

OnMapCursor function.

Parameters
InCursorReplyThe cursor reply.
Returns
The mapped cursor.

◆ OnMouseButtonDoubleClick()

FReply SCefView::OnMouseButtonDoubleClick ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnMouseButtonDoubleClick function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.
Returns
The reply.

◆ OnMouseButtonDown()

FReply SCefView::OnMouseButtonDown ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnMouseButtonDown function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.
Returns
The reply.

◆ OnMouseButtonUp()

FReply SCefView::OnMouseButtonUp ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnMouseButtonUp function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.
Returns
The reply.

◆ OnMouseEnter()

void SCefView::OnMouseEnter ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnMouseEnter function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.

◆ OnMouseLeave()

void SCefView::OnMouseLeave ( const FPointerEvent & InMouseEvent)
overrideprotected

OnMouseLeave function.

Parameters
InMouseEventThe mouse event.

◆ OnMouseMove()

FReply SCefView::OnMouseMove ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnMouseMove function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.
Returns
The reply.

◆ OnMouseWheel()

FReply SCefView::OnMouseWheel ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnMouseWheel function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.
Returns
The reply.

◆ OnNavigation()

FNavigationReply SCefView::OnNavigation ( const FGeometry & InGeometry,
const FNavigationEvent & InNavigationEvent )
overrideprotected

OnNavigation function.

Parameters
InGeometryThe geometry.
InNavigationEventThe navigation event.
Returns
The navigation reply.

◆ OnNewBrowser()

void SCefView::OnNewBrowser ( const FCefFrameId & InSourceFrameId,
const FString & InTargetUrl,
const FString & InFrameName,
ECefWindowOpenDisposition InTargetDisposition,
FIntRect & InDesiredRect )
protected

Called when a new browser is created (e.g., via window.open).

Parameters
InSourceFrameIdID of the source frame.
InTargetUrlURL of the new browser.
InFrameNameName of the new browser frame.
InTargetDispositionDisposition of the new browser window.
InDesiredRectDesired rectangle for the new browser window.

◆ OnNewPopup()

bool SCefView::OnNewPopup ( const FCefFrameId & InSourceFrameId,
const FString & InTargetUrl,
FString & InFrameName,
ECefWindowOpenDisposition InTargetDisposition,
FIntRect & InDesiredRect,
FSlateCefViewSettings & InBrowserSettings,
bool & bInDisableJavascriptAccess )
protected

Called before a pop-up browser is created (only for browser created by JavaScript).

Parameters
InSourceFrameIdSource frame ID.
InTargetUrlTarget URL.
InFrameNameTarget frame name.
InTargetDispositionTarget window open method.
InDesiredRectRectangle for the popup.
InBrowserSettingsSettings for the popup browser.
bInDisableJavascriptAccessWhether to disable JavaScript access.
Returns
True to cancel the popup, false to allow.

◆ OnPaint()

int32 SCefView::OnPaint ( const FPaintArgs & InArgs,
const FGeometry & InAllottedGeometry,
const FSlateRect & InMyCullingRect,
FSlateWindowElementList & InOutDrawElements,
int32 InLayerId,
const FWidgetStyle & InWidgetStyle,
bool bInParentEnabled ) const
overrideprotected

OnPaint function.

Parameters
InArgsThe paint arguments.
InAllottedGeometryThe allotted geometry.
InMyCullingRectThe my culling rectangle.
InOutDrawElementsThe out draw elements.
InLayerIdThe layer ID.
InWidgetStyleThe widget style.
bInParentEnabledWhether the parent is enabled.
Returns
The layer ID.

◆ OnPreviewKeyDown()

FReply SCefView::OnPreviewKeyDown ( const FGeometry & InGeometry,
const FKeyEvent & InKeyEvent )
overrideprotected

OnPreviewKeyDown function.

Parameters
InGeometryThe geometry.
InKeyEventThe key event.
Returns
The reply.

◆ OnPreviewMouseButtonDown()

FReply SCefView::OnPreviewMouseButtonDown ( const FGeometry & InGeometry,
const FPointerEvent & InMouseEvent )
overrideprotected

OnPreviewMouseButtonDown function.

Parameters
InGeometryThe geometry.
InMouseEventThe mouse event.
Returns
The reply.

◆ OnRequestCloseFromWeb()

bool SCefView::OnRequestCloseFromWeb ( )
protected

Called when a close request is received from the web content.

Returns
True to allow the close, false to cancel.

◆ ResponseUCefQuery()

bool SCefView::ResponseUCefQuery ( const int64 InQueryId,
const bool bInIsSuccess,
const FString & InResponse,
const int32 InError )

Responds to a UCefQuery request from the browser.

Parameters
InQueryIdID of the query to respond to.
bInIsSuccessTrue if the query was successful.
InResponseResponse string.
InErrorError code, if any.
Returns
True if the response was sent successfully, false otherwise.

◆ SetAcceptDrops()

void SCefView::SetAcceptDrops ( bool bInAcceptDrops)

Enables or disables accepting drag-and-drop operations.

Parameters
bInAcceptDropsTrue to accept drops, false otherwise.

◆ SetAllowDrag()

void SCefView::SetAllowDrag ( bool bInAllowDrag)

Enables or disables allowing drag operations.

Parameters
bInAllowDragTrue to allow drag, false otherwise.

◆ SetDisablePopupContextMenu()

void SCefView::SetDisablePopupContextMenu ( bool bInIsDisable)

Sets whether to disable the context menu for pop-up browsers.

Parameters
bInIsDisableTrue to disable, false otherwise.

◆ SetEnableContextMenu()

void SCefView::SetEnableContextMenu ( bool bInEnableContextMenu)

Enables or disables the context menu in the browser.

Parameters
bInEnableContextMenuTrue to enable, false to disable.

◆ SetFrameRate()

void SCefView::SetFrameRate ( int32 InFrameRate)

Sets the frame rate for browser rendering.

Parameters
InFrameRateThe desired frame rate.

◆ SetPreference()

bool SCefView::SetPreference ( const FString & InPreferenceName,
const FString & InPreferenceValue,
FString & OutError )

Sets a browser preference.

Parameters
InPreferenceNameName of the preference.
InPreferenceValueValue to set.
OutErrorError message, if any.
Returns
True if the preference was set successfully, false otherwise.

◆ SetUrl()

void SCefView::SetUrl ( const FString & InUrl)

Sets the URL to be loaded in the browser.

Parameters
InUrlThe URL to load.

◆ SetVisibility()

void SCefView::SetVisibility ( TAttribute< EVisibility > InVisibility)
overrideprotected

Sets the visibility.

Parameters
InVisibilityThe visibility.

◆ ShowDevTools()

void SCefView::ShowDevTools ( )

Opens the browser's developer tools dialog.

◆ SupportsKeyboardFocus()

bool SCefView::SupportsKeyboardFocus ( ) const
overrideprotected

SupportsKeyboardFocus function.

Returns
Whether the widget supports keyboard focus.

◆ Tick()

void SCefView::Tick ( const FGeometry & InAllottedGeometry,
const double InCurrentTime,
const float InDeltaTime )
overrideprotected

Tick function.

Parameters
InAllottedGeometryThe allotted geometry.
InCurrentTimeThe current time.
InDeltaTimeThe delta time.

◆ TriggerEventForFrame()

bool SCefView::TriggerEventForFrame ( const FString & InName,
const TArray< TSharedPtr< FJsonValue > > & InArgs,
const FCefFrameId & InFrameId )

Triggers a custom event for a specific frame in the browser.

Parameters
InNameName of the event.
InArgsArguments to pass to the event.
InFrameIdFrame ID to trigger the event on.
Returns
True if the event was triggered successfully, false otherwise.

◆ TriggerEventForMainFrame()

bool SCefView::TriggerEventForMainFrame ( const FString & InName,
const TArray< TSharedPtr< FJsonValue > > & InArgs )

Triggers a custom event for the main frame in the browser.

Parameters
InNameName of the event.
InArgsArguments to pass to the event.
Returns
True if the event was triggered successfully, false otherwise.

Member Data Documentation

◆ AllFrameID

const FCefFrameId SCefView::AllFrameID
static

The identifier for all frames.

◆ MainFrameID

const FCefFrameId SCefView::MainFrameID
static

The main frame identity.

◆ OnAddressChanged

FOnAddressChangedEvent SCefView::OnAddressChanged
protected

On address changed event.

◆ OnConsoleMessage

FOnConsoleMessageEvent SCefView::OnConsoleMessage
protected

On console message event.

◆ OnDraggableRegionChanged

FOnDraggableRegionChangedEvent SCefView::OnDraggableRegionChanged
protected

On draggable region changed event.

◆ OnFaviconUrlChanged

FOnFaviconUrlChangedEvent SCefView::OnFaviconUrlChanged
protected

On favicon URL changed event.

◆ OnFullscreenModeChanged

FOnFullscreenModeChangedEvent SCefView::OnFullscreenModeChanged
protected

On fullscreen mode changed event.

◆ OnInvokeMethod

FOnInvokeMethodEvent SCefView::OnInvokeMethod
protected

On invoke method event.

◆ OnLoadEnd

FOnLoadEndEvent SCefView::OnLoadEnd
protected

On load end event.

◆ OnLoadError

FOnLoadErrorEvent SCefView::OnLoadError
protected

On load error event.

◆ OnLoadingProgressChanged

FOnLoadingProgressChangedEvent SCefView::OnLoadingProgressChanged
protected

On loading progress changed event.

◆ OnLoadStart

FOnLoadStartEvent SCefView::OnLoadStart
protected

On load start event.

◆ OnLoadStateChanged

FOnLoadStateChangedEvent SCefView::OnLoadStateChanged
protected

On load state changed event.

◆ OnNativeBrowserCreated

FOnNativeBrowserCreatedEvent SCefView::OnNativeBrowserCreated
protected

On native browser created event.

◆ OnQueryRequest

FOnQueryRequestEvent SCefView::OnQueryRequest
protected

On query request event.

◆ OnReportJavascriptResult

FOnReportJavascriptResultEvent SCefView::OnReportJavascriptResult
protected

On report JavaScript result event.

◆ OnStatusMessage

FOnStatusMessageEvent SCefView::OnStatusMessage
protected

On status message event.

◆ OnTitleChanged

FOnTitleChangedEvent SCefView::OnTitleChanged
protected

On title changed event.

◆ OnUrlRequest

FOnUrlRequestEvent SCefView::OnUrlRequest
protected

On URL request event.