Quartz UI ↗
Browse docs
On this page
Private preview · 0.57.0-devView Markdown

QuartzUILayerStack: 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/QuartzUILayerStack.h) · integration recipe · practical guide

FQuartzUILayerStackChangedNative

Public delegate. Layer Stack Changed Native: callback signature for per-player ordered layer policy, retained views and back dismissal.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerStack recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: RegisterLayer with FQuartzUILayerDefinition; PushView; PopView. Close may defer for exit animation; covered views remain retained.

Avoid: Mutating another player's stack or forgetting close after nonclosing pop. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.

Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerStack.h#L13)

FQuartzUILayerTransitionDefinition

Public type. Bounded native composition animation; web content remains free to animate independently.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerStack recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: RegisterLayer with FQuartzUILayerDefinition; PushView; PopView. Close may defer for exit animation; covered views remain retained.

Avoid: Mutating another player's stack or forgetting close after nonclosing pop. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.

Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerStack.h#L17)

FQuartzUILayerDefinition

Public type. Host-independent layer policy; later adapters may map IDs to CommonUI gameplay tags.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerStack recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: RegisterLayer with FQuartzUILayerDefinition; PushView; PopView. Close may defer for exit animation; covered views remain retained.

Avoid: Mutating another player's stack or forgetting close after nonclosing pop. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.

Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerStack.h#L38)

FQuartzUILayerCloseRequestNative

Public delegate. Layer Close Request Native: callback signature for per-player ordered layer policy, retained views and back dismissal.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerStack recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: RegisterLayer with FQuartzUILayerDefinition; PushView; PopView. Close may defer for exit animation; covered views remain retained.

Avoid: Mutating another player's stack or forgetting close after nonclosing pop. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.

Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerStack.h#L69)

FQuartzUILayerEntry

Internal type. Layer Entry: a declared type in per-player ordered layer policy, retained views and back dismissal; use its exact fields/operations below.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerStack recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: RegisterLayer with FQuartzUILayerDefinition; PushView; PopView. Close may defer for exit animation; covered views remain retained.

Avoid: Mutating another player's stack or forgetting close after nonclosing pop. 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/QuartzUILayerStack.h#L77)

UQuartzUILayerStack

Public type. One ordered UI-layer registry for exactly one local player.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUILayerStack recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: RegisterLayer with FQuartzUILayerDefinition; PushView; PopView. Close may defer for exit animation; covered views remain retained.

Avoid: Mutating another player's stack or forgetting close after nonclosing pop. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.

Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUILayerStack.h#L90)

Complete header

Source snapshot, not an additional example. Unreal annotations distinguish exposed Blueprint nodes from native-only/private methods.

#pragma once

#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "QuartzUIInput.h"

#include "QuartzUILayerStack.generated.h"

class ULocalPlayer;
class UQuartzUISubsystem;
class UQuartzUIView;

DECLARE_MULTICAST_DELEGATE(FQuartzUILayerStackChangedNative);

/** Bounded native composition animation; web content remains free to animate independently. */
USTRUCT(BlueprintType)
struct QUARTZUIRUNTIME_API FQuartzUILayerTransitionDefinition
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers", meta = (ClampMin = "0.0", ClampMax = "2.0"))
	float EnterDurationSeconds = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers", meta = (ClampMin = "0.0", ClampMax = "2.0"))
	float ExitDurationSeconds = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers", meta = (ClampMin = "0.5", ClampMax = "1.5"))
	float EnterScale = 1.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers", meta = (ClampMin = "0.5", ClampMax = "1.5"))
	float ExitScale = 1.0f;

	bool IsValid() const;
};

/** Host-independent layer policy; later adapters may map IDs to CommonUI gameplay tags. */
USTRUCT(BlueprintType)
struct QUARTZUIRUNTIME_API FQuartzUILayerDefinition
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	FName LayerId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	int32 ZOrder = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	bool bReceivesInput = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	bool bModal = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	bool bDismissTopOnBack = false;

	/** CommonUI-style input/cursor policy activated with this layer. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	FQuartzUIInputConfig InputConfig;

	/** When true, routed gamepad navigation does not continue into gameplay. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	bool bConsumeNavigationInput = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "QuartzUI|Layers")
	FQuartzUILayerTransitionDefinition Transition;
};

DECLARE_DELEGATE_RetVal_ThreeParams(
	bool,
	FQuartzUILayerCloseRequestNative,
	UQuartzUIView*,
	const FQuartzUILayerDefinition&,
	bool /* bWasVisible */);

