InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CusDtLnkLinkAssetConverter Class Reference
Inheritance diagram for CusDtLnkLinkAssetConverter:
CPMUnknown< ILinkResource >ILinkResourceIPMUnknown

Public Types

typedef CPMUnknown< ILinkResourceinherited
 

Public Member Functions

 CusDtLnkLinkAssetConverter (IPMUnknown *boss)
 
virtual ResourceId GetURI () const
 
virtual ResourceId GetId () const
 
virtual bool IsIdEquivalent (const ResourceId &id) const
 
virtual LinkClientID GetClientID () const
 
virtual WideString GetShortName (bool bUIName) const
 
virtual WideString GetLongName (bool bUIName) const
 
virtual ResourceState GetState () const
 
virtual void SetState (ResourceState state)
 
virtual ResourceStoreState GetStoreState () const
 
virtual void SetContainedInObject ()
 
virtual ResourceStamp GetStamp () const
 
virtual void SetStamp (const ResourceStamp &stamp)
 
virtual bool IsStampEquivalent (const ResourceStamp &stamp) const
 
virtual IDTime GetModTime () const
 
virtual void SetModTime (const IDTime &time)
 
virtual uint64 GetSize () const
 
virtual void SetSize (uint64 size)
 
virtual FileTypeInfo GetDataType () const
 
virtual PMString GetFormatType () const
 
virtual void SetFormatType (const PMString &formatType)
 
virtual bool IsAccessSupported (AccessMode mode) const
 
virtual bool CanQueryStream (AccessMode mode) const
 
virtual IPMStreamQueryStream (AccessMode mode) const
 
virtual bool CanCache () const
 
virtual ErrorCode Cache ()
 
virtual ErrorCode Uncache ()
 
virtual bool CanEmbed () const
 
virtual ErrorCode Embed ()
 
virtual bool CanUnembed () const
 
virtual ErrorCode Unembed ()
 
virtual bool CanCopyToFile () const
 
virtual ErrorCode CopyToFile (IDFile &file) const
 
virtual bool CanEdit () const
 
virtual ErrorCode Edit (const AppInfo &appInfo, PMString *errorString)
 
virtual bool CanReveal () const
 
virtual ErrorCode Reveal ()
 
virtual bool CanRevealInBridge () const
 
virtual ErrorCode RevealInBridge ()
 
virtual bool CanRevealInCloudLibraries () const
 
virtual ErrorCode RevealInCloudLibraries ()
 
virtual bool IsFPO () const
 
virtual bool CanGetXMPPacketInfo () const
 
virtual bool GetXMPPacketInfo (std::string &packet) const
 
virtual ResourceDownloadState GetDownloadProgress (PMReal &progress) const
 
virtual bool CanDownloadOriginal () const
 
virtual ErrorCode DownloadOriginal ()
 
virtual ErrorCode AsyncDownloadOriginal (ILinkResource::DownloadCompletionFunction completionFunction)
 
virtual bool CanReplaceFPOWithOriginal () const
 
virtual bool CanProvideFile () const
 
virtual ErrorCode GetFile (IDFile &idFile) const
 
virtual void AddChildren (const UIDList &children)
 
virtual void DeleteChildren (const UIDList &children)
 
virtual uint32 GetChildren (UIDList &children) const
 
virtual uint32 GetNumChildren () const
 
virtual uint32 GetParents (UIDList &parents) const
 
virtual ErrorCode CopyAttributes (const UIDRef &resourceRef)
 
virtual ErrorCode EmbedFromStream (IPMStream *stream)
 
virtual ErrorCode Init (IDataLink *iDataLink, const URI &uri)
 
virtual bool CanGetLinkInstance () const
 
virtual ErrorCode GetlinkInstance (PMString &pmStr) const
 
- Public Member Functions inherited from CPMUnknown< ILinkResource >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from CPMUnknown< ILinkResource >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< ILinkResource >
HelperInterface fHelperInterface
 

Member Function Documentation

virtual ErrorCode CusDtLnkLinkAssetConverter::AsyncDownloadOriginal (ILinkResource::DownloadCompletionFunction completionFunction)
inlinevirtual

Downloads the original asset asynchronously for the given placeholder link resource.

