KeywordAssetInterface Class Reference

#include <asset_keyword.h>

Inheritance diagram for KeywordAssetInterface:

Detailed Description

KeywordAssetInterface extends the AssetInterface to deal with keyword assets.

Static Public Member Functions

static MAXON_METHOD Result< KeywordAsset > Create ()
 
static MAXON_METHOD Result< BoolAddKeyword (const AssetDescription &target, const Id &keywordId, Bool userScope, const AssetRepositoryRef &updateUsageRepository)
 
static MAXON_METHOD Result< BoolRemoveKeyword (const AssetDescription &target, const Id &keywordId, Bool userScope)
 
static MAXON_METHOD Result< LiteralIdHasKeyword (const AssetDescription &target, const Id &keywordId)
 
static MAXON_METHOD Bool IsFavouriteAsset (const AssetDescription &ad)
 
static MAXON_METHOD Result< Tuple< Bool, Bool > > GetDefaultAssetState (const AssetDescription &ad)
 
static MAXON_METHOD Result< AssetDescription > GetDefaultAsset (const Id &type, const AssetRepositoryRef &lookupRepository)
 
static MAXON_METHOD Result< void > SetDefaultAsset (const AssetDescription &ad, Bool on)
 

Private Member Functions

 MAXON_INTERFACE (KeywordAssetInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.interface.keywordasset")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( KeywordAssetInterface  ,
MAXON_REFERENCE_COPY_ON_WRITE  ,
"net.maxon.interface.keywordasset"   
)
private

◆ Create()

static MAXON_METHOD Result<KeywordAsset> Create ( )
static

◆ AddKeyword()

static MAXON_METHOD Result<Bool> AddKeyword ( const AssetDescription &  target,
const Id keywordId,
Bool  userScope,
const AssetRepositoryRef &  updateUsageRepository 
)
static

AddKeyword adds a keyword to an asset.

Parameters
[in]targetAsset to add keywords.
[in]keywordIdKeyword Id to add.
[in]userScopeTrue to use ASSETMETADATA::UserKeywords other wise ASSETMETADATA::Keywords.
[in]updateUsageRepositoryTrue to update the last used time and use count.
Returns
True if a keyword was added. False if the keyword was not added - that means it already exists. Error if it was not possible to add the keyword.

◆ RemoveKeyword()

static MAXON_METHOD Result<Bool> RemoveKeyword ( const AssetDescription &  target,
const Id keywordId,
Bool  userScope 
)
static

RemoveKeyword removes a keyword from an asset.

Parameters
[in]targetAsset to remove keywords.
[in]keywordIdKeyword Id to remove.
[in]userScopeTrue to use ASSETMETADATA::UserKeywords other wise ASSETMETADATA::Keywords.
Returns
True if a keyword was found and removed. False if the keyword was not found on the asset. Error if it was not possible to remove the keyword.

◆ HasKeyword()

static MAXON_METHOD Result<LiteralId> HasKeyword ( const AssetDescription &  target,
const Id keywordId 
)
static

HasKeyword returns if the asset has a given keyword assigned

Parameters
[in]targetAsset to search.
[in]keywordIdKeyword Id to search.
Returns
userScope type on success ASSETMETADATA::UserKeywords or ASSETMETADATA::Keywords. Id() if not found.

◆ IsFavouriteAsset()

static MAXON_METHOD Bool IsFavouriteAsset ( const AssetDescription &  ad)
static

IsFavouriteAsset returns true if the given asset is a favourite.

Parameters
[in]adAsset to inspect.
Returns
True if favourite.

◆ GetDefaultAssetState()

static MAXON_METHOD Result<Tuple<Bool, Bool> > GetDefaultAssetState ( const AssetDescription &  ad)
static

GetDefaultAssetState checks if the given asset is a preset.

Parameters
[in]adAsset to look at.
Returns
Tuple<Bool, Bool> on success. First: true if it is an preset, Second: True if the asset is the default asset.

◆ GetDefaultAsset()

static MAXON_METHOD Result<AssetDescription> GetDefaultAsset ( const Id type,
const AssetRepositoryRef &  lookupRepository 
)
static

GetDefaultAsset returns the default preset for the given type.

Parameters
[in]typePreset type.
[in]lookupRepositoryRepository to search for.
Returns
AssetDescription on success.

◆ SetDefaultAsset()

static MAXON_METHOD Result<void> SetDefaultAsset ( const AssetDescription &  ad,
Bool  on 
)
static

SetDefaultAsset sets the default state of the given preset asset. Every type can only have one preset as default.

Parameters
[in]adAsset to modify.
[in]onTrue to make this preset the default. False to make it no longer the default.
Returns
OK on success.