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

Public Types | |
| enum | { kDefaultIID = IID_ILINKRESOURCE } |
| enum | ResourceState { kAvailable = 0, kMissing, kPending, kUnknown, kInaccessible } |
| enum | ResourceStoreState { kNormal = 0, kCached, kEmbedded, kContained } |
| enum | AccessMode { kRead = 0, kWrite, kReadWrite } |
| enum | ResourceDownloadState { kNotStarted = 0, kInProgress, kComplete, kDownloadError } |
| typedef URI | ResourceId |
| typedef WideString | ResourceStamp |
| typedef boost::function< void(const ILinkResource::ResourceId &resourceId, const ILinkResource::ResourceDownloadState &resourceDownloadState)> | DownloadCompletionFunction |
Public Member Functions | |
| virtual ResourceId | GetURI () const =0 |
| virtual ResourceId | GetId () const =0 |
| virtual bool | IsIdEquivalent (const ResourceId &id) const =0 |
| virtual LinkClientID | GetClientID () const =0 |
| virtual WideString | GetShortName (bool bUIName) const =0 |
| virtual WideString | GetLongName (bool bUIName) const =0 |
| virtual ResourceState | GetState () const =0 |
| virtual void | SetState (ResourceState state)=0 |
| virtual ResourceStoreState | GetStoreState () const =0 |
| virtual void | SetContainedInObject ()=0 |
| virtual ResourceStamp | GetStamp () const =0 |
| virtual void | SetStamp (const ResourceStamp &stamp)=0 |
| virtual bool | IsStampEquivalent (const ResourceStamp &stamp) const =0 |
| virtual IDTime | GetModTime () const =0 |
| virtual void | SetModTime (const IDTime &time)=0 |
| virtual uint64 | GetSize () const =0 |
| virtual void | SetSize (uint64 size)=0 |
| virtual FileTypeInfo | GetDataType () const =0 |
| virtual PMString | GetFormatType () const =0 |
| virtual void | SetFormatType (const PMString &formatType)=0 |
| virtual bool | IsAccessSupported (AccessMode mode) const =0 |
| virtual bool | CanQueryStream (AccessMode mode) const =0 |
| virtual IPMStream * | QueryStream (AccessMode mode) const =0 |
| virtual bool | CanCache () const =0 |
| virtual ErrorCode | Cache ()=0 |
| virtual ErrorCode | Uncache ()=0 |
| virtual bool | CanEmbed () const =0 |
| virtual ErrorCode | Embed ()=0 |
| virtual ErrorCode | EmbedFromStream (IPMStream *stream)=0 |
| virtual bool | CanUnembed () const =0 |
| virtual ErrorCode | Unembed ()=0 |
| virtual bool | CanCopyToFile () const =0 |
| virtual ErrorCode | CopyToFile (IDFile &file) const =0 |
| virtual bool | CanEdit () const =0 |
| virtual ErrorCode | Edit (const AppInfo &appInfo, PMString *errorString)=0 |
| virtual bool | CanReveal () const =0 |
| virtual ErrorCode | Reveal ()=0 |
| virtual bool | CanRevealInBridge () const =0 |
| virtual ErrorCode | RevealInBridge ()=0 |
| virtual bool | CanRevealInCloudLibraries () const =0 |
| virtual ErrorCode | RevealInCloudLibraries ()=0 |
| virtual ErrorCode | CopyAttributes (const UIDRef &resourceRef)=0 |
| virtual bool | IsFPO () const =0 |
| virtual bool | CanGetXMPPacketInfo () const =0 |
| virtual bool | GetXMPPacketInfo (std::string &packet) const =0 |
| virtual ResourceDownloadState | GetDownloadProgress (PMReal &progress) const =0 |
| virtual bool | CanDownloadOriginal () const =0 |
| virtual ErrorCode | DownloadOriginal ()=0 |
| virtual ErrorCode | AsyncDownloadOriginal (ILinkResource::DownloadCompletionFunction completionFunction)=0 |
| virtual bool | CanReplaceFPOWithOriginal () const =0 |
| virtual bool | CanProvideFile () const =0 |
| virtual ErrorCode | GetFile (IDFile &idFile) const =0 |
| virtual bool | CanGetLinkInstance () const =0 |
| virtual ErrorCode | GetlinkInstance (PMString &instance) 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 |
ILinkResource is used to maintain and access a linked resource. A linked resource is an external or internal source of imported data, or external or internal target of exported data. All linked resources are referenced by a URI, whose scheme is used to denote the type of the resource and obtain the correct ILinkResourceHandler.
Several operations and attribute request are deferred to the ILinkResourceHandler. When the resource 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 resource is assigned a default handler that essentially treats the resource as if it were missing, and results in the resource's state to be set to kUnknown.
Identifiers that denote the type of access the link resource supports. The identifiers are used to get the type of access supported by the resource, and to query for streams.
Identifiers that denote the availability state of the linked resource. The identifiers are used to get and set the availability state of a linked resource. The state may not be the actual current availability state of the resource.
Identifiers that denote the store state of the link resource. The identifiers are used to get the store state of the resource.
| pure virtual |
Downloads the original asset asynchronously for the given placeholder link resource.
| completionFunction | function to invoke when download has completed. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Caches the resource. \ If the resource is already cached, then attempts to update the cache from the resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be cached by calling Cache(). \ Embedded resources are never are cacheable.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be copied to a file by calling CopyToFile().
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if a resource which is a placeholder(FPO) can be downloaded.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be edited by calling Edit(). \ Embedded resources are never editable.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be embedded by calling Embed().
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if a link instance can be obtained.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if we can get the XMP Info for the resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if a resource can provide the underlying file or not.
Implemented in CusDtLnkLinkAssetConverter.
| pure 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().
| mode | [IN] Access mode. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if a placeholder(FPO) can be replaced with the original
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be revealed by calling Reveal().
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be revealed by calling RevealInBridge().
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be revealed by calling RevealInCloudLibraries.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource can be unembedded by calling Unembed().
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Copies the attributes of the resource referenced by the given UIDRef to this resource.
| resourceRef | [IN] UIDRef of the resource to copy. \ The UIDRef may reference a resource in a different database. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Copies the resource to the given file.
| file | [IN] File to copy the resource to. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Downloads the original asset synchronously for the given placeholder link resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Edits the resource. \ Embedded resources cannot be edited.
| 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 |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Embeds the resource. \ If the resource is already embedded, then the call is ignored and returns kSuccess.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
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.
| stream | [IN] Read stream containing the resource's embedded data. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's link client identifier.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's data/file type.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Return resource's download state and fill progress
| progress | [OUT] the progress of the resource download - currently unused |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Get the underlying file from the link resource.
| idFile | [OUT] the underlying file for the link resource |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's import/export format type.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's Uniform Resource Identifier (URI). \ The URI is used to uniquely identify the resource's type and location.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's long name. \ For example, the long name for a file resource is the file's full path.
| 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 CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's current modification date/time.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's short name. \ For example, the short name for a file resource is the file's name.
| 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 CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's size in bytes.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's stamp. \ The stamp, in conjuction with the URI, uniquely identifies an resource at a given point in time.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's availability state.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Returns the resource's store state.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
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.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Get the XMP Info for the resource
| packet | [OUT] the resource's XMP info |
Implemented in CusDtLnkLinkAssetConverter.
| pure 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().
| mode | [IN] Access mode. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the resource is an FPO.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the given id is equivalent to the resource's id.
| id | [IN] Resource id to compare with the resource's id. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Determines if the given stamp is equivalent to the resource's stamp.
| stamp | [IN] Stamp to compare with the resource's stamp. |
Implemented in CusDtLnkLinkAssetConverter.
| pure 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.
| mode | [IN] Access mode. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Reveals the resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Reveals the resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Reveals the resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Sets the resource's store state to kContained.\ This call is ignored for resources that are cached or embedded.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Sets the resource's import/export format type.
| formatType | [IN] Resource's import/export format type. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Sets the resource's current modification date/time.
| size | [IN] Current modification date/time of the resource. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Sets the resource's size in bytes.
| size | [IN] Size of the resource in bytes. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Sets the resource's stamp.
| stamp | [IN] Stamp of the resource. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Sets the resource's availability state.
| state | [IN] Availability state of the resource. |
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Uncaches the resource.
Implemented in CusDtLnkLinkAssetConverter.
| pure virtual |
Unembeds the resource to the same location it was embedded from.
Implemented in CusDtLnkLinkAssetConverter.