// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleInterface.h" #include "IContentBrowserSingleton.h" /** * Content browser module */ class FContentBrowserModule : public IModuleInterface { public: /** */ DECLARE_MULTICAST_DELEGATE_TwoParams( FOnFilterChanged, const FARFilter& /*NewFilter*/, bool /*bIsPrimaryBrowser*/ ); /** */ DECLARE_MULTICAST_DELEGATE_TwoParams( FOnSearchBoxChanged, const FText& /*InSearchText*/, bool /*bIsPrimaryBrowser*/ ); /** */ DECLARE_MULTICAST_DELEGATE_TwoParams( FOnAssetSelectionChanged, const TArray& /*NewSelectedAssets*/, bool /*bIsPrimaryBrowser*/ ); /** */ DECLARE_MULTICAST_DELEGATE_OneParam( FOnSourcesViewChanged, bool /*bExpanded*/ ); /** */ DECLARE_MULTICAST_DELEGATE_OneParam( FOnAssetPathChanged, const FString& /*NewPath*/ ); /** * Called right after the plugin DLL has been loaded and the plugin object has been created */ virtual void StartupModule(); /** * Called before the plugin is unloaded, right before the plugin object is destroyed. */ virtual void ShutdownModule(); /** Gets the content browser singleton */ virtual IContentBrowserSingleton& Get() const; /** Delegates to be called to extend the content browser menus */ virtual TArray& GetAllAssetContextMenuExtenders() {return AssetContextMenuExtenders;} virtual TArray& GetAllPathViewContextMenuExtenders() {return PathViewContextMenuExtenders;} virtual TArray& GetAllCollectionListContextMenuExtenders() {return CollectionListContextMenuExtenders;} virtual TArray& GetAllCollectionViewContextMenuExtenders() {return CollectionViewContextMenuExtenders;} virtual TArray& GetAllAssetViewContextMenuExtenders() {return AssetViewContextMenuExtenders;} virtual TArray& GetAllAssetViewViewMenuExtenders() {return AssetViewViewMenuExtenders;} /** Delegate accessors */ FOnFilterChanged& GetOnFilterChanged() { return OnFilterChanged; } FOnSearchBoxChanged& GetOnSearchBoxChanged() { return OnSearchBoxChanged; } FOnAssetSelectionChanged& GetOnAssetSelectionChanged() { return OnAssetSelectionChanged; } FOnSourcesViewChanged& GetOnSourcesViewChanged() { return OnSourcesViewChanged; } FOnAssetPathChanged& GetOnAssetPathChanged() { return OnAssetPathChanged; } private: IContentBrowserSingleton* ContentBrowserSingleton; TSharedPtr ContentBrowserSpawner; /** All extender delegates for the content browser menus */ TArray AssetContextMenuExtenders; TArray PathViewContextMenuExtenders; TArray CollectionListContextMenuExtenders; TArray CollectionViewContextMenuExtenders; TArray AssetViewContextMenuExtenders; TArray AssetViewViewMenuExtenders; FOnFilterChanged OnFilterChanged; FOnSearchBoxChanged OnSearchBoxChanged; FOnAssetSelectionChanged OnAssetSelectionChanged; FOnSourcesViewChanged OnSourcesViewChanged; FOnAssetPathChanged OnAssetPathChanged; };