Files
UnrealEngineUWP/Engine/Source/Developer/SourceCodeAccess/Private/SourceCodeAccessModule.h
Ben Marsh f675eba13c Various fixes for using a non-default source code accessor in the editor.
* Fix incorrect path for tutorial dialog explaining how to install Visual Studio
* Tell the user that they need to restart when changing their source code accessor.
* On Windows, always check for the presence of Visual Studio 2017 or 2019 when determining whether the user can compile. This is distinct from whether the user has the chosen IDE available.

#rb none
#jira UE-69253

[CL 4951506 by Ben Marsh in 4.22 branch]
2019-02-08 15:46:23 -05:00

67 lines
2.0 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "ISourceCodeAccessModule.h"
#include "DefaultSourceCodeAccessor.h"
/**
* Implementation of ISourceCodeAccessModule.
*/
class FSourceCodeAccessModule
: public ISourceCodeAccessModule
{
public:
/** Default constructor. */
FSourceCodeAccessModule();
public:
// IModuleInterface interface
virtual void StartupModule() override;
virtual void ShutdownModule() override;
public:
// ISourceCodeAccessModule interface
virtual bool CanAccessSourceCode() const override;
virtual bool CanCompileSourceCode() const override;
virtual ISourceCodeAccessor& GetAccessor() const override;
virtual void SetAccessor(const FName& InName) override;
virtual FLaunchingCodeAccessor& OnLaunchingCodeAccessor() override;
virtual FDoneLaunchingCodeAccessor& OnDoneLaunchingCodeAccessor() override;
virtual FOpenFileFailed& OnOpenFileFailed() override;
private:
/** Handle when one of the modular features we are interested in is registered */
void HandleModularFeatureRegistered(const FName& Type, IModularFeature* ModularFeature);
/** Handle when one of the modular features we are interested in is unregistered */
void HandleModularFeatureUnregistered(const FName& Type, IModularFeature* ModularFeature);
/** Checks if a source code accessor with the given name is available */
bool IsSourceCodeAccessorAvailable(FName Name) const;
private:
/** Event delegate fired when launching code accessor. */
FLaunchingCodeAccessor LaunchingCodeAccessorDelegate;
/** Event delegate fired when done launching code accessor. */
FDoneLaunchingCodeAccessor DoneLaunchingCodeAccessorDelegate;
/** Event delegate fired when opening a file has failed. */
FOpenFileFailed OpenFileFailedDelegate;
/** The default accessor we will use if we have no IDE. */
FDefaultSourceCodeAccessor DefaultSourceCodeAccessor;
/** The current accessor. */
ISourceCodeAccessor* CurrentSourceCodeAccessor;
};