UContentBrowserDataSource

A common implementation of a "do nothing" data source for the Content Browser.

Unreal Engine C++ API Reference > Editor > ContentBrowserData

Inheritance Hierarchy

References

   
Module ContentBrowserData
Header /Engine/Source/Editor/ContentBrowserData/Public/ContentBrowserDataSource.h
Include #include "ContentBrowserDataSource.h"

Syntax

class UContentBrowserDataSource :  
    public [UObject](API\Runtime\CoreUObject\UObject\UObject),  
    public [IModularFeature](API\Runtime\Core\Features\IModularFeature)  

Remarks

A common implementation of a "do nothing" data source for the Content Browser. You should derive from this type to create new data sources for the Content Browser, overriding any required functionality and validation logic.

Data sources create and operate on FContentBrowserItemData instances that represent the folders and files within each data source. FContentBrowserItemData itself is a concrete type, so extensibility is handled via the IContentBrowserItemDataPayload interface, which can be used to store any data source defined payload data that is required to operate on the underlying thing that the item represents.

This is the only API you need to implement to create a data source, as each FContentBrowserItemData instance knows which data source owns it, and uses that information to pass itself back into the correct data source instance when asked to perform actions or validation. In that sense you can think of this like a C API, where the data source returns an opaque object that is later passed back into the data source functions so that they can interpret the opaque object and provide functionality for it.

Variables

Type Name Description
FContentBrowser... RootPathVirtualTree Tree of virtual paths that ends with internal roots. Used for enumeration and conversion of paths.

Functions

