Files
UnrealEngineUWP/Engine/Source/Developer/DeviceManager/Private/Models/DeviceManagerModel.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

71 lines
1.7 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Interfaces/ITargetDeviceService.h"
class FDeviceManagerModel;
/** Type definition for shared pointers to instances of FDeviceManagerModel. */
typedef TSharedPtr<class FDeviceManagerModel> FDeviceManagerModelPtr;
/** Type definition for shared references to instances of FDeviceManagerModel. */
typedef TSharedRef<class FDeviceManagerModel> FDeviceManagerModelRef;
/**
* Implements a view model for the messaging debugger.
*/
class FDeviceManagerModel
{
public:
/**
* Gets the device service that is currently selected in the device browser.
*
* @return The selected device service.
*/
ITargetDeviceServicePtr GetSelectedDeviceService( ) const
{
return SelectedDeviceService;
}
/**
* Selects the specified device service (or none if nullptr).
*
* @param DeviceService The device service to select.
*/
void SelectDeviceService( const ITargetDeviceServicePtr& DeviceService )
{
if (SelectedDeviceService != DeviceService)
{
SelectedDeviceService = DeviceService;
SelectedDeviceServiceChangedEvent.Broadcast();
}
}
public:
/**
* Gets an event delegate that is invoked when the selected device service has changed.
*
* @return The event delegate.
*/
DECLARE_EVENT(FDeviceManagerModel, FOnSelectedDeviceServiceChanged);
FOnSelectedDeviceServiceChanged& OnSelectedDeviceServiceChanged( )
{
return SelectedDeviceServiceChangedEvent;
}
private:
// Holds the currently selected target device service.
ITargetDeviceServicePtr SelectedDeviceService;
private:
// Holds an event delegate that is invoked when the selected message has changed.
FOnSelectedDeviceServiceChanged SelectedDeviceServiceChangedEvent;
};