QuartzUILayerHost: declaration reference
0.57.0-dev · beta source documentation. Native, Blueprint, Editor and rendering examples are source-reviewed, not executed in Unreal during this scan. See validation and limits.
Pinned source (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h) · integration recipe · practical guide
EQuartzUIHostTransitionPhase
Public type. Host Transition Phase: a declared type in umg layer presenter, exact-player routing, preferences and transitions; use its exact fields/operations below.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L21)
FQuartzUIHostTransitionState
Internal type. Host Transition State: a declared type in umg layer presenter, exact-player routing, preferences and transitions; use its exact fields/operations below.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. This named helper is runtime-owned; inspect/use it through the owner above rather than constructing it in gameplay.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L28)
FQuartzUIInputModalityChanged
Public delegate. Input Modality Changed: callback signature for umg layer presenter, exact-player routing, preferences and transitions.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L43)
FQuartzUIInputGlyphsChanged
Public delegate. Input Glyphs Changed: callback signature for umg layer presenter, exact-player routing, preferences and transitions.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L47)
FQuartzUIGamepadConnectionChanged
Public delegate. Gamepad Connection Changed: callback signature for umg layer presenter, exact-player routing, preferences and transitions.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L51)
FQuartzUIPlatformContextChanged
Public delegate. Platform Context Changed: callback signature for umg layer presenter, exact-player routing, preferences and transitions.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L55)
FQuartzUIPresentationContextChanged
Public delegate. Presentation Context Changed: callback signature for umg layer presenter, exact-player routing, preferences and transitions.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L59)
UQuartzUILayerHost
Public type. UMG-facing presentation host for exactly one local player's logical layer stack. Covered views keep their browser widget so navigation state can resume cheaply.
Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerHost recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: AttachToLayerStack; RegisterInputAdapter; SetPresentationPreferences. Detach deactivates adapters and presentation state.
Avoid: Building a second conflicting input/visibility controller. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerHost.h#L69)
Complete header
Source snapshot, not an additional example. Unreal annotations distinguish exposed Blueprint nodes from native-only/private methods.
#pragma once
#include "Components/Widget.h"
#include "QuartzUIInput.h"
#include "QuartzUIPlatform.h"
#include "QuartzUIPresentation.h"
#include "QuartzUILayerHost.generated.h"
class ULocalPlayer;
class APlayerController;
class UQuartzUILayerStack;
class UQuartzUIView;
class UQuartzUIWidget;
class UQuartzUIInputAdapter;
class FQuartzUIInputProcessor;
class SQuartzUILayerOverlay;
struct FQuartzUIBackTimeoutState;
enum class EInputDeviceConnectionState : uint8;
enum class EQuartzUIHostTransitionPhase : uint8
{
Entering,
RetainedUnderlay,
Exiting
};
struct FQuartzUIHostTransitionState
{
TWeakObjectPtr<UQuartzUIView> View;
TWeakPtr<SWidget> Widget;
EQuartzUIHostTransitionPhase Phase = EQuartzUIHostTransitionPhase::Entering;
float ElapsedSeconds = 0.0f;
float DurationSeconds = 0.0f;
float StartOpacity = 1.0f;
float EndOpacity = 1.0f;
float StartScale = 1.0f;
float EndScale = 1.0f;
float CurrentOpacity = 1.0f;
float CurrentScale = 1.0f;
};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FQuartzUIInputModalityChanged,
EQuartzUIInputModality, PreviousModality,
EQuartzUIInputModality, NewModality);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FQuartzUIInputGlyphsChanged,
FName, PreviousProfileId,
FName, NewProfileId);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FQuartzUIGamepadConnectionChanged,
bool, bWasConnected,
bool, bIsConnected);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FQuartzUIPlatformContextChanged,
FQuartzUIPlatformContext, PreviousContext,
FQuartzUIPlatformContext, NewContext);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FQuartzUIPresentationContextChanged,
FQuartzUIPresentationContext, PreviousContext,
FQuartzUIPresentationContext, NewContext);
/**
* UMG-facing presentation host for exactly one local player's logical layer stack.
* Covered views keep their browser widget so navigation state can resume cheaply.
*/
UCLASS(BlueprintType, meta = (DisplayName = "QuartzUI Layer Host"))
class QUARTZUIRUNTIME_API UQuartzUILayerHost final : public UWidget
{
GENERATED_BODY()
public:
UQuartzUILayerHost(const FObjectInitializer& ObjectInitializer);
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
bool AttachToLayerStack(UQuartzUILayerStack* Stack);
/** Detaches browser presentations without closing their logical views. */
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
void DetachFromLayerStack();
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
UQuartzUILayerStack* GetLayerStack() const { return LayerStack; }
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
ULocalPlayer* GetLayerOwningLocalPlayer() const;
/** Reconciles retained presentations immediately; stack changes call this automatically. */
bool SynchronizeLayers();
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
int32 GetPresentedViewCount() const { return PresentedViews.Num(); }
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
int32 GetVisibleViewCount() const;
/** Removed browser presentations retained until their bounded exit completes. */
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
int32 GetExitingViewCount() const { return ExitingViews.Num(); }
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
bool IsTransitioning() const { return ActiveTransitions.Num() > 0 || ExitingViews.Num() > 0; }
/** Disabling transitions completes any active lifecycle boundary immediately. */
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
void SetTransitionsEnabled(bool bEnabled);
/** Deterministic escape hatch for teardown, travel, tests, and accessibility. */
void FinishTransitions();
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
UQuartzUIView* GetTopInteractiveView() const;
UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
EQuartzUIInputMode GetDesiredInputMode() const;
UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
FQuartzUIInputConfig GetDesiredInputConfig() const;
UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
bool ShouldConsumeNavigationInput() const;
/** UI-only blocks unmapped gamepad/motion input for this exact Slate user. */
UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
bool ShouldBlockGameInput() const;
/** Resolved through Unreal's controller/platform-user to Slate-user mapping. */
int32 GetInputUserIndex() const;
bool IsInputUser(int32 SlateUserIndex) const;
/** Applies the stack's current mode and browser focus to its local player controller. */
bool ApplyInputMode();
/** Controller that most recently received this host's input policy. */
APlayerController* GetAppliedInputPlayerController() const { return InputModePlayerController.Get(); }
bool SetInputModality(EQuartzUIInputModality NewModality);
EQuartzUIInputModality GetInputModality() const { return InputModality; }
/** Atomically publishes a backend-resolved modality and glyph profile. */
bool SetInputPresentationState(
EQuartzUIInputModality NewModality,
FName ProfileId,
const TArray<FQuartzUIResolvedInputGlyph>& Glyphs);
/**
* Atomically applies a project-resolved profile. Device detection remains owned
* by CommonInput, Steam Input, platform code, or another project adapter.
*/
bool SetResolvedInputGlyphs(FName ProfileId, const TArray<FQuartzUIResolvedInputGlyph>& Glyphs);
FName GetInputGlyphProfileId() const { return InputGlyphProfileId; }
TArray<FQuartzUIResolvedInputGlyph> GetResolvedInputGlyphs() const { return ResolvedInputGlyphs; }
/** Convenience for project-authored CommonUI-style data assets. */
bool ApplyInputGlyphProfile(UQuartzUIInputGlyphProfile* Profile);
/** Explicit adapter input; automatic routing also follows UE device topology. */
bool SetGamepadConnected(bool bConnected);
bool IsGamepadConnected() const { return bGamepadConnected; }
/** Enables the exact-player Slate input observer/router used by standalone projects. */
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
void SetAutomaticInputRoutingEnabled(bool bEnabled);
/** Registers one project or optional-plugin input provider (maximum eight). */
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
bool RegisterInputAdapter(UQuartzUIInputAdapter* Adapter);
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
bool UnregisterInputAdapter(UQuartzUIInputAdapter* Adapter);
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
void ClearInputAdapters();
UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
TArray<UQuartzUIInputAdapter*> GetInputAdapters() const;
/** Sends one semantic navigation event to the highest interactive web view. */
bool RouteNavigationAction(EQuartzUINavigationAction Action);
/** Sends a project-defined press/hold/release action to the highest interactive web view. */
bool RouteInputAction(const FQuartzUIInputActionEvent& ActionEvent);
/** Applies native Back policy for Cancel, otherwise routes the action to the active web view. */
bool HandleNavigationAction(EQuartzUINavigationAction Action);
UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
bool IsBackNavigationPending() const { return PendingBackRequestId > 0; }
UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
UQuartzUIWidget* GetPresentationWidget(const UQuartzUIView* View) const;
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
bool HandleBack();
/** Atomically replaces the open platform policy shared by every presented view. */
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Platform")
bool SetPlatformContext(FName PlatformId, const TArray<FName>& Traits);
UFUNCTION(BlueprintPure, Category = "QuartzUI|Platform")
FQuartzUIPlatformContext GetPlatformContext() const { return PlatformContext; }
UFUNCTION(BlueprintPure, Category = "QuartzUI|Platform")
bool HasPlatformTrait(FName Trait) const;
/** Applies project-owned per-player preferences; Unreal still owns language and screen-reader state. */
UFUNCTION(BlueprintCallable, Category = "QuartzUI|Presentation", meta = (ClampMin = "0.75", ClampMax = "2.0"))
bool SetPresentationPreferences(float TextScale, bool bReducedMotion, bool bHighContrast);
/** Refreshes language, locale, RTL, and platform screen-reader state from UE. */
bool RefreshPresentationContextFromUnreal();
UFUNCTION(BlueprintPure, Category = "QuartzUI|Presentation")
FQuartzUIPresentationContext GetPresentationContext() const { return PresentationContext; }
UPROPERTY(BlueprintAssignable, Category = "QuartzUI|Input")
FQuartzUIInputModalityChanged OnInputModalityChanged;
UPROPERTY(BlueprintAssignable, Category = "QuartzUI|Input")
FQuartzUIInputGlyphsChanged OnInputGlyphsChanged;
UPROPERTY(BlueprintAssignable, Category = "QuartzUI|Input")
FQuartzUIGamepadConnectionChanged OnGamepadConnectionChanged;
UPROPERTY(BlueprintAssignable, Category = "QuartzUI|Platform")
FQuartzUIPlatformContextChanged OnPlatformContextChanged;
UPROPERTY(BlueprintAssignable, Category = "QuartzUI|Presentation")
FQuartzUIPresentationContextChanged OnPresentationContextChanged;
virtual void ReleaseSlateResources(bool bReleaseChildren) override;
virtual void BeginDestroy() override;
#if WITH_EDITOR
virtual const FText GetPaletteCategory() override;
#endif
protected:
virtual TSharedRef<SWidget> RebuildWidget() override;
/** Keeps input ownership deterministic as layers activate/deactivate. */
UPROPERTY(EditAnywhere, Category = "QuartzUI|Input")
bool bApplyInputModeAutomatically = true;
UPROPERTY(EditAnywhere, Category = "QuartzUI|Input")
bool bShowCursorForMouseUI = true;
/** Disable when a project-level adapter will provide modality and semantic actions itself. */
UPROPERTY(EditAnywhere, Category = "QuartzUI|Input")
bool bEnableAutomaticInputRouting = true;
/** Uses each layer's bounded fade/scale policy; idle hosts do not tick. */
UPROPERTY(EditAnywhere, Category = "QuartzUI|Layers")
bool bEnableTransitions = true;
/** Maximum time a page may hold Back before native layer policy resumes. */
UPROPERTY(EditAnywhere, Category = "QuartzUI|Input", meta = (ClampMin = "0.05", ClampMax = "2.0"))
float BackNavigationTimeoutSeconds = 0.35f;
private:
bool ShouldUseTransitions() const
{
return bEnableTransitions && !PresentationContext.bReducedMotion;
}
void HandleLayerStackChanged();
void RefreshSlateChildren(bool bUpdateRuntimeSuspension = true);
void SuspendPresentationsForHostRebuild();
void RestorePresentationsAfterHostRebuild();
bool BeginDeferredClose(UQuartzUIView* View, const struct FQuartzUILayerDefinition& Definition, bool bWasVisible);
bool TickTransitions(float DeltaTime);
void StartTransition(
UQuartzUIView* View,
const TSharedPtr<SWidget>& Widget,
EQuartzUIHostTransitionPhase Phase,
float DurationSeconds,
float StartOpacity,
float EndOpacity,
float StartScale,
float EndScale);
void RemoveTransition(UQuartzUIView* View, bool bResetVisualState);
void FinalizeExitingView(UQuartzUIView* View);
void WakeTransitionTimer();
bool HasActiveTransition(const UQuartzUIView* View) const;
void EnsureInputProcessor();
void ReleaseInputProcessor();
void ActivateInputAdapters();
void DeactivateInputAdapters();
void NotifyInputAdaptersOfContextChange();
void BindInputOwnerDelegates(ULocalPlayer* LocalPlayer);
void UnbindInputOwnerDelegates(ULocalPlayer* LocalPlayer);
void HandlePlayerControllerChanged(APlayerController* NewPlayerController);
void HandleControllerIdChanged(int32 NewControllerId, int32 OldControllerId);
void HandlePlatformUserIdChanged(FPlatformUserId NewUserId, FPlatformUserId OldUserId);
void HandleInputDeviceConnectionChanged(
EInputDeviceConnectionState NewState,
FPlatformUserId PlatformUserId,
FInputDeviceId InputDeviceId);
void HandleInputDevicePairingChanged(
FInputDeviceId InputDeviceId,
FPlatformUserId NewUserId,
FPlatformUserId OldUserId);
void HandleInputHardwareDeviceChanged(FPlatformUserId UserId, FInputDeviceId InputDeviceId);
void RefreshGamepadConnectionState(FInputDeviceId PreferredDeviceId = INPUTDEVICEID_NONE);
bool IsKnownGamepadDevice(FInputDeviceId InputDeviceId) const;
void ReleaseInputFocusForUser(int32 SlateUserIndex);
bool MatchesInputUser(int32 SlateUserIndex) const;
bool IsMultiLocalPlayerSession() const;
bool OwnsSlateCursor() const;
void CancelInputCaptureForView(UQuartzUIView* View);
void SetGameplayInputSuppressed(
APlayerController* PlayerController,
bool bSuppressMove,
bool bSuppressLook);
void PublishInputModality();
void PublishPlatformContext();
void PublishPresentationContext();
void BindPresentationContext();
void UnbindPresentationContext();
void HandleCultureChanged();
bool ApplyPresentationContext(const FQuartzUIPresentationContext& Candidate);
bool ApplyInputDeviceState(
EQuartzUIInputModality NewModality,
TOptional<bool> NewGamepadConnected = {});
void ObserveInputModality(EQuartzUIInputModality NewModality, FInputDeviceId InputDeviceId);
bool HasAuthoritativeInputModalityAdapter() const;
bool BeginWebFirstBack();
void HandleWebBackNavigationResult(int64 RequestId, bool bHandled);
bool HandleWebBackTimeout(float DeltaTime);
void CancelPendingWebBack();
static FString GetModalityName(EQuartzUIInputModality Modality);
static FString GetNavigationActionName(EQuartzUINavigationAction Action);
UPROPERTY(Transient)
TObjectPtr<UQuartzUILayerStack> LayerStack;
UPROPERTY(Transient)
TArray<TObjectPtr<UQuartzUIView>> PresentedViews;
UPROPERTY(Transient)
TArray<TObjectPtr<UQuartzUIWidget>> PresentationWidgets;
UPROPERTY(Transient)
TArray<TObjectPtr<UQuartzUIView>> ExitingViews;
UPROPERTY(Transient)
TArray<TObjectPtr<UQuartzUIWidget>> ExitingWidgets;
UPROPERTY(Transient)
TArray<TObjectPtr<UQuartzUIView>> LastVisibleViews;
UPROPERTY(Transient)
TArray<TObjectPtr<UQuartzUIInputAdapter>> InputAdapters;
TArray<TSharedPtr<SWidget>> PresentationSlateWidgets;
TArray<TSharedPtr<SWidget>> ExitingSlateWidgets;
TArray<TWeakObjectPtr<UQuartzUIView>> HostRebuildReadyViews;
TArray<TWeakObjectPtr<UQuartzUIView>> HostRebuildLoadingViews;
TArray<int32> ExitingLayerZOrders;
TArray<FQuartzUIHostTransitionState> ActiveTransitions;
TSharedPtr<SQuartzUILayerOverlay> LayerOverlay;
TSharedPtr<SWidget> TransitionInputGuard;
TSharedPtr<FQuartzUIInputProcessor> InputProcessor;
FDelegateHandle StackChangedHandle;
FDelegateHandle PlayerControllerChangedHandle;
FDelegateHandle ControllerIdChangedHandle;
FDelegateHandle PlatformUserIdChangedHandle;
FDelegateHandle InputDeviceConnectionChangedHandle;
FDelegateHandle InputDevicePairingChangedHandle;
FDelegateHandle InputHardwareDeviceChangedHandle;
FDelegateHandle CultureChangedHandle;
TWeakObjectPtr<APlayerController> InputModePlayerController;
TWeakObjectPtr<UQuartzUIView> LastInteractiveView;
TWeakObjectPtr<UQuartzUIView> PendingBackView;
TWeakObjectPtr<UQuartzUIWidget> PendingBackWidget;
TSharedPtr<FQuartzUIBackTimeoutState> BackTimeoutState;
int64 NextBackRequestId = 0;
int64 PendingBackRequestId = 0;
bool bMoveInputSuppressed = false;
bool bLookInputSuppressed = false;
bool bSlateResourcesReleased = false;
UPROPERTY(Transient)
EQuartzUIInputModality InputModality = EQuartzUIInputModality::MouseAndKeyboard;
UPROPERTY(Transient)
FName InputGlyphProfileId = TEXT("generic");
UPROPERTY(Transient)
TArray<FQuartzUIResolvedInputGlyph> ResolvedInputGlyphs;
UPROPERTY(Transient)
bool bGamepadConnected = false;
UPROPERTY(Transient)
FQuartzUIPlatformContext PlatformContext;
UPROPERTY(Transient)
FQuartzUIPresentationContext PresentationContext;
FInputDeviceId ActiveGamepadDeviceId = INPUTDEVICEID_NONE;
bool bActiveGamepadConfirmedByInput = false;
friend class FQuartzUIInputProcessor;
friend class SQuartzUILayerOverlay;
};