Files
UnrealEngineUWP/Engine/Source/Developer/MessageLog/Private/UserInterface/SMessageLogListing.h
Ben Marsh 4ba423868f Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3209340 on 2016/11/23 by Ben.Marsh

	Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.

	Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.

	  * Every header now includes everything it needs to compile.
	        * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
	        * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
	  * Every .cpp file includes its matching .h file first.
	        * This helps validate that each header is including everything it needs to compile.
	  * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
	        * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
	        * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
	  * No engine code explicitly includes a precompiled header any more.
	        * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
	        * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.

	Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.

[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00

167 lines
5.9 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Logging/TokenizedMessage.h"
#include "Layout/Visibility.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Input/Reply.h"
#include "Widgets/SWidget.h"
#include "Widgets/SCompoundWidget.h"
#include "Widgets/Views/STableViewBase.h"
#include "Widgets/Views/STableRow.h"
#include "MessageFilter.h"
#include "Presentation/MessageLogListingViewModel.h"
#include "Framework/Commands/UICommandList.h"
/**
* A message log listing, such as the Compiler Log, or the Map Check Log.
* Holds the log lines, and any extra widgets necessary.
*/
class SMessageLogListing : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SMessageLogListing)
{}
SLATE_END_ARGS()
SMessageLogListing();
~SMessageLogListing();
void Construct( const FArguments& InArgs, const TSharedRef< class IMessageLogListing >& InModelView );
/** Refreshes the log messages, reapplying any filtering */
void RefreshVisibility();
/** Used to execute the 'on clicked token' delegate */
void BroadcastMessageTokenClicked( TSharedPtr< class FTokenizedMessage > Message, const TSharedRef<class IMessageToken>& Token );
/** Used to execute a message's featured action (a token associated with the entire message) */
void BroadcastMessageDoubleClicked(TSharedPtr< class FTokenizedMessage > Message);
/** Gets a list of the selected messages */
const TArray< TSharedRef< class FTokenizedMessage > > GetSelectedMessages() const;
/** Set the message selection state */
void SelectMessage( const TSharedRef< class FTokenizedMessage >& Message, bool bSelected ) const;
/** Get the message selection state */
bool IsMessageSelected( const TSharedRef< class FTokenizedMessage >& Message ) const;
/** Scrolls the message into view */
void ScrollToMessage( const TSharedRef< class FTokenizedMessage >& Message ) const;
/** Clears the message selection */
void ClearSelectedMessages() const;
/** Inverts the message selection */
void InvertSelectedMessages() const;
/** Compiles the selected messages into a single string. */
FText GetSelectedMessagesAsText() const;
/** Compiles all the messages into a single string. */
FText GetAllMessagesAsText() const;
/** Gets the message log listing unique name */
const FName& GetName() const { return MessageLogListingViewModel->GetName(); }
/** Gets the message log listing label */
const FText& GetLabel() const { return MessageLogListingViewModel->GetLabel(); }
/** Gets the set of message filters used when displaying messages */
const TArray< TSharedRef< class FMessageFilter > >& GetMessageFilters() const { return MessageLogListingViewModel->GetMessageFilters(); }
/** Called when data is changed changed/updated in the model */
void OnChanged();
/** Called whenever the viewmodel selection changes */
void OnSelectionChanged();
/**
* Copies the selected messages to the clipboard
*/
void CopySelectedToClipboard() const;
/**
* Copies text (selected/all), optionally to the clipboard
*/
FText CopyText( bool bSelected, bool bClipboard ) const;
/** @return The UICommandList supported by the MessageLogView */
const TSharedRef< const FUICommandList > GetCommandList() const;
/**
* Called after a key is pressed when this widget has focus
*
* @param InKeyEvent Key event
*
* @return Returns whether the event was handled, along with other possible actions
*/
FReply OnKeyDown( const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent ) override;
/** Delegate supplying a label for the page-flipper widget */
FString GetPageText() const;
/** Delegate to display the previous page */
FReply OnClickedPrevPage();
/** Delegate to display the next page */
FReply OnClickedNextPage();
/** Delegate to get the display visibility of the show filter combobox */
EVisibility GetFilterMenuVisibility();
/** Generates the widgets for show filtering */
TSharedRef<ITableRow> MakeShowWidget(TSharedRef<FMessageFilter> Selection, const TSharedRef<STableViewBase>& OwnerTable);
/** Generates the menu content for filtering log content */
TSharedRef<SWidget> OnGetFilterMenuContent();
/** Delegate for enabling & disabling the page widget depending on the number of pages */
bool IsPageWidgetEnabled() const;
/** Delegate for showing & hiding the page widget depending on whether this log uses pages or not */
EVisibility GetPageWidgetVisibility() const;
/** Delegate for enabling & disabling the clear button depending on the number of messages */
bool IsClearWidgetEnabled() const;
/** Delegate for showing & hiding the clear button depending on whether this log uses pages or not */
EVisibility GetClearWidgetVisibility() const;
/** Delegate to generate the label for the page combobox */
FText OnGetPageMenuLabel() const;
/** Delegate to generate the menu content for the page combobox */
TSharedRef<SWidget> OnGetPageMenuContent() const;
/** Delegate called when a page is selected from the page menu */
void OnPageSelected(uint32 PageIndex);
/** Delegate for Clear button */
FReply OnClear();
private:
/** Makes the message log line widgets for populating the listing */
TSharedRef<ITableRow> MakeMessageLogListItemWidget( TSharedRef< class FTokenizedMessage > Message, const TSharedRef< STableViewBase >& OwnerTable );
/** Called when map check message line selection has changed */
void OnLineSelectionChanged( TSharedPtr< class FTokenizedMessage > Selection, ESelectInfo::Type SelectInfo );
private:
/** The list of commands with bound delegates for the message log */
const TSharedRef< FUICommandList > UICommandList;
/** Reference to the ViewModel which holds state info and has access to data */
TSharedPtr<class FMessageLogListingViewModel> MessageLogListingViewModel;
/** Whether the view is currently updating the viewmodel selection */
bool bUpdatingSelection;
/** The list view for showing all the message log lines */
TSharedPtr< SListView< TSharedRef< class FTokenizedMessage > > > MessageListView;
};