USTRUCT()
struct FQuartzUILayerEntry
{
	GENERATED_BODY()

	UPROPERTY(Transient)
	FQuartzUILayerDefinition Definition;

	UPROPERTY(Transient)
	TArray<TObjectPtr<UQuartzUIView>> Views;
};

/** One ordered UI-layer registry for exactly one local player. */
UCLASS(BlueprintType)
class QUARTZUIRUNTIME_API UQuartzUILayerStack final : public UObject
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	ULocalPlayer* GetOwningLocalPlayer() const { return OwningLocalPlayer; }

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
	bool RegisterLayer(const FQuartzUILayerDefinition& Definition);

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	bool HasLayer(FName LayerId) const;

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	bool GetLayerDefinition(FName LayerId, FQuartzUILayerDefinition& OutDefinition) const;

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	bool GetLayerDefinitionForView(UQuartzUIView* View, FQuartzUILayerDefinition& OutDefinition) const;

	/**
	 * Updates only the validated input ownership fields of an existing layer.
	 * The retained views and their browser documents are never moved or recreated.
	 */
	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
	bool SetLayerInputConfig(
		FName LayerId,
		const FQuartzUIInputConfig& InputConfig,
		bool bReceivesInput);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
	bool PushView(FName LayerId, UQuartzUIView* View);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
	UQuartzUIView* PopView(FName LayerId, bool bCloseView = true);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
	bool RemoveView(UQuartzUIView* View, bool bCloseView = true);

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	UQuartzUIView* GetTopView(FName LayerId) const;

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	TArray<UQuartzUIView*> GetLayerViews(FName LayerId) const;

	/** Returns one top view per non-empty layer, ordered from lowest to highest Z. */
	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	TArray<UQuartzUIView*> GetVisibleViews() const;

	/** Returns every retained view in render order, including covered views. */
	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	TArray<UQuartzUIView*> GetPresentationViews() const;

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	bool IsViewVisible(const UQuartzUIView* View) const;

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	bool IsViewInteractive(const UQuartzUIView* View) const;

	UQuartzUIView* GetTopInteractiveView() const;

	EQuartzUIInputMode GetDesiredInputMode() const;

	FQuartzUIInputConfig GetDesiredInputConfig() const;

	bool ShouldConsumeNavigationInput() const;

	/** Pops the highest back-dismissible layer. Passive HUD layers are skipped. */
	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Layers")
	bool HandleBack();

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Layers")
	int32 GetViewCount() const;

	/** True while the presentation host retains a removed view for its exit animation. */
	bool IsCloseDeferred(const UQuartzUIView* View) const;

	static FName GetDefaultHudLayerId();

	static FName GetDefaultMenuLayerId();

	static FName GetDefaultModalLayerId();

	/** Native presentation hosts subscribe here; logical policy remains UMG-independent. */
	FQuartzUILayerStackChangedNative& OnStackChanged() { return StackChanged; }

	/** Exactly one visual host may coordinate deferred closes for a player stack. */
	bool ClaimPresentationHost(UObject* Owner, FQuartzUILayerCloseRequestNative CloseRequest);
	void ReleasePresentationHost(UObject* Owner);
	bool CompleteDeferredClose(UObject* Owner, UQuartzUIView* View);

private:
	friend class UQuartzUISubsystem;

	void Initialize(UQuartzUISubsystem* InSubsystem, ULocalPlayer* InOwningLocalPlayer);
	void Shutdown();
	void ResetViews();
	FQuartzUILayerEntry* FindLayer(FName LayerId);
	const FQuartzUILayerEntry* FindLayer(FName LayerId) const;
	bool RequestDeferredClose(UQuartzUIView* View, const FQuartzUILayerDefinition& Definition, bool bWasVisible);
	void CancelDeferredClose(UQuartzUIView* View);
	void FlushDeferredCloses();
	void BroadcastStackChanged();

	UPROPERTY(Transient)
	TObjectPtr<ULocalPlayer> OwningLocalPlayer;

	UPROPERTY(Transient)
	TArray<FQuartzUILayerEntry> Layers;

	TWeakObjectPtr<UObject> PresentationHostOwner;
	FQuartzUILayerCloseRequestNative PresentationCloseRequest;
	TSet<TWeakObjectPtr<UQuartzUIView>> DeferredCloseViews;

	FQuartzUILayerStackChangedNative StackChanged;
};