// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Widgets/SCompoundWidget.h" #include "Widgets/Views/SListView.h" #include "Models/ModelInterface.h" DECLARE_DELEGATE_OneParam(FOnViewValidatorLog, TSharedPtr) struct FValidatorColumn { FValidatorColumn(FName InName, float InWidth, bool InbIsFill, const TFunction)> InSortingFunc) : SortingFunc(InSortingFunc) { Name = InName; Width = InWidth; bIsFill = InbIsFill; } FName Name; float Width; bool bIsFill; const TFunction)> SortingFunc; }; class SValidatorsWidget : public SCompoundWidget { public: SLATE_BEGIN_ARGS(SValidatorsWidget) {} SLATE_ARGUMENT(FModelInterface*, ModelInterface) SLATE_EVENT(FOnViewValidatorLog, OnViewLog) SLATE_END_ARGS() void Construct(const FArguments& InArgs); virtual ~SValidatorsWidget(); private: TSharedRef BuildValidatorsView(bool bListPreSubmitOperations = false); void RefreshValidatorView(bool bListPreSubmitOperations = false); FModelInterface* ModelInterface; TSharedPtr>> ValidatorsListView; TSharedPtr>> PreSubmitListView; TMap>> Validators; TArray Columns; TSharedRef ConstructHeadersRow(const FName& GroupName); TSharedRef GenerateRow(TWeakPtr InItem, const TSharedRef& OwnerTable) const; void OnColumnSort(const FName& GroupName, EColumnSortPriority::Type InSortPriority, const FName& InColumnId, EColumnSortMode::Type InSortDirection); EColumnSortMode::Type GetSortMode(const FName ColumnId) const; FName SortByColumn; EColumnSortMode::Type SortMode; FOnViewValidatorLog OnViewLog; FDelegateHandle OnFilesRefreshed; FDelegateHandle OnPrepareSubmit; };