// Copyright Epic Games, Inc. All Rights Reserved. #include "Widgets/PropertyViewer/SPropertyViewer.h" #include "Widgets/PropertyViewer/SPropertyViewerImpl.h" #define LOCTEXT_NAMESPACE "SPropertyViewer" namespace UE::PropertyViewer { void SPropertyViewer::ConstructInternal(const FArguments& InArgs) { ChildSlot [ Implementation->Construct(InArgs) ]; } void SPropertyViewer::Construct(const FArguments& InArgs) { Implementation = MakeShared(InArgs); ConstructInternal(InArgs); } void SPropertyViewer::Construct(const FArguments& InArgs, const UScriptStruct* Struct) { Implementation = MakeShared(InArgs); Implementation->AddContainer(MakeContainerIdentifier(), TOptional(), Struct); ConstructInternal(InArgs); } void SPropertyViewer::Construct(const FArguments& InArgs, const UScriptStruct* Struct, void* InData) { Implementation = MakeShared(InArgs); Implementation->AddContainerInstance(MakeContainerIdentifier(), TOptional(), Struct, InData); ConstructInternal(InArgs); } void SPropertyViewer::Construct(const FArguments& InArgs, const UClass* Class) { Implementation = MakeShared(InArgs); Implementation->AddContainer(MakeContainerIdentifier(), TOptional(), Class); ConstructInternal(InArgs); } void SPropertyViewer::Construct(const FArguments& InArgs, UObject* ObjectInstance) { Implementation = MakeShared(InArgs); Implementation->AddContainerInstance(MakeContainerIdentifier(), TOptional(), ObjectInstance); ConstructInternal(InArgs); } void SPropertyViewer::Construct(const FArguments& InArgs, const UFunction* Function) { Implementation = MakeShared(InArgs); Implementation->AddContainer(MakeContainerIdentifier(), TOptional(), Function); ConstructInternal(InArgs); } void SPropertyViewer::Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) { Super::Tick(AllottedGeometry, InCurrentTime, InDeltaTime); Implementation->Tick(); } SPropertyViewer::FHandle SPropertyViewer::AddContainer(const UScriptStruct* Struct, TOptional DisplayName) { SPropertyViewer::FHandle Result = MakeContainerIdentifier(); Implementation->AddContainer(Result, DisplayName, Struct); return Result; } SPropertyViewer::FHandle SPropertyViewer::AddContainer(const UClass* Class, TOptional DisplayName) { SPropertyViewer::FHandle Result = MakeContainerIdentifier(); Implementation->AddContainer(Result, DisplayName, Class); return Result; } SPropertyViewer::FHandle SPropertyViewer::AddContainer(const UFunction* Function, TOptional DisplayName) { SPropertyViewer::FHandle Result = MakeContainerIdentifier(); Implementation->AddContainer(Result, DisplayName, Function); return Result; } SPropertyViewer::FHandle SPropertyViewer::AddInstance(const UScriptStruct* Struct, void* InData, TOptional DisplayName) { check(InData); SPropertyViewer::FHandle Result = MakeContainerIdentifier(); Implementation->AddContainerInstance(Result, DisplayName, Struct, InData); return Result; } SPropertyViewer::FHandle SPropertyViewer::AddInstance(UObject* ObjectInstance, TOptional DisplayName) { SPropertyViewer::FHandle Result = MakeContainerIdentifier(); Implementation->AddContainerInstance(Result, DisplayName, ObjectInstance); return Result; } void SPropertyViewer::Remove(FHandle Identifier) { Implementation->Remove(Identifier); } void SPropertyViewer::RemoveAll() { Implementation->RemoveAll(); } TArray SPropertyViewer::GetSelectedItems() const { return Implementation->GetSelectedItems(); } void SPropertyViewer::SetRawFilterText(const FText& InFilterText) { Implementation->SetRawFilterText(InFilterText); } void SPropertyViewer::SetSelection(FHandle Container, TArrayView FieldPath) { Implementation->SetSelection(Container, FieldPath); } SPropertyViewer::FHandle SPropertyViewer::MakeContainerIdentifier() { static int32 IdentifierGenerator = 0; SPropertyViewer::FHandle Result; ++IdentifierGenerator; Result.Id = IdentifierGenerator; return Result; } } //namespace #undef LOCTEXT_NAMESPACE