You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-OWNER: ryan.durand #ROBOMERGE-AUTHOR: ryan.durand #ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900 #ROBOMERGE-BOT: (v613-10869866) [CL 10870549 by ryan durand in Main branch]
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Types/ISlateMetaData.h"
|
|
#include "ITypedTableView.h"
|
|
|
|
class ITableViewMetadata : public ISlateMetaData
|
|
{
|
|
public:
|
|
SLATE_METADATA_TYPE(ITableViewMetadata, ISlateMetaData);
|
|
|
|
/** Returns all currently constructed rows that represent selected items */
|
|
virtual TArray<TSharedPtr<ITableRow>> GatherSelectedRows() const = 0;
|
|
};
|
|
|
|
template <typename ItemType>
|
|
class TTableViewMetadata : public ITableViewMetadata
|
|
{
|
|
public:
|
|
SLATE_METADATA_TYPE(TTableViewMetadata, ITableViewMetadata);
|
|
|
|
TTableViewMetadata(TSharedRef<ITypedTableView<ItemType>> InOwnerTableView)
|
|
: OwnerTableView(InOwnerTableView)
|
|
{}
|
|
|
|
virtual TArray<TSharedPtr<ITableRow>> GatherSelectedRows() const override
|
|
{
|
|
TArray<TSharedPtr<ITableRow>> SelectedRows;
|
|
if (TSharedPtr<ITypedTableView<ItemType>> PinnedTableView = OwnerTableView.Pin())
|
|
{
|
|
for (const ItemType& Item : PinnedTableView->GetSelectedItems())
|
|
{
|
|
if (TSharedPtr<ITableRow> TableRow = PinnedTableView->WidgetFromItem(Item))
|
|
{
|
|
SelectedRows.Add(TableRow);
|
|
}
|
|
}
|
|
}
|
|
return SelectedRows;
|
|
}
|
|
|
|
private:
|
|
TWeakPtr<ITypedTableView<ItemType>> OwnerTableView;
|
|
}; |