1.26.2.1
Prysm for UE4
UCohtmlBaseComponent Class Reference
+ Inheritance diagram for UCohtmlBaseComponent:

Public Types

typedef TArray< TWeakObjectPtr< UCohtmlBaseComponent > > WeakCohtmlComponentsArray
 

Public Member Functions

void SetSoundAttenuation (const FSoundAttenuationSettings &Settings)
 
void RegisterForEvent (UPARAM(DisplayName="JavaScript Event Name") FString JSEventName, UPARAM(DisplayName="Event") FCohtmlJSEventBPCallback Delegate)
 
virtual void Resize (int32 width, int32 height)
 
virtual void ResizeRenderTarget (int32 width, int32 height)
 
bool IsReadyToCreateView () const
 
bool IsReadyForBindings () const
 
bool HasRequestedView () const
 
void ShowPaintRects (bool show)
 
void Load (const FString &path)
 
void Reload ()
 
void DebugSaveNextFrame ()
 
void BeginDebugFrameSave ()
 
void EndDebugFrameSave ()
 
void EnableDelayedUpdate (bool bEnabled)
 
void EnableRendering (bool bEnabled)
 
UCohtmlJSEventCreateJSEvent ()
 
void TriggerJSEvent (const FString &name, UCohtmlJSEvent *eventData) const
 
void CreateDataModelFromObject (const FString &Name, UObject *Model)
 
void RemoveDataModelFromObject (UObject *Model)
 
void CreateDataModelFromStruct (const FString &Name, const TFieldPath< FStructProperty > Arg)
 
void UpdateWholeDataModelFromStruct (const TFieldPath< FStructProperty > Struct) const
 
void RemoveDataModelFromStruct (const TFieldPath< FStructProperty > Struct) const
 
void UpdateWholeDataModelFromObject (UObject *Model) const
 
void SynchronizeModels () const
 
void PreloadTextureSync (const FString &AssetPath)
 
void PreloadTextureAsync (const FString &AssetPath)
 
void AddPreloadedTexture (UTexture2D *Texture)
 
bool RemovePreloadedTextureFromPath (const FString &AssetPath)
 
bool RemovePreloadedTexture (UTexture2D *Texture)
 
void RemoveAllPreloadedTextures ()
 
virtual bool EnsureMeshData (ECohtmlComponentMeshInit MeshInitialization=ECohtmlComponentMeshInit::LazyInit)
 
virtual void InitializeComponent () override
 
virtual void BeginDestroy () override
 
virtual bool IsReadyForFinishDestroy () override
 
virtual void FinishDestroy () override
 
virtual bool GetMeshes (TArray< TWeakObjectPtr< UStaticMeshComponent >> &WeakMeshes) const
 
virtual void TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 
cohtml::View * GetView () const
 
cohtml::ViewRenderer * GetViewRenderer () const
 
FCohtmlGesturePolicy * GetGesturePolicy ()
 
FCohtmlViewWrapperGetViewWrapper () const
 
const FCohtmlCaretRectGetCaretRect () const
 
void SetCaretRect (int x, int y, unsigned width, unsigned height)
 
virtual int32 GetUserIndex ()
 
void SetInputFocusToUI ()
 
void RestoreInputFocusFromUI (bool bForceFocusToGame=false)
 
cohtml::ECohtmlPageLoadState GetCurrentPageState () const
 
 DECLARE_FUNCTION (execCreateDataModelFromStruct)
 
 DECLARE_FUNCTION (execUpdateWholeDataModelFromStruct)
 
 DECLARE_FUNCTION (execRemoveDataModelFromStruct)
 

Static Public Member Functions

static void CreateSystemIfNecessary (UWorld *World)
 
static class ACohtmlSystemGetSystemActor (UWorld *World)
 
static WeakCohtmlComponentsArray::TIterator GetUCohtmlBaseComponentIterator (UWorld *world)
 

Public Attributes

FCohtmlReadyForBindingsSignature ReadyForBindings
 
FCohtmlBindingsReleasedSignature BindingsReleased
 
FCohtmlScriptingReady ScriptingReady
 
TArray< UTexture2D * > PreloadedTextures
 
bool bEnableComplexCSSSupport
 
UTextureRenderTarget2D * Texture
 
TEnumAsByte< enum TextureFilter > Filter
 
bool bReceiveInput
 
bool bDelayedUpdate
 
bool bUseWideColorTextures
 
TArray< FCohtmlMeshDataMeshData
 
TArray< CohtmlDelegateFunctorWrapperJSEventCallbackWrappers
 
EMouseCursor::Type CurrentMouseCursor
 

Protected Member Functions

void CreateView (const cohtml::ViewSettings &info, const FString &url)
 
virtual void SendRenderDynamicData_Concurrent () override
 
