Navigation
API > API/Editor > API/Editor/ContentBrowserData
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.
| Name | UContentBrowserDataSource |
| Type | class |
| Header File | /Engine/Source/Editor/ContentBrowserData/Public/ContentBrowserDataSource.h |
| Include Path | #include "ContentBrowserDataSource.h" |
Syntax
UCLASS (Abstract, Transient)
class UContentBrowserDataSource :
public UObject ,
public IModularFeature
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UContentBrowserDataSource
Derived Classes
- UContentBrowserAliasDataSource
- UContentBrowserAssetDataSource
- UContentBrowserClassDataSource
- UContentBrowserFileDataSource
Structs
| Name | Remarks |
|---|---|
| FVirtualPathTreeRulesCachedState |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsInitialized | bool | True if this data source is currently initialized. | ContentBrowserDataSource.h | |
| bVirtualPathTreeNeedsRebuild | bool | True if this data source's virtual path tree needs rebuilding. | ContentBrowserDataSource.h | |
| DataSink | IContentBrowserItemDataSink * | The data sink that can be used to communicate with the Content Browser Data Subsystem. | ContentBrowserDataSource.h | |
| VirtualPathTreeRulesCachedState | FVirtualPathTreeRulesCachedState | Cached state of rules used to detect when virtual path tree needs rebuilding | ContentBrowserDataSource.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool AppendItemObjectPath
(
const FContentBrowserItemData& InItem, |
Attempt to append any object path for the given item to the given string. | ContentBrowserDataSource.h | |
virtual bool AppendItemPackageName
(
const FContentBrowserItemData& InItem, |
Attempt to append any package name for the given item to the given string. | ContentBrowserDataSource.h | |
virtual bool AppendItemReference
(
const FContentBrowserItemData& InItem, |
Attempt to append any path references for the given item to the given string. | ContentBrowserDataSource.h | |
virtual void BuildRootPathVirtualTree() |
Rebuilds the tree of virtual paths that ends with internal roots | ContentBrowserDataSource.h | |
virtual bool BulkCopyItems
(
TArrayView< const FContentBrowserItemData > InItems, |
Attempt to copy the given items to the given virtual path. | ContentBrowserDataSource.h | |
virtual bool BulkDeleteItems
(
TArrayView< const FContentBrowserItemData > InItems |
Attempt to delete the given items. | ContentBrowserDataSource.h | |
virtual bool BulkDuplicateItems
(
TArrayView< const FContentBrowserItemData > InItems, |
Attempt to synchronously duplicate the given items. | ContentBrowserDataSource.h | |
virtual bool BulkEditItems
(
TArrayView< const FContentBrowserItemData > InItems |
Attempt to open the given item for editing. | ContentBrowserDataSource.h | |
virtual bool BulkMoveItems
(
TArrayView< const FContentBrowserItemData > InItems, |
Attempt to move the given items to the given virtual path. | ContentBrowserDataSource.h | |
virtual bool BulkPreviewItems
(
TArrayView< const FContentBrowserItemData > InItems |
Attempt to preview the given items. | ContentBrowserDataSource.h | |
virtual bool BulkPrivatizeItems
(
TArrayView< const FContentBrowserItemData > InItems, |
Attempt to mark the given items as InAssetAccessSpecifier | ContentBrowserDataSource.h | |
virtual bool BulkSaveItems
(
TArrayView< const FContentBrowserItemData > InItems, |
Attempt to save the given items. | ContentBrowserDataSource.h | |
virtual bool BulkViewItems
(
TArrayView< const FContentBrowserItemData > InItems |
Attempt to open the given items for read-only viewing. | ContentBrowserDataSource.h | |
virtual bool CanCopyItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be copied, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
| Query whether a folder can be created at the given virtual path, optionally providing error information if it cannot. | ContentBrowserDataSource.h | ||
virtual bool CanDeleteItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be deleted, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanDuplicateItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be duplicated, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanEditItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be edited, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanMoveItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be moved, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanPreviewItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be previewed, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanPrivatizeItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item can be privatized, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanRenameItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be renamed, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanSaveItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be saved, optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual bool CanViewItem
(
const FContentBrowserItemData& InItem, |
Query whether the given item is can be viewed (a read-only asset editor), optionally providing error information if it cannot. | ContentBrowserDataSource.h | |
virtual void ClearCachedFilterData
(
const FContentBrowserDataFilterCacheIDOwner& IDOwner |
Tell the data source to remove the cached data for the filter compilation for this specific owner. | ContentBrowserDataSource.h | |
virtual void CompileFilter
(
const FName InPath, |
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. | ContentBrowserDataSource.h | |
virtual bool ConvertItemForFilter
(
FContentBrowserItemData& Item, |
Let the compiled filter decide the payload and the type of the item Some Compiled filter might change the type/payload of the item. | ContentBrowserDataSource.h | |
virtual bool CopyItem
(
const FContentBrowserItemData& InItem, |
Attempt to copy the given item to the given virtual path. | ContentBrowserDataSource.h | |
virtual TSharedPtr< FDragDropOperation > CreateCustomDragOperation
(
TArrayView< const FContentBrowserItemData > InItems |
Called to provide custom drag and drop handling when starting a drag event. | ContentBrowserDataSource.h | |
virtual bool CreateFolder
(
const FName InPath, |
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. | ContentBrowserDataSource.h | |
FContentBrowserItemData CreateVirtualFolderItem
(
const FName InFolderPath |
Creates item data for a fully virtual folder. | ContentBrowserDataSource.h | |
virtual bool DeleteItem
(
const FContentBrowserItemData& InItem |
Attempt to delete the given item. | ContentBrowserDataSource.h | |
virtual bool DoesItemPassFilter
(
const FContentBrowserItemData& InItem, |
Query whether the given item passes the given compiled filter. | ContentBrowserDataSource.h | |
virtual bool DuplicateItem
(
const FContentBrowserItemData& InItem, |
Attempt to begin the process of asynchronously duplicating the given item, populating a temporary item that can be finalized or canceled by the user. | ContentBrowserDataSource.h | |
virtual bool EditItem
(
const FContentBrowserItemData& InItem |
Attempt to open the given item for editing. | ContentBrowserDataSource.h | |
virtual void EnumerateItemsAtPath
(
const FName InPath, |
ContentBrowserDataSource.h | ||
virtual void EnumerateItemsAtPath
(
const FName InPath, |
Enumerate items that have the given virtual path, optionally filtering by type, and invoking the callback for each matching item. | ContentBrowserDataSource.h | |
virtual bool EnumerateItemsAtPaths
(
const TArrayView< FContentBrowserItemPath > InPaths, |
Enumerate the items (folders and/or files) that exist at the given content browser paths. | ContentBrowserDataSource.h | |
virtual bool EnumerateItemsForObjects
(
const TArrayView< UObject* > InObjects, |
Enumerate the items (files) that exist for the given objects. | ContentBrowserDataSource.h | |
virtual void EnumerateItemsMatchingFilter
(
const FContentBrowserDataCompiledFilter& InFilter, |
ContentBrowserDataSource.h | ||
virtual void EnumerateItemsMatchingFilter
(
const FContentBrowserDataCompiledFilter& InFilter, |
Enumerate items that match the given compiled filter, invoking the callback for each matching item. | ContentBrowserDataSource.h | |
TArray< FContentBrowserItemPath > GetAliasesForPath
(
FName InInternalPath |
ContentBrowserDataSource.h | ||
virtual TArray< FContentBrowserItemPath > GetAliasesForPath
(
const FSoftObjectPath& InInternalPath |
Get a list of other paths that the data source may be using to represent a specific path | ContentBrowserDataSource.h | |
virtual bool GetItemAttribute
(
const FContentBrowserItemData& InItem, |
Query the value of the given attribute on the given item. | ContentBrowserDataSource.h | |
virtual bool GetItemAttributes
(
const FContentBrowserItemData& InItem, |
Query the values of all attributes on the given item. | ContentBrowserDataSource.h | |
virtual bool GetItemPhysicalPath
(
const FContentBrowserItemData& InItem, |
Query the physical (on-disk) path of the given item. | ContentBrowserDataSource.h | |
const FContentBrowserVirtualPathTree & GetRootPathVirtualTree() |
ContentBrowserDataSource.h | ||
virtual bool HandleDragDropOnItem
(
const FContentBrowserItemData& InItem, |
Called to provide custom drag and drop handling when a drag event is dropped on an item. | ContentBrowserDataSource.h | |
virtual bool HandleDragEnterItem
(
const FContentBrowserItemData& InItem, |
Called to provide custom drag and drop handling when a drag event enters an item, such as performing validation and reporting error information. | ContentBrowserDataSource.h | |
virtual bool HandleDragLeaveItem
(
const FContentBrowserItemData& InItem, |
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. | ContentBrowserDataSource.h | |
virtual bool HandleDragOverItem
(
const FContentBrowserItemData& InItem, |
Called to provide custom drag and drop handling while a drag event is over an item, such as performing validation and reporting error information. | ContentBrowserDataSource.h | |
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. | ContentBrowserDataSource.h | |
virtual 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. | ContentBrowserDataSource.h | |
virtual bool IsFolderVisible
(
const FName Path, |
Query whether the given virtual folder should be visible in the UI. | ContentBrowserDataSource.h | |
bool IsInitialized () |
True if this data source is currently initialized. | ContentBrowserDataSource.h | |
virtual bool IsItemDirty
(
const FContentBrowserItemData& InItem |
Query whether the given item is considered dirty (ie, has unsaved changes). | ContentBrowserDataSource.h | |
bool IsVirtualPathUnderMountRoot
(
const FName InPath |
Test whether the given virtual path is under the virtual mount root that was passed to Initialize. | ContentBrowserDataSource.h | |
virtual bool Legacy_TryConvertAssetDataToVirtualPath
(
const FAssetData& InAssetData, |
Attempt to convert the given asset data to a virtual path associated with this data source. | ContentBrowserDataSource.h | |
virtual bool Legacy_TryConvertPackagePathToVirtualPath
(
const FName InPackagePath, |
Attempt to convert the given package path to a virtual path associated with this data source. | ContentBrowserDataSource.h | |
virtual bool Legacy_TryGetAssetData
(
const FContentBrowserItemData& InItem, |
Attempt to retrieve the asset data associated with the given item. | ContentBrowserDataSource.h | |
virtual bool Legacy_TryGetPackagePath
(
const FContentBrowserItemData& InItem, |
Attempt to retrieve the package path associated with the given item. | ContentBrowserDataSource.h | |
virtual bool MoveItem
(
const FContentBrowserItemData& InItem, |
Attempt to move the given item to the given virtual path. | ContentBrowserDataSource.h | |
virtual bool PreviewItem
(
const FContentBrowserItemData& InItem |
Attempt to preview the given item. | ContentBrowserDataSource.h | |
virtual bool PrioritizeSearchPath
(
const FName InPath |
If possible, attempt to prioritize content discovery for the given virtual path. | ContentBrowserDataSource.h | |
virtual bool PrivatizeItem
(
const FContentBrowserItemData& InItem, |
Attempt to mark the given item as private (NotExternallyReferenceable). | ContentBrowserDataSource.h | |
void RefreshVirtualPathTreeIfNeeded() |
Call after a change that could affect rules of virtual path generation. | ContentBrowserDataSource.h | |
void RegisterDataSource () |
Register this data source instance for use with the Content Browser Data Subsystem. | ContentBrowserDataSource.h | |
virtual void RemoveUnusedCachedFilterData
(
const FContentBrowserDataFilterCacheIDOwner& IDOwner, |
Tell the data source to remove any cached data for the filter compilation that might not be needed any more. | ContentBrowserDataSource.h | |
virtual bool RenameItem
(
const FContentBrowserItemData& InItem, |
Attempt to rename the given item. | ContentBrowserDataSource.h | |
virtual bool SaveItem
(
const FContentBrowserItemData& InItem, |
Attempt to save the given item. | ContentBrowserDataSource.h | |
void SetDataSink
(
IContentBrowserItemDataSink* InDataSink |
Set the data sink that can be used to communicate with the Content Browser Data Subsystem. | ContentBrowserDataSource.h | |
void SetVirtualPathTreeNeedsRebuild() |
Sets a flag to force rebuild of virtual path tree with next call to RefreshVirtualPathTreeIfNeeded() | ContentBrowserDataSource.h | |
virtual void Shutdown () |
Shutdown this data source instance. | ContentBrowserDataSource.h | |
virtual void Tick
(
const float InDeltaTime |
Tick this data source instance. | ContentBrowserDataSource.h | |
virtual bool TryConvertInternalPathToVirtual
(
const FName InInternalPath, |
Convert an internal path to its virtualized form, based on the mount root set on this data source. | ContentBrowserDataSource.h | |
EContentBrowserPathType TryConvertVirtualPath
(
const FStringView InPath, |
ContentBrowserDataSource.h | ||
EContentBrowserPathType TryConvertVirtualPath
(
const FStringView InPath, |
Attempt to convert the given virtual path | ContentBrowserDataSource.h | |
EContentBrowserPathType TryConvertVirtualPath
(
const FStringView InPath, |
ContentBrowserDataSource.h | ||
EContentBrowserPathType TryConvertVirtualPath
(
const FName InPath, |
ContentBrowserDataSource.h | ||
virtual bool TryConvertVirtualPathToInternal
(
const FName InPath, |
Convert a virtualized path to its internal form, based on the mount root set on this data source. | ContentBrowserDataSource.h | |
virtual bool TryGetCollectionId
(
const FContentBrowserItemData& InItem, |
Attempt to retrieve the identifier that should be used when storing a reference to the given item within a collection. | ContentBrowserDataSource.h | |
void UnregisterDataSource() |
Unregister this data source instance from the Content Browser Data Subsystem. | ContentBrowserDataSource.h | |
virtual bool UpdateThumbnail
(
const FContentBrowserItemData& InItem, |
Attempt to update the thumbnail associated with the given item. | ContentBrowserDataSource.h | |
virtual bool ViewItem
(
const FContentBrowserItemData& InItem |
Attempt to open the given item for read-only viewing. | ContentBrowserDataSource.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
ContentBrowserDataSource.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void NotifyItemDataRefreshed() |
Notify a wholesale item data update, for data sources that can't provide delta-updates. | ContentBrowserDataSource.h | |
void QueueItemDataUpdate
(
FContentBrowserItemDataUpdate&& InUpdate |
Queue an incremental item data update, for data sources that can provide delta-updates. | ContentBrowserDataSource.h | |
void RootPathAdded
(
const FStringView InInternalPath |
Adds internal root path to virtual path tree | ContentBrowserDataSource.h | |
void RootPathRemoved
(
const FStringView InInternalPath |
Removes internal root path from virtual path tree | ContentBrowserDataSource.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FName GetModularFeatureTypeName() |
Get the name used when registering data source modular feature instances for use with the Content Browser Data Subsystem. | ContentBrowserDataSource.h |