Files
UnrealEngineUWP/Engine/Source/Developer/SlateReflector/Private/WidgetSnapshotService.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

41 lines
1.3 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Misc/Guid.h"
#include "Helpers/MessageEndpoint.h"
struct FWidgetSnapshotRequest;
struct FWidgetSnapshotResponse;
/**
* Implements the service for handling remote widget snapshots.
*/
class FWidgetSnapshotService
{
public:
DECLARE_DELEGATE_OneParam(FOnWidgetSnapshotResponse, const TArray<uint8>& /*InSnapshotData*/);
FWidgetSnapshotService();
/** Request a snapshot from the given instance. The given delegate will be called when the response comes in */
FGuid RequestSnapshot(const FGuid& InRemoteInstanceId, const FOnWidgetSnapshotResponse& OnResponse);
/** Abort a request using the GUID previously obtained via a call to RequestSnapshot */
void AbortSnapshotRequest(const FGuid& InSnapshotRequestId);
private:
/** Handles FWidgetSnapshotRequest messages */
void HandleWidgetSnapshotRequestMessage(const FWidgetSnapshotRequest& Message, const IMessageContextRef& Context);
/** Handles FWidgetSnapshotResponse messages */
void HandleWidgetSnapshotResponseMessage(const FWidgetSnapshotResponse& Message, const IMessageContextRef& Context);
/** Holds the message endpoint */
FMessageEndpointPtr MessageEndpoint;
/** Handlers awaiting their resultant snapshot data */
TMap<FGuid, FOnWidgetSnapshotResponse> PendingSnapshotResponseHandlers;
};