Files
UnrealEngineUWP/Engine/Source/Editor/StatsViewer/Private/StatsCustomColumn.h
Jaroslaw Palczynski ebce413232 UE4 Refactoring. Changed OVERRIDE and FINAL macros to keywords override and final.
[CL 2104397 by Jaroslaw Palczynski in Main branch]
2014-06-13 06:14:46 -04:00

54 lines
2.0 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "IPropertyTableCustomColumn.h"
/**
* A property table custom column used to display numerical data.
* Also supports FVector2D UStruct properties
* Will display totals in the column header if they are supplied in the
* TotalsMap
*/
class FStatsCustomColumn : public TSharedFromThis< FStatsCustomColumn >, public IPropertyTableCustomColumn
{
public:
/** Begin IPropertyTableCustomColumn interface */
virtual bool Supports( const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities ) const override;
virtual TSharedPtr< SWidget > CreateColumnLabel( const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities, const FName& Style ) const override;
virtual TSharedPtr< IPropertyTableCellPresenter > CreateCellPresenter( const TSharedRef< IPropertyTableCell >& Cell, const TSharedRef< IPropertyTableUtilities >& Utilities, const FName& Style ) const override;
/** End IPropertyTableCustomColumn interface */
/**
* Helper function to check if we can support displaying this property
* @param Property The property to check
* @returns true if this property is supported for display by this column type
*/
static bool SupportsProperty( UProperty* Property );
/**
* Helper function to get the text we would display for this property
* @param PropertyHandle The property handle to retrieve the text from
* returns a string representation of the properties data, or an empty string if the property is unsupported
*/
static FText GetPropertyAsText( const TSharedPtr< IPropertyHandle > PropertyHandle );
public:
/** The map we use to find our totals to display */
TMap<FString, FText> TotalsMap;
private:
/**
* Delegate to display the total text
* @param Column The column to get the total text for
*/
FText GetTotalText(TSharedRef< IPropertyTableColumn > Column) const;
private:
/** The total object, if any */
TWeakObjectPtr<UObject> TotalObject;
};