Files
UnrealEngineUWP/Engine/Source/Editor/AddContentDialog/Private/ContentSourceProviders/FeaturePack/FeaturePackContentSourceProvider.h
Steve Robb 0756ef15b9 Delegate comparisons deprecated, lots of other associated code deprecated, and lots of warning fixups:
* Multicast delegate Add* calls now return FDelegateHandles, and Remove* calls are now all deprecated, except for a new Remove function which takes a FDelegateHandle.
* New FConsoleManager::RegisterConsoleVariableSink_Handle and UnregisterConsoleVariableSink_Handle functions which work in terms of FConsoleVariableSinkHandle.
* Timer calls which don't take FTimerHandles are deprecated.
* FTicker::AddTicker now returns an FDelegateHandle and is removed by an overloaded Remove function.
* DEFINE_ONLINE_DELEGATE* macros now define _Handle variants of the Add/Remove functions which return/take handles.
* Various other handle-based registration changes.
* Some unity build fixes.
* Some simplification of delegate code.
* Fixes for lots of existing code to use handle-based registration and unregistration.

#codereview robert.manuszewski

[CL 2400883 by Steve Robb in Main branch]
2015-01-08 09:29:27 -05:00

44 lines
1.6 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "DirectoryWatcherModule.h"
#pragma once
/** 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 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;
FDelegateHandle DirectoryChangedDelegateHandle;
};