Files
UnrealEngineUWP/Engine/Source/Developer/AutomationWindow/Private/SAutomationExportMenu.h
2014-03-14 14:13:41 -04:00

141 lines
3.2 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
/*=============================================================================
SAutomationExportMenu.h: Declares the AutomationExortMenu class.
=============================================================================*/
class SAutomationExportMenu : public SCompoundWidget
{
public:
// Constructors
SAutomationExportMenu();
SLATE_BEGIN_ARGS( SAutomationExportMenu ){}
SLATE_END_ARGS()
/**
* Construct this widget. Called by the SNew() Slate macro.
*
* @param InArgs Declaration used by the SNew() macro to construct this widget
*/
void Construct( const FArguments& InArgs, const TSharedRef<SNotificationList>& InNotificationList );
private:
/**
* Have the reports been generated
*
* @return true if the reports have been generated
*/
bool AreReportsGenerated() const;
/**
* Build the menu items.
*
* @param In Name - menu item name
* @param InType - menu item type
*/
void BuildMenuItems( const FText& InName, EFileExportType::Type InType );
/**
* Create the menu widgets.
*/
void CreateMenu( );
/**
* Set all the available export options to checked.
*/
void EnableAvailableReports();
/**
* Get the export button tooltip
*
* @return true export report is ready
*/
FText GetExportButtonTooltip() const;
/**
* Get the export combo button tooltop
*
* @return true export report is ready
*/
FText GetExportComboButtonTooltip() const;
/**
* Get the test result summary from the manager.
*/
void GetResults( );
/**
* Export the report data when clicked.
*
* @return handled if the report has been handled
*/
FReply HandleExportDataClicked();
/**
* Called when the menu button is opened. Gets the results, and generates the widgets.
*/
void HandleMenuOpen();
/**
* Should the export checkboxes be enabled.
*
* @param CheckType - the menu item type
* @return - True if the checkbox is enabled
*/
bool IsCheckBoxEnabled( EFileExportType::Type CheckType ) const;
/**
* Is an export report ready
*
* @return true export report is ready
*/
bool IsExportReady() const;
/**
* Check box has changed, update the export data mask
*
* @param The new state, checked or unchecked
* @param The type of checkbox set
*/
void OnDisplayCheckStateChanged( ESlateCheckBoxState::Type InNewState, EFileExportType::Type CheckType );
/**
* Gets the display state to send to a display filter check box
*
* @param - the type of checkbox
* @return - The desired checkbox state
*/
ESlateCheckBoxState::Type OnGetDisplayCheckState( EFileExportType::Type CheckType ) const;
/**
* Add a notification when the file is exported
*
* @return true export report is ready
*/
FReply SpawnNotification();
private:
/** The export button */
TSharedPtr< SButton > ExportButton;
/** The combo button */
TSharedPtr< SComboButton > ExportMenuComboButton;
/** Holds the file export mask for deciding which reports to output e.g. only errors */
uint32 FileExportTypeMask;
// Box to hold the menu items
TSharedPtr< SVerticalBox > MenuHolderBox;
/** The list of active system messages */
TSharedPtr< SNotificationList > NotificationListPtr;
/** Holds the result mask generated by the report manager */
uint32 ResultMask;
};