Parameters
completionFunctionfunction to invoke when download has completed.
Returns
kSuccess if the original can be downloaded, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::Cache ()
inlinevirtual

Caches the resource. \ If the resource is already cached, then attempts to update the cache from the resource.

Returns
kSuccess if the resource was cached, else an error code.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanCache () const
inlinevirtual

Determines if the resource can be cached by calling Cache(). \ Embedded resources are never are cacheable.

Returns
True if the resource can be cached by calling Cache(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanCopyToFile () const
inlinevirtual

Determines if the resource can be copied to a file by calling CopyToFile().

Returns
True if the resource can be copied to a file by calling CopyToFile(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanDownloadOriginal () const
inlinevirtual

Determines if a resource which is a placeholder(FPO) can be downloaded.

Returns
true if the original resource can be downloaded.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanEdit () const
inlinevirtual

Determines if the resource can be edited by calling Edit(). \ Embedded resources are never editable.

Returns
True if the resource can be edited by calling Edit(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanEmbed () const
inlinevirtual

Determines if the resource can be embedded by calling Embed().

Returns
True if the resource can be embedded by calling Embed(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanGetLinkInstance () const
inlinevirtual

Determines if a link instance can be obtained.

Returns
true if the link instance can be obtained.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanGetXMPPacketInfo () const
inlinevirtual

Determines if we can get the XMP Info for the resource.

Returns
true if we can get the XMP info else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanProvideFile () const
inlinevirtual

Determines if a resource can provide the underlying file or not.

Returns
true if the resource can provide the file.

Implements ILinkResource.

bool CusDtLnkLinkAssetConverter::CanQueryStream (AccessMode mode) const
virtual

Test whether a stream with the given access mode can currently be obtained for the resource. \ The state of whether a stream can be obtained with the given access mode may change at any time, so it is best to attempt to obtain the stream immediately following the call to CanQueryStream().

Parameters
mode[IN] Access mode.
Returns
True if a stream with the given access mode can currently be obtained, else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanReplaceFPOWithOriginal () const
inlinevirtual

Determines if a placeholder(FPO) can be replaced with the original

Returns
true if the FPO can be replaced with the original else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanReveal () const
inlinevirtual

Determines if the resource can be revealed by calling Reveal().

Returns
True if the resource can be revealed by calling Reveal(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanRevealInBridge () const
inlinevirtual

Determines if the resource can be revealed by calling RevealInBridge().

Returns
True if the resource can be revealed by calling RevealInBridge(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanRevealInCloudLibraries () const
inlinevirtual

Determines if the resource can be revealed by calling RevealInCloudLibraries.

Returns
True if the resource can be revealed by calling RevealInCloudLibraries(), else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::CanUnembed () const
inlinevirtual

Determines if the resource can be unembedded by calling Unembed().

Returns
True if the resource can be unembedded by calling Unembed(), else false.

Implements ILinkResource.

ErrorCode CusDtLnkLinkAssetConverter::CopyAttributes (const UIDRefresourceRef)
virtual

Copies the attributes of the resource referenced by the given UIDRef to this resource.

Parameters
resourceRef[IN] UIDRef of the resource to copy. \ The UIDRef may reference a resource in a different database.
Returns
kSuccess if the resource attributes were successfuly copied, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::CopyToFile (IDFilefile) const
inlinevirtual

Copies the resource to the given file.

Parameters
file[IN] File to copy the resource to.
Returns
kSuccess if the resource was successfuly copied, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::DownloadOriginal ()
inlinevirtual

Downloads the original asset synchronously for the given placeholder link resource.

Returns
kSuccess if the original is downloaded, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::Edit (const AppInfoappInfo,
PMStringerrorString 
)
inlinevirtual

Edits the resource. \ Embedded resources cannot be edited.

Parameters
appInfo[IN] Indicates which app to edit the resource with. kNullAppInfo to use the default editor.
errorString[OUT] If editing fails, this fills out an error message when the string pointer is non-nil
Returns
kSuccess if the resource was edited, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::Embed ()
inlinevirtual

Embeds the resource. \ If the resource is already embedded, then the call is ignored and returns kSuccess.

Returns
kSuccess if the resource was embedded, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::EmbedFromStream (IPMStreamstream)
inlinevirtual

Embeds the resource from the given read stream. If successful, this call will set the resource's state, stored state and size. However, it is the caller's responsibility to set the resource's stamp. \ Note: This method should only be used for special cases like creating an embedded link resource from INX, or creating link resources for embedded graphics contained in Word documents.

Parameters
stream[IN] Read stream containing the resource's embedded data.
Returns
kSuccess if the resource was embedded, else an error code.

Implements ILinkResource.

virtual LinkClientID CusDtLnkLinkAssetConverter::GetClientID () const
inlinevirtual

Returns the resource's link client identifier.

Returns
Resource's link client identifier.

Implements ILinkResource.

FileTypeInfo CusDtLnkLinkAssetConverter::GetDataType () const
virtual

Returns the resource's data/file type.

Returns
Resource's data/file type.

Implements ILinkResource.

virtual ResourceDownloadState CusDtLnkLinkAssetConverter::GetDownloadProgress (PMRealprogress) const
inlinevirtual

Return resource's download state and fill progress

Parameters
progress[OUT] the progress of the resource download - currently unused
Returns
ResourceDownloadState resource's download state

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::GetFile (IDFileidFile) const
inlinevirtual

Get the underlying file from the link resource.

Parameters
idFile[OUT] the underlying file for the link resource
Returns
kSuccess if the underyling file is available, else an error code.

Implements ILinkResource.

virtual PMString CusDtLnkLinkAssetConverter::GetFormatType () const
inlinevirtual

Returns the resource's import/export format type.

Returns
Resource's import/export format type.

Implements ILinkResource.

virtual ResourceId CusDtLnkLinkAssetConverter::GetId () const
inlinevirtual

Returns the resource's Uniform Resource Identifier (URI). \ The URI is used to uniquely identify the resource's type and location.

Returns
Resource's URI.

Implements ILinkResource.

WideString CusDtLnkLinkAssetConverter::GetLongName (bool bUIName) const
virtual

Returns the resource's long name. \ For example, the long name for a file resource is the file's full path.

Parameters
bUIName[IN] Denotes to return the resource's long UI name if different from the resource's actual long name.\ In some cases, resources may want to have long UI name that differs from the resource's actual long name. For example, file resources on the Mac return a POSIX path as the resource's actual long name, and a HFS/POSIX path as the resource's long UI name.
Returns
Resource's long name.

Implements ILinkResource.

virtual IDTime CusDtLnkLinkAssetConverter::GetModTime () const
inlinevirtual

Returns the resource's current modification date/time.

Returns
Resource's current modification date/time.

Implements ILinkResource.

WideString CusDtLnkLinkAssetConverter::GetShortName (bool bUIName) const
virtual

Returns the resource's short name. \ For example, the short name for a file resource is the file's name.

Parameters
bUIName[IN] Denotes to return the resource's short UI name if different from the resource's actual short name.\ In some cases, resources may want to have short UI name that differs from the resource's actual short name. For example, file resources on the Mac return a POSIX file name as the resource's actual short name, and a HFS/POSIX file name as the resource's short UI name.
Returns
Resource's short name.

Implements ILinkResource.

virtual uint64 CusDtLnkLinkAssetConverter::GetSize () const
inlinevirtual

Returns the resource's size in bytes.

Returns
Resource's size in bytes.

Implements ILinkResource.

virtual ResourceStamp CusDtLnkLinkAssetConverter::GetStamp () const
inlinevirtual

Returns the resource's stamp. \ The stamp, in conjuction with the URI, uniquely identifies an resource at a given point in time.

Returns
Resource's stamp.

Implements ILinkResource.

virtual ResourceState CusDtLnkLinkAssetConverter::GetState () const
inlinevirtual

Returns the resource's availability state.

Returns
Resource's availability state.

Implements ILinkResource.

virtual ResourceStoreState CusDtLnkLinkAssetConverter::GetStoreState () const
inlinevirtual

Returns the resource's store state.

Returns
Resource's store state.

Implements ILinkResource.

virtual ResourceId CusDtLnkLinkAssetConverter::GetURI () const
inlinevirtual

DEPRECATED - Please call the GetId method instead. Returns the resource's Uniform Resource Identifier (URI). \ The URI is used to uniquely identify the resource's type and location.

Returns
Resource's URI.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::GetXMPPacketInfo (std::string & packet) const
inlinevirtual

Get the XMP Info for the resource

Parameters
packet[OUT] the resource's XMP info
Returns
true if the XMP info is filled in packet else false .

Implements ILinkResource.

bool CusDtLnkLinkAssetConverter::IsAccessSupported (AccessMode mode) const
virtual

Determines if the resource generally supports the given access mode. \ It is possible that the resource generally supports the given access mode, but it is not possible to currently obtain a stream due to the resource being read or written by other processes. Therefore, to determine if a stream can currently be obtained with the given access mode, call CanQueryStream().

Parameters
mode[IN] Access mode.
Returns
True if the resource generally supports the given access mode, else false.

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::IsFPO () const
inlinevirtual

Determines if the resource is an FPO.

Returns
true if the resource is an FPO else false.
See Also
ILinkResourceRenditionData::ResourceRenditionType

Implements ILinkResource.

virtual bool CusDtLnkLinkAssetConverter::IsIdEquivalent (const ResourceIdid) const
inlinevirtual

Determines if the given id is equivalent to the resource's id.

Parameters
id[IN] Resource id to compare with the resource's id.
Returns
True if the given id is equivalent to the resource's id, else false.

Implements ILinkResource.

bool CusDtLnkLinkAssetConverter::IsStampEquivalent (const ResourceStampstamp) const
virtual

Determines if the given stamp is equivalent to the resource's stamp.

Parameters
stamp[IN] Stamp to compare with the resource's stamp.
Returns
True if the given stamp is equivalent to the resource's stamp, else false.

Implements ILinkResource.

IPMStream * CusDtLnkLinkAssetConverter::QueryStream (AccessMode mode) const
virtual

Returns a stream that is used to access the resource's data. \ If the access mode is kRead and the resource is cached or embedded, the returned stream will read the cached or embedded data. \ If the access mode is kWrite and the resource is cached, the returned stream will write data to the actual resource, not the cache.

Parameters
mode[IN] Access mode.
Returns
Pointer to a referenced stream; the caller is responsible for releasing the stream. \ Nil if a stream cannot be obtained.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::Reveal ()
inlinevirtual

Reveals the resource.

Returns
kSuccess if the resource was revealed, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::RevealInBridge ()
inlinevirtual

Reveals the resource.

Returns
kSuccess if the resource was revealed, else an error code.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::RevealInCloudLibraries ()
inlinevirtual

Reveals the resource.

Returns
kSuccess if the resource was revealed in CC Libraries, else an error code.

Implements ILinkResource.

virtual void CusDtLnkLinkAssetConverter::SetContainedInObject ()
inlinevirtual

Sets the resource's store state to kContained.\ This call is ignored for resources that are cached or embedded.

Implements ILinkResource.

void CusDtLnkLinkAssetConverter::SetFormatType (const PMStringformatType)
virtual

Sets the resource's import/export format type.

Parameters
formatType[IN] Resource's import/export format type.

Implements ILinkResource.

void CusDtLnkLinkAssetConverter::SetModTime (const IDTimetime)
virtual

Sets the resource's current modification date/time.

Parameters
size[IN] Current modification date/time of the resource.

Implements ILinkResource.

void CusDtLnkLinkAssetConverter::SetSize (uint64 size)
virtual

Sets the resource's size in bytes.

Parameters
size[IN] Size of the resource in bytes.

Implements ILinkResource.

void CusDtLnkLinkAssetConverter::SetStamp (const ResourceStampstamp)
virtual

Sets the resource's stamp.

Parameters
stamp[IN] Stamp of the resource.

Implements ILinkResource.

void CusDtLnkLinkAssetConverter::SetState (ResourceState state)
virtual

Sets the resource's availability state.

Parameters
state[IN] Availability state of the resource.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::Uncache ()
inlinevirtual

Uncaches the resource.

Returns
kSuccess if the resource was uncached, else an error code. \ kFailure is returned if the resource is not currently cached.

Implements ILinkResource.

virtual ErrorCode CusDtLnkLinkAssetConverter::Unembed ()
inlinevirtual

Unembeds the resource to the same location it was embedded from.

Returns
kSuccess if the resource was unembedded, else an error code. \ kFailure is returned if the resource is not currently embedded.

Implements ILinkResource.