virtual bool RequiresGameThreadEndOfFrameUpdates () const override
 

Friends

class TCohtmlViewListener< UCohtmlBaseComponent >
 

Member Function Documentation

◆ AddPreloadedTexture()

void UCohtmlBaseComponent::AddPreloadedTexture ( UTexture2D *  Texture)

Adds an already loaded Texture to the PreloadedTextures collection. This is useful for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.

◆ BeginDebugFrameSave()

void UCohtmlBaseComponent::BeginDebugFrameSave ( )

Starts saving render frames to disk

◆ CreateDataModelFromObject()

void UCohtmlBaseComponent::CreateDataModelFromObject ( const FString &  Name,
UObject *  Model 
)

Creates a global variable (data model) in JavaScript from an UObject

◆ CreateDataModelFromStruct()

void UCohtmlBaseComponent::CreateDataModelFromStruct ( const FString &  Name,
const TFieldPath< FStructProperty >  Arg 
)

Creates a global variable (data model) in JavaScript from a UStruct

◆ CreateJSEvent()

UCohtmlJSEvent* UCohtmlBaseComponent::CreateJSEvent ( )

Creates an event that will be executed in JavaScript

◆ DebugSaveNextFrame()

void UCohtmlBaseComponent::DebugSaveNextFrame ( )

Saves next render frame to disk

◆ EnableDelayedUpdate()

void UCohtmlBaseComponent::EnableDelayedUpdate ( bool  bEnabled)

Delays UI updates until after cameras are updated. Read the section in the FAQ page of the documentation before using

◆ EnableRendering()

void UCohtmlBaseComponent::EnableRendering ( bool  bEnabled)

Enables or disables the recording of rendering commands for the view. Enabled by default.

◆ EndDebugFrameSave()

void UCohtmlBaseComponent::EndDebugFrameSave ( )

Stops saving render frames to disk

◆ EnsureMeshData()

virtual bool UCohtmlBaseComponent::EnsureMeshData ( ECohtmlComponentMeshInit  MeshInitialization = ECohtmlComponentMeshInit::LazyInit)
virtual

Used for specifying when the mesh needs to be ready to receive input. If left unspecified, the mesh will be loaded lazily, which means it will take between 2-4 frames for the render thread to have it available. If set to "Immediate", the render state will be flagged as dirty and the mesh will be loaded either on the same frame or at most the next. Note: Call manually right after a component's creation to guarantee that all input will be handled in the first frames.

◆ HasRequestedView()

bool UCohtmlBaseComponent::HasRequestedView ( ) const

Tells if a View has been scheduled for creation

◆ IsReadyForBindings()

bool UCohtmlBaseComponent::IsReadyForBindings ( ) const

Tells if the View is ready to be created

◆ IsReadyToCreateView()

bool UCohtmlBaseComponent::IsReadyToCreateView ( ) const

Tells if the View is ready to be created

◆ Load()

void UCohtmlBaseComponent::Load ( const FString &  path)

Requests a new URL to be loaded in the View

◆ PreloadTextureAsync()

void UCohtmlBaseComponent::PreloadTextureAsync ( const FString &  AssetPath)

Loads a Texture Asynchronously from asset Path. Once loaded, the Texture will be added to the PreloadedTextures collection. This is useful for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.

◆ PreloadTextureSync()

void UCohtmlBaseComponent::PreloadTextureSync ( const FString &  AssetPath)

Loads a Texture Synchronously (BLOCKING the main thread) from asset Path. Once loaded, the Texture will be added to the PreloadedTextures collection. This is useful for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.

◆ RegisterForEvent()

void UCohtmlBaseComponent::RegisterForEvent ( UPARAM(DisplayName="JavaScript Event Name") FString  JSEventName,
UPARAM(DisplayName="Event") FCohtmlJSEventBPCallback  Delegate 
)

You can use this to bind a Blueprint event to an arbitrary JavaScript event. The Blueprint event must have no parameters.

◆ Reload()

void UCohtmlBaseComponent::Reload ( )

Requests the View to reload the current URL

◆ RemoveAllPreloadedTextures()

void UCohtmlBaseComponent::RemoveAllPreloadedTextures ( )

Removes all Textures from the PreloadedTextures collection. This can be used when you no longer need any of the textures inside the collection to be kept loaded, for example after changing URL and View is fully loaded. Note: Upon destruction of the CohtmlBaseComponent, PreloadedTextures collection will be cleared automatically, so calling this method isn't mandatory.

◆ RemoveDataModelFromObject()

void UCohtmlBaseComponent::RemoveDataModelFromObject ( UObject *  Model)

Removes a global variable (data model) in JavaScript from a UObject

◆ RemoveDataModelFromStruct()

void UCohtmlBaseComponent::RemoveDataModelFromStruct ( const TFieldPath< FStructProperty >  Struct) const

