Files
UnrealEngineUWP/Engine/Source/Editor/AddContentDialog/Private/ContentSourceProviders/FeaturePack/FeaturePackContentSourceProvider.h
Ben Marsh 7598af0532 Update copyright notices to 2019.
#rb none
#lockdown Nick.Penwarden

[CL 4662404 by Ben Marsh in Main branch]
2018-12-14 13:41:00 -05:00

60 lines
2.1 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "IContentSource.h"
#include "IContentSourceProvider.h"
#include "IDirectoryWatcher.h"
/** A content source provider for available content upacks. */
class FFeaturePackContentSourceProvider : public IContentSourceProvider
{
public:
FFeaturePackContentSourceProvider();
virtual const TArray<TSharedRef<IContentSource>> GetContentSources() override;
virtual void SetContentSourcesChanged(FOnContentSourcesChanged OnContentSourcesChangedIn) override;
virtual ~FFeaturePackContentSourceProvider();
private:
/** Starts the directory watcher for the feature pack directory. */
void StartUpDirectoryWatcher();
/** Shuts down the directory watcher for the feature pack directory. */
void ShutDownDirectoryWatcher();
/** Delegate to handle whenever the feature pack directory changes on disk. */
void OnFeaturePackDirectoryChanged( const TArray<FFileChangeData>& FileChanges );
/** Rebuilds the feature pack array and calls the change notification delegate. */
void RefreshFeaturePacks();
/** The path on disk to the directory containing the feature packs. */
FString FeaturePackPath;
/** The path on disk to the directory containing the enterprise feature packs. */
FString EnterpriseFeaturePackPath;
/** The path on disk to the directory containing the templates folder. */
FString TemplatePath;
/** The path on disk to the directory containing the enterprise templates folder. */
FString EnterpriseTemplatePath;
/** The delegate which gets called when the feature pack directory changes. This reference
is kept so that it can be unregistered correctly. */
IDirectoryWatcher::FDirectoryChanged DirectoryChangedDelegate;
/** A delegate which gets called whenever the array of content sources changes. */
FOnContentSourcesChanged OnContentSourcesChanged;
/** An array of the available content sources. */
TArray<TSharedRef<IContentSource>> ContentSources;
/** An array of the available Enterprise content sources. */
TArray<TSharedRef<IContentSource>> EnterpiseContentSources;
FDelegateHandle DirectoryChangedDelegateHandle;
};