// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Widgets/Views/STableViewBase.h" #include "Widgets/Views/STableRow.h" #include "Widgets/Views/STreeView.h" #include "AnimTimeline/AnimTimelineTrack.h" class FAnimObject; class SAnimTrack; class SAnimOutlinerItem : public SMultiColumnTableRow> { public: /** Delegate to invoke to create a new column for this row */ DECLARE_DELEGATE_RetVal_ThreeParams(TSharedRef, FOnGenerateWidgetForColumn, const TSharedRef&, const FName&, const TSharedRef&); SLATE_BEGIN_ARGS(SAnimOutlinerItem) {} /** Delegate to invoke to create a new column for this row */ SLATE_EVENT(FOnGenerateWidgetForColumn, OnGenerateWidgetForColumn) /** Text to highlight when searching */ SLATE_ATTRIBUTE(FText, HighlightText) SLATE_END_ARGS() ~SAnimOutlinerItem(); void Construct(const FArguments& InArgs, const TSharedRef& InOwnerTableView, const TSharedRef& InTrack); /** SWidget interface */ virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override; virtual FVector2D ComputeDesiredSize(float LayoutScaleMultiplier) const override; virtual void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override; virtual void OnMouseLeave(const FPointerEvent& MouseEvent) override; /** SMultiColumnTableRow interface */ virtual TSharedRef GenerateWidgetForColumn(const FName& ColumnId) override; /** Get the track this item represents */ TSharedRef GetTrack() const { return Track.Pin().ToSharedRef(); } /** Add a reference to the specified track, keeping it alive until this row is destroyed */ void AddTrackAreaReference(const TSharedPtr& InTrackWidget); /** Get the text to highlight when searching */ TAttribute GetHighlightText() const { return HighlightText; } private: /** Get the label text for this item */ FText GetLabelText() const; /** Get the hover state for this item */ bool ShouldAppearHovered() const; private: /** The track that we represent */ TWeakPtr Track; /** Cached reference to a track lane that we relate to. This keeps the track lane alive (it's a weak widget) as long as we are in view. */ TSharedPtr TrackWidget; /** Delegate to invoke to create a new column for this row */ FOnGenerateWidgetForColumn OnGenerateWidgetForColumn; /** Text to highlight when searching */ TAttribute HighlightText; /** Keep an internal IsHovered flag*/ bool bHovered; };