![]() | InDesign SDK 20.5 |
#include <ILinkResourceHandler.h>

Public Types | |
| enum | { kDefaultIID = IID_ILINKRESOURCEHANDLER } |
Public Member Functions | |
| virtual bool | Init (const UIDRef &ref, const URI &uri)=0 |
| virtual bool | IsResourceURIValid (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | AreResourceIdsEquivalent (const ILinkResource::ResourceId &id1, const ILinkResource::ResourceId &id2) const =0 |
| virtual FileTypeInfo | GetResourceDataType (const UIDRef &ref, const URI &uri) const =0 |
| virtual WideString | GetShortResourceName (const UIDRef &ref, const URI &uri, bool bUIName) const =0 |
| virtual WideString | GetLongResourceName (const UIDRef &ref, const URI &uri, bool bUIName) const =0 |
| virtual PMString | GetResourceStateInfo (const UIDRef &ref, const URI &uri, ILinkResource::ResourceState state, ILinkResource::ResourceStoreState storeState) const =0 |
| virtual bool | AreStampsEquivalent (const WideString &stamp1, const WideString &stamp2) const =0 |
| virtual bool | CanReadResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanWriteResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanReadWriteResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanCreateResourceStream (const UIDRef &ref, const URI &uri, ILinkResource::AccessMode access) const =0 |
| virtual IPMStream * | CreateResourceReadStream (const UIDRef &ref, const URI &uri) const =0 |
| virtual IPMStream * | CreateResourceWriteStream (const UIDRef &ref, const URI &uri) const =0 |
| virtual IPMStream * | CreateResourceReadWriteStream (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanCacheResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanEmbedResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanUnembedResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanCopyToFile (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | CopyToFile (const UIDRef &ref, const URI &uri, IDFile &file) const =0 |
| virtual bool | CanEditResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | EditResource (const UIDRef &ref, const URI &uri, const AppInfo &appInfo, PMString *errorString) const =0 |
| virtual bool | CanRevealResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | RevealResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanRevealResourceInBridge (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | RevealResourceInBridge (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanRevealResourceInCloudLibraries (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | RevealResourceInCloudLibraries (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | CanGetXMPPacketInfo (const UIDRef &ref, const URI &uri) const =0 |
| virtual bool | GetXMPPacketInfo (const UIDRef &resourceRef, const URI &uri, std::string &packet) const =0 |
| virtual bool | CanDownloadOriginalResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | DownloadOriginalResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | AsyncDownloadOriginalResource (const UIDRef &ref, const URI &uri, ILinkResource::DownloadCompletionFunction completionFunction) const =0 |
| virtual bool | CanReplaceFPOWithOriginalResource (const UIDRef &ref, const URI &uri) const =0 |
| virtual ILinkResource::ResourceDownloadState | GetResourceDownloadProgress (const UIDRef &ref, const URI &uri, PMReal &progress) const =0 |
| virtual bool | CanProvideFile (const UIDRef &ref, const URI &uri) const =0 |
| virtual ErrorCode | GetFile (const UIDRef &ref, const URI &uri, IDFile &idFile) const =0 |
| virtual bool | canGetInstanceName () const =0 |
| virtual ErrorCode | GetInstanceName (PMString &instanceURI) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
ILinkResourceHandler is used to implement behavior for an ILinkResource that is specific to the type of a resource as identified by the scheme of the link resource's URI. The link resource defers many operations and attribute request to the handler. For example, it is left to the handler to determine if two resources have equivalent URIs or stamps. The handler is also used to determine what operations are allowed, to obtain streams to the resource, and to edit and copy the resource.
To associate a handler for a specific type of resource, a factory for the type of resource is registered via a link resource provider for the kLinkResourceService. For example, a file based link resource will require a different provider and handler than a database link resource.
When an ILinkResource object is instantiated, the handler is obtained using the scheme of the resource's URI as a key to find the appropriate provider. If no handler is found, due to a missing plug-in for instance, the link resource is assigned a default handler that essentially treats the resource as if it were missing. Therefore, all resources that have a custom URI must provide a handler.
| pure virtual |
Called to determine if the given resource references are equivalent.
| id1 | [IN] Resource identifier to compare with id2. |
| id2 | [IN] Resource identifier to compare with id1. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if the given resource stamps are equivalent.
| stamp1 | [IN] Stamp to compare with stamp2. |
| stamp2 | [IN] Stamp to compare with stamp1. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to download original asynchronously for an FPO resource.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to be downloaded. |
| completionFunction | [IN] completion function to be called at the end of download. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be cached.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be copied to a file.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can currently be opened with the given access mode.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
| access | [IN] Type of access desired. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if the original for an FPO resource can be downloaded.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be edited.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be embedded.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Determines if we can get the XMP Info for the resource.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Determines if a resource can provide the underlying file or not.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be read.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be read and written simultaneously.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if the FPO resource can be replaced with original.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be revealed.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be revealed in Adobe Bridge
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be revealed in CC Libraries panel
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be unembedded.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if a resource can be written.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to copy a resource to the given file.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to copy. |
| file | [IN] File to copy the resource to. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to create a stream that can be used to read data from a resource. \ The caller assumes responsibility for deleting the stream.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to create a read stream for. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to create a stream that can be used to read and write data from/to a resource. \ The caller assumes responsibility for deleting the stream.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to create a read/write stream for. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to create a stream that can be used to write data to a resource. \ The caller assumes responsibility for deleting the stream.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to create a write stream for. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to download original synchronously for an FPO resource.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to be downloaded. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to edit a resource.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to edit. |
| appInfo | [IN] Indicates which app to edit the resource with. kNullAppInfo means use the default editor. |
| errorString | [OUT] If editing fails, this fills out an error message when the string pointer is non-nil |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Get the underlying file from the link resource.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
| idFile | [OUT] IDFile of the underlying link resource. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to get a resource's long name. \ For example, the long name for a file resource is the file's full path.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to get a long name for. |
| 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. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, FileLinkResourceHandler, and CusHttpLnkLinkResourceHandler.
| pure virtual |
Called to get a resource's data/file type.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to get the data/file type for. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Return resource's download state and fill progress
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
| progress | [OUT] the download progress, currently unused. resource's download state |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to get additional information about a resource's state. \ The additional information is added to state string the Links UI displays in the link information pane and the status tooltip.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to get a state informational string for. |
| state | [IN] Resource's current availability state. |
| storeState | [IN] Resource's current store state. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to get a resource's short name. \ For example, the short name for a file resource is the file's name.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to get a short name for. |
| 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. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Get the XMP Info for the resource
| resourceRef | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
| packet | [OUT] the resource's XMP info |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
Called by the LinkResource to allow the handler to initialize itself. This method can be used by the handler to optimize its resource handling. For example, the handler may want to parse the URI in this method so that calls to other methods can used the parsed information.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the link resource. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to determine if the provider supports the given URI.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI to check. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to reveal a resource.
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to reveal. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to reveal a resource in Adobe Bridge
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to reveal. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.
| pure virtual |
Called to reveal a resource in CC Libraries panel
| ref | [IN] UID reference of the link resource. |
| uri | [IN] URI of the resource to reveal. |
Implemented in HTTPAssetLinkResourceHandler, CusDtLnkLinkResourceHandler, and FileLinkResourceHandler.