// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "IPropertyTypeCustomization.h" #include "Core/Private/Internationalization/TextCache.h" class IPropertyHandle; /** * Implements a details view customization for the FTemplateString structure. */ class FTemplateStringStructCustomization : public IPropertyTypeCustomization { public: /** * Creates an instance of this class. * * @return The new instance. */ static TSharedRef MakeInstance( ) { return MakeShareable(new FTemplateStringStructCustomization()); } public: virtual void CustomizeChildren( TSharedRef StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override; virtual void CustomizeHeader( TSharedRef StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override; private: /** Get the property string value (as FText). */ FText GetText() const; /** Set the property string value (from FText). */ void SetText(const FText& InNewText) const; /** Get/Create tooltip, with list of valid arguments. */ FText GetToolTip() const; /** Get the list of valid arguments. */ const TArray& GetValidArguments() const; private: /** Pointer to the string that will be set when changing the path */ TSharedPtr TemplateStringProperty; /** Cached tooltip, created by GetToolTip(). */ mutable FText CachedTooltip; /** Store the valid arguments for this property. */ mutable TArray ValidArguments; };