Removes a global variable (data model) in JavaScript from a UStruct

◆ RemovePreloadedTexture()

bool UCohtmlBaseComponent::RemovePreloadedTexture ( UTexture2D *  Texture)

Removes a Texture from the PreloadedTextures collection. This can be used when you no longer need a specific texture inside the collection to be kept loaded, for example after changing URL and View is fully loaded. Note: The removal of elements is an operation with linear complexity, consider using RemoveAllPreloadedTextures instead. Note: Upon destruction of the CohtmlBaseComponent, PreloadedTextures collection will be cleared automatically, so calling this method isn't mandatory.

◆ RemovePreloadedTextureFromPath()

bool UCohtmlBaseComponent::RemovePreloadedTextureFromPath ( const FString &  AssetPath)

Removes a Texture from the PreloadedTextures collection. This can be used when you no longer need a specific texture inside the collection to be kept loaded, for example after changing URL and View is fully loaded. Note: The removal of elements is an operation with linear complexity, consider using RemoveAllPreloadedTextures instead. Note: Upon destruction of the CohtmlBaseComponent, PreloadedTextures collection will be cleared automatically, so calling this method isn't mandatory.

◆ Resize()

virtual void UCohtmlBaseComponent::Resize ( int32  width,
int32  height 
)
virtual

Resizes the View

Reimplemented in UCohtmlComponent, and UCohtmlHUD.

◆ ResizeRenderTarget()

virtual void UCohtmlBaseComponent::ResizeRenderTarget ( int32  width,
int32  height 
)
virtual

Resizes the texture where the View is drawn

◆ SetSoundAttenuation()

void UCohtmlBaseComponent::SetSoundAttenuation ( const FSoundAttenuationSettings &  Settings)

Sets the AttenuationSettings for the Sound Components Note: Sound is 2D by default. It can be changed to 3D if appropriate AttenuationSettings is set. for more details look at Unreal's documentation for AttenuationSettings

◆ ShowPaintRects()

void UCohtmlBaseComponent::ShowPaintRects ( bool  show)

Tells the view to show/hide debug paint rectangles

◆ SynchronizeModels()

void UCohtmlBaseComponent::SynchronizeModels ( ) const

Synchronize all models marked for update.

◆ TriggerJSEvent()

void UCohtmlBaseComponent::TriggerJSEvent ( const FString &  name,
UCohtmlJSEvent eventData 
) const

Triggers an event in JavaScript

◆ UpdateWholeDataModelFromObject()

void UCohtmlBaseComponent::UpdateWholeDataModelFromObject ( UObject *  Model) const

Marks an Object model for update. The UI using this data model will be updated during the next call to SynchronizeModels. For optimum performance, call SynchronizeModels as rarely as possible. (e.g. once per frame)

◆ UpdateWholeDataModelFromStruct()

void UCohtmlBaseComponent::UpdateWholeDataModelFromStruct ( const TFieldPath< FStructProperty >  Struct) const

Marks a Struct model for update. The UI using this data model will be updated during the next call to SynchronizeModels. For optimum performance, call SynchronizeModels as rarely as possible. (e.g. once per frame)

Member Data Documentation

◆ bDelayedUpdate

bool UCohtmlBaseComponent::bDelayedUpdate

Changes this component's tick group to TG_PostUpdateWork and sends bindings before drawing. For more information refer to the FAQ section of the documentation.

◆ bEnableComplexCSSSupport

bool UCohtmlBaseComponent::bEnableComplexCSSSupport

Whether to enable support for complex CSS selectors (e.g. div > p, div ~ p)

◆ BindingsReleased

FCohtmlBindingsReleasedSignature UCohtmlBaseComponent::BindingsReleased

When fired, the View has released its bindings.

◆ bReceiveInput

bool UCohtmlBaseComponent::bReceiveInput

Indicates whether input is forwarded to this view

◆ bUseWideColorTextures

bool UCohtmlBaseComponent::bUseWideColorTextures

Use 16 bit textures as intermidiate render targets for rendering the UI.

◆ PreloadedTextures

TArray<UTexture2D*> UCohtmlBaseComponent::PreloadedTextures

PreloadedTextures collection, keeping the Textures loaded and ready for use. Ideally, the Textures are to be loaded ahead of time and kept in this collection for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.

◆ ReadyForBindings

FCohtmlReadyForBindingsSignature UCohtmlBaseComponent::ReadyForBindings

When fired, the View is ready for binding events. Any event bound prior to this will be ignored

◆ ScriptingReady

FCohtmlScriptingReady UCohtmlBaseComponent::ScriptingReady

Called when the View is ready to accept events

◆ Texture

UTextureRenderTarget2D* UCohtmlBaseComponent::Texture

Gives access to the UI Texture