Type Name Description
bool AppendItemReference ( const FContentBrowserItemData& InI..., FString& InOutStr ) Attempt to append any path references for the given item to the given string.
void BuildRootPathVirtualTree () Rebuilds the tree of virtual paths that ends with internal roots
bool BulkCopyItems ( TArrayView< const FContentBrowserIt..., const FName InDestPath ) Attempt to copy the given items to the given virtual path.
bool BulkDeleteItems ( TArrayView< const FContentBrowserIt... ) Attempt to delete the given items.
bool BulkDuplicateItems ( TArrayView< const FContentBrowserIt..., TArray< FContentBrowserItemData >&... ) Attempt to synchronously duplicate the given items.
bool BulkEditItems ( TArrayView< const FContentBrowserIt... ) Attempt to open the given item for editing.
bool BulkMoveItems ( TArrayView< const FContentBrowserIt..., const FName InDestPath ) Attempt to move the given items to the given virtual path.
bool BulkPreviewItems ( TArrayView< const FContentBrowserIt... ) Attempt to preview the given items.
bool BulkPrivatizeItems ( TArrayView< const FContentBrowserIt... ) Attempt to mark the given items as private (NotExternallyReferenceable)
bool BulkSaveItems ( TArrayView< const FContentBrowserIt..., const EContentBrowserItemSaveFlags ... ) Attempt to save the given items.
bool BulkViewItems ( TArrayView< const FContentBrowserIt... ) Attempt to open the given items for read-only viewing.
bool CanCopyItem ( const FContentBrowserItemData& InI..., const FName InDestPath, FText* OutErrorMsg ) Query whether the given item is can be copied, optionally providing error information if it cannot.
bool CanCreateFolder ( const FName InPath, FText* OutErrorMsg ) Query whether a folder can be created at the given virtual path, optionally providing error information if it cannot.
bool CanDeleteItem ( const FContentBrowserItemData& InI..., FText* OutErrorMsg ) Query whether the given item is can be deleted, optionally providing error information if it cannot.
bool CanDuplicateItem ( const FContentBrowserItemData& InI..., FText* OutErrorMsg ) Query whether the given item is can be duplicated, optionally providing error information if it cannot.
bool CanEditItem ( const FContentBrowserItemData& InI..., FText* OutErrorMsg ) Query whether the given item is can be edited, optionally providing error information if it cannot.
bool CanMoveItem ( const FContentBrowserItemData& InI..., const FName InDestPath, FText* OutErrorMsg ) Query whether the given item is can be moved, optionally providing error information if it cannot.
bool CanPreviewItem ( const FContentBrowserItemData& InI..., FText* OutErrorMsg ) Query whether the given item is can be previewed, optionally providing error information if it cannot.
bool CanPrivatizeItem ( const FContentBrowserItemData& InI..., FText* OutErrorMsg ) Query whether the given item can be privatized, optionally providing error information if it cannot.
bool CanRenameItem ( const FContentBrowserItemData& InI..., const FString* InNewName, FText* OutErrorMsg ) Query whether the given item is can be renamed, optionally providing error information if it cannot.
bool CanSaveItem ( const FContentBrowserItemData& InI..., const EContentBrowserItemSaveFlags ..., FText* OutErrorMsg ) Query whether the given item is can be saved, optionally providing error information if it cannot.
bool CanViewItem ( const FContentBrowserItemData& InI..., FText* OutErrorMsg ) Query whether the given item is can be viewed (a read-only asset editor), optionally providing error information if it cannot.
void ClearCachedFilterData ( const FContentBrowserDataFilterCach... ) Tell the data source to remove the cached data for the filter compilation for this specific owner.
void CompileFilter ( const FName InPath, const FContentBrowserDataFilter& I..., FContentBrowserDataCompiledFilter&... ) Given a path and a data filter, produce an optimized filter that can be used to efficiently enumerate items that match it, and also query whether an item would pass it.
bool ConvertItemForFilter ( FContentBrowserItemData& Item, const FContentBrowserDataCompiledFi... ) Let the compiled filter decide the payload and the type of the item Some Compiled filter might change the type/payload of the item.
bool CopyItem ( const FContentBrowserItemData& InI..., const FName InDestPath ) Attempt to copy the given item to the given virtual path.
TSharedPtr< ... CreateCustomDragOperation ( TArrayView< const FContentBrowserIt... ) Called to provide custom drag and drop handling when starting a drag event.
bool CreateFolder ( const FName InPath, FContentBrowserItemDataTemporaryCon... ) Attempt to begin the process of asynchronously creating a folder at the given virtual path, populating a temporary item that can be finalized or canceled by the user.
FContentBrow... CreateVirtualFolderItem ( const FName InFolderPath ) Creates item data for a fully virtual folder
bool DeleteItem ( const FContentBrowserItemData& InI... ) Attempt to delete the given item.
bool DoesItemPassFilter ( const FContentBrowserItemData& InI..., const FContentBrowserDataCompiledFi... ) Query whether the given item passes the given compiled filter.
bool DuplicateItem ( const FContentBrowserItemData& InI..., FContentBrowserItemDataTemporaryCon... ) Attempt to begin the process of asynchronously duplicating the given item, populating a temporary item that can be finalized or canceled by the user.
bool EditItem ( const FContentBrowserItemData& InI... ) Attempt to open the given item for editing.
void EnumerateItemsAtPath ( const FName InPath, const EContentBrowserItemTypeFilter..., TFunctionRef< bool(FContentBrowserI... ) Enumerate items that have the given virtual path, optionally filtering by type, and invoking the callback for each matching item.
bool EnumerateItemsAtPaths ( const TArrayView< FContentBrowserIt..., const EContentBrowserItemTypeFilter..., TFunctionRef< bool(FContentBrowserI... ) Enumerate the items (folders and/or files) that exist at the given content browser paths.
bool EnumerateItemsForObjects ( const TArrayView< UObject* > I..., TFunctionRef< bool(FContentBrowserI... ) Enumerate the items (files) that exist for the given objects.
void EnumerateItemsMatchingFilter ( const FContentBrowserDataCompiledFi..., TFunctionRef< bool(FContentBrowserI... ) Enumerate items that match the given compiled filter, invoking the callback for each matching item.
TArray< FCon... GetAliasesForPath ( const FSoftObjectPath& InInternalP... ) Get a list of other paths that the data source may be using to represent a specific path
bool GetItemAttribute ( const FContentBrowserItemData& InI..., const bool InIncludeMetaData, const FName InAttributeKey, FContentBrowserItemDataAttributeVal... ) Query the value of the given attribute on the given item.
bool GetItemAttributes ( const FContentBrowserItemData& InI..., const bool InIncludeMetaData, FContentBrowserItemDataAttributeVal... ) Query the values of all attributes on the given item.
bool GetItemPhysicalPath ( const FContentBrowserItemData& InI..., FString& OutDiskPath ) Query the physical (on-disk) path of the given item.
FName GetModularFeatureTypeName () Get the name used when registering data source modular feature instances for use with the Content Browser Data Subsystem.
const FConte... GetRootPathVirtualTree ()  
bool HandleDragDropOnItem ( const FContentBrowserItemData& InI..., const FDragDropEvent& InDragDropEv... ) Called to provide custom drag and drop handling when a drag event is dropped on an item.
bool HandleDragEnterItem ( const FContentBrowserItemData& InI..., const FDragDropEvent& InDragDropEv... ) Called to provide custom drag and drop handling when a drag event enters an item, such as performing validation and reporting error information.
bool HandleDragLeaveItem ( const FContentBrowserItemData& InI..., const FDragDropEvent& InDragDropEv... ) Called to provide custom drag and drop handling when a drag event leaves an item, such as clearing any error information set during earlier validation.
bool HandleDragOverItem ( const FContentBrowserItemData& InI..., const FDragDropEvent& InDragDropEv... ) Called to provide custom drag and drop handling while a drag event is over an item, such as performing validation and reporting error information.
void Initialize ( const bool InAutoRegister ) Initialize this data source instance, optionally registering it once the initialization has finished (This function is non-virtual because its signature may change on derived types, and so should be called directly on an instance of the correct type.
bool IsDiscoveringItems ( FText* OutStatus ) Query whether this data source instance is currently discovering content, and retrieve an optional status message that can be shown in the UI.
bool IsFolderVisible ( const FName InPath, const EContentBrowserIsFolderVisibl... ) Query whether the given virtual folder should be visible in the UI.
bool IsInitialized () True if this data source is currently initialized.
bool IsItemDirty ( const FContentBrowserItemData& InI... ) Query whether the given item is considered dirty (ie, has unsaved changes).
bool IsVirtualPathUnderMountRoot ( const FName InPath ) Test whether the given virtual path is under the virtual mount root that was passed to Initialize.
bool Legacy_TryConvertAssetDataToVirtualPath ( const FAssetData& InAssetData, const bool InUseFolderPaths, FName& OutPath ) Attempt to convert the given asset data to a virtual path associated with this data source.
bool Legacy_TryConvertPackagePathToVirtualPath ( const FName InPackagePath, FName& OutPath ) Attempt to convert the given package path to a virtual path associated with this data source.
bool Legacy_TryGetAssetData ( const FContentBrowserItemData& InI..., FAssetData& OutAssetData ) Attempt to retrieve the asset data associated with the given item.
bool Legacy_TryGetPackagePath ( const FContentBrowserItemData& InI..., FName& OutPackagePath ) Attempt to retrieve the package path associated with the given item.
bool MoveItem ( const FContentBrowserItemData& InI..., const FName InDestPath ) Attempt to move the given item to the given virtual path.
void NotifyItemDataRefreshed () Notify a wholesale item data update, for data sources that can't provide delta-updates.
bool PreviewItem ( const FContentBrowserItemData& InI... ) Attempt to preview the given item.
bool PrioritizeSearchPath ( const FName InPath ) If possible, attempt to prioritize content discovery for the given virtual path.
bool PrivatizeItem ( const FContentBrowserItemData& InI... ) Attempt to mark the given item as private (NotExternallyReferenceable).
void QueueItemDataUpdate ( FContentBrowserItemDataUpdate&& In... ) Queue an incremental item data update, for data sources that can provide delta-updates.
void RefreshVirtualPathTreeIfNeeded () Call after a change that could affect rules of virtual path generation.
void RegisterDataSource () Register this data source instance for use with the Content Browser Data Subsystem.
void RemoveUnusedCachedFilterData ( const FContentBrowserDataFilterCach..., TArrayView< const FName > InVirtual..., const FContentBrowserDataFilter& D... ) Tell the data source to remove any cached data for the filter compilation that might not be needed any more.
bool RenameItem ( const FContentBrowserItemData& InI..., const FString& InNewName, FContentBrowserItemData& OutNewIte... ) Attempt to rename the given item.
void RootPathAdded ( const FStringView InInternalPath ) Adds internal root path to virtual path tree
void RootPathRemoved ( const FStringView InInternalPath ) Removes internal root path from virtual path tree
bool SaveItem ( const FContentBrowserItemData& InI..., const EContentBrowserItemSaveFlags ... ) Attempt to save the given item.
void SetDataSink ( IContentBrowserItemDataSink* I... ) Set the data sink that can be used to communicate with the Content Browser Data Subsystem.
void SetVirtualPathTreeNeedsRebuild () Sets a flag to force rebuild of virtual path tree with next call to RefreshVirtualPathTreeIfNeeded()
void Shutdown () Shutdown this data source instance.
void Tick ( const float InDeltaTime ) Tick this data source instance.
bool TryConvertInternalPathToVirtual ( const FName InInternalPath, FName& OutPath ) Convert an internal path to its virtualized form, based on the mount root set on this data source.
EContentBrow... TryConvertVirtualPath ( const FName InPath, FName& OutPath ) Attempt to convert the given virtual path
EContentBrow... TryConvertVirtualPath ( const FStringView InPath, FName& OutPath ) Attempt to convert the given virtual path
EContentBrow... TryConvertVirtualPath ( const FStringView InPath, FString& OutPath ) Attempt to convert the given virtual path
EContentBrow... TryConvertVirtualPath ( const FStringView InPath, FStringBuilderBase& OutPath ) Attempt to convert the given virtual path
bool TryConvertVirtualPathToInternal ( const FName InPath, FName& OutInternalPath ) Convert a virtualized path to its internal form, based on the mount root set on this data source.
bool TryGetCollectionId ( const FContentBrowserItemData& InI..., FSoftObjectPath& OutCollectionId ) Attempt to retrieve the identifier that should be used when storing a reference to the given item within a collection.
void UnregisterDataSource () Unregister this data source instance from the Content Browser Data Subsystem.
bool UpdateThumbnail ( const FContentBrowserItemData& InI..., FAssetThumbnail& InThumbnail ) Attempt to update the thumbnail associated with the given item.
bool ViewItem ( const FContentBrowserItemData& InI... ) Attempt to open the given item for read-only viewing.

Overridden from UObject

Type Name Description
void BeginDestroy () Called before destroying the object.

Deprecated Functions

Type Name Description
TArray< FCon... GetAliasesForPath ( FName InInternalPath ) FNames containing full asset paths are deprecated. Use FSoftObjectPath instead.
bool TryGetCollectionId ( const FContentBrowserItemData& InI..., FName& OutCollectionId ) FNames containing full object paths are deprecated. Use FSoftObjectPath instead.

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library