// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Components/DynamicEntryBoxBase.h" #include "UIExtensionSystem.h" #include "UIExtensionPointWidget.generated.h" #define UE_API UIEXTENSION_API class IWidgetCompilerLog; class UCommonLocalPlayer; class APlayerState; /** * A slot that defines a location in a layout, where content can be added later */ UCLASS(MinimalAPI) class UUIExtensionPointWidget : public UDynamicEntryBoxBase { GENERATED_BODY() public: DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(TSubclassOf, FOnGetWidgetClassForData, UObject*, DataItem); DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnConfigureWidgetForData, UUserWidget*, Widget, UObject*, DataItem); UE_API UUIExtensionPointWidget(const FObjectInitializer& ObjectInitializer); //~UWidget interface UE_API virtual void ReleaseSlateResources(bool bReleaseChildren) override; UE_API virtual TSharedRef RebuildWidget() override; #if WITH_EDITOR UE_API virtual void ValidateCompiledDefaults(IWidgetCompilerLog& CompileLog) const override; #endif //~End of UWidget interface private: void ResetExtensionPoint(); void RegisterExtensionPoint(); void RegisterExtensionPointForPlayerState(UCommonLocalPlayer* LocalPlayer, APlayerState* PlayerState); void OnAddOrRemoveExtension(EUIExtensionAction Action, const FUIExtensionRequest& Request); protected: /** The tag that defines this extension point */ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Extension") FGameplayTag ExtensionPointTag; /** How exactly does the extension need to match the extension point tag. */ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Extension") EUIExtensionPointMatch ExtensionPointTagMatch = EUIExtensionPointMatch::ExactMatch; UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Extension") TArray> DataClasses; UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="UI Extension", meta=( IsBindableEvent="True" )) FOnGetWidgetClassForData GetWidgetClassForData; UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="UI Extension", meta=( IsBindableEvent="True" )) FOnConfigureWidgetForData ConfigureWidgetForData; TArray ExtensionPointHandles; UPROPERTY(Transient) TMap> ExtensionMapping; }; #undef UE_API