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

Public Types | |
| enum | { kDefaultIID = IID_ILINKUTILS } |
Public Member Functions | |
| virtual ErrorCode | CopyLinks (IDataBase *iDataBase, UID sourceItemUID, UID targetItemUID)=0 |
| virtual ErrorCode | ReplaceLinks (IDataBase *iDataBase, UID sourceItemUID, UID targetItemUID)=0 |
| virtual ErrorCode | CopyLinkToLinkObject (const UIDRef &sourceLinkUIDRef, const UIDRef &targetObjectUIDRef, UID &newLink)=0 |
| virtual UID | GetLink (const UIDRef &itemRef) const =0 |
| virtual UID | FindLink (const UIDRef &itemRef) const =0 |
| virtual UID | FindLinkResource (const UIDRef &itemRef) const =0 |
| virtual bool | IsLinkMissing (const UIDRef &itemRef) const =0 |
| virtual bool | IsLinkEmbedded (const UIDRef &itemRef) const =0 |
| virtual bool | IsLinkMissingOrOutOfDate (const UIDRef &itemRef) const =0 |
| virtual bool | IsResourceLinked (const UIDRef &resourceRef) const =0 |
| virtual bool | GetFileFromLink (ILink *link, IDFile *file) const =0 |
| virtual bool | GetFileFromLink (const UIDRef &itemRef, IDFile *file) const =0 |
| virtual IPMStream * | CreateReadStreamFromLink (const UIDRef &itemRef) const =0 |
| virtual IPMStream * | CreateWriteStreamFromLink (const UIDRef &itemRef) const =0 |
| virtual ErrorCode | CreateFileFromEmbedded (const UIDRef &itemRef, IDFile &file) const =0 |
| virtual IPMStream * | QueryLinkedStream (const UIDRef &itemRef) const =0 |
| virtual uint64 | GetUIDSize (IDataBase *db, UID uid) const =0 |
| virtual bool | IDFileToResourceId (const IDFile &file, ILinkResource::ResourceId &resourceId) const =0 |
| virtual bool | CloudAssetRefToResourceId (const std::string &assetRef, ILinkResource::ResourceId &resourceId) const =0 |
| virtual bool | ResourceIdToIDFile (const ILinkResource::ResourceId &resourceId, IDFile &file) const =0 |
| virtual UID | FindMatchingResource (const UIDRef &resourceRef, bool bEmbedded) const =0 |
| virtual UID | FindMatchingResource (IDataBase *db, const LinkClientID &clientID, const ILinkResource::ResourceId &resourceId, bool bEmbedded) const =0 |
| virtual bool | GetEditorList (const UIDRef &linkResource, AppInfoList &appList, const bool16 bDefaultEditorOnly)=0 |
| virtual bool | ComposePath (IDFile &file) const =0 |
| virtual bool32 | IsINDDInternalLink (const ILink *iLink) const =0 |
| virtual bool | GetOPIName (const UIDRef &itemRef, PMString &name) const =0 |
| virtual bool16 | GetXMPPacket (IDFile &theFile, std::string &packet)=0 |
| virtual WideString | GetLinkScheme (const ILink *iLink)=0 |
| virtual bool16 | IsLinkContentAvailable (const ILink *iLink)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Utility interface that provides useful functionality for programming against the links architecture.
| pure virtual |
Converts an asset ref to an ILinkResource::ResourceId.
| file | [IN] assetRef to convert. |
| resourceId | [OUT] Resulting ILinkResource::ResourceId. |
| pure virtual |
Performs a form C string normalization (canonical composition) on the given file's path.
| file | [IN] File whose path to compose.. |
| pure virtual |
Copies the set of links found on the source item to the target item. Each boss object behind the source and target UIDs will support the ILinkObject interface. This method will create a link (ILink) connecting the target item (ILinkObject) to an resource (ILinkResource) for each link that exists on the source item. Both the source and target items are assumed to be on the same database. No links are deleted (either on source or target) as part of this operation. New links are created, associated with the target item.
| iDataBase | [IN] Document database the items exist in. |
| sourceItemUID | [IN] Source of the copy operation. |
| targetItemUID | [IN] Target of the copy operation. |
| pure virtual |
Copies the specified link to the object specified. A copy of the link is made in the target link object database, and this new link is associated with the target link object.
| sourceLinkUIDRef | [IN] Link to be copied. |
| targetObjectUIDRef | [IN] Link object (signature interface ILinkObject) the new link is associated with. |
| newLink | [OUT] UID of the newly created link (the copy of the link specified by sourceLinkUIDRef). |
| pure virtual |
Create a file from the embedded data.
| itemRef | [IN] UIDRef of the linked page item. |
| file | [IN] File to create. |
Find any link related to the source item. This method searches the item's hierarchy for an association to a link. If none is found, the method determines if there is an association with a text story, and the story is tested for an association to a link. If a link association is found, the method returns the link.
| itemRef | [IN] Reference to item we are examining. |
Find any resource that is linked or related to the source item. \ This method searches the item's hierarchy for an association to a link resource. If none is found, the method determines if there is an association with a text story, and the story is tested for an association to a link resource. If a link resource association is found, the method returns the UID of link resource.
| itemRef | [IN] Reference to item we are examining. |
| pure virtual |
Find any resource that matches the URI and stamp of the given resource.\ Since the resource stamps are compared, it is important that the stamps be up-to-date before calling this method.
| resourceRef | [IN] Reference to resource we are matching. |
| bEmbedded | [IN] Denotes whether the resource to match must be embedded. \ True if the matching resource must be embedded, false if the matching resource cannot be embedded. |
| pure virtual |
Find any resource that matches the given link resource identifier (URI).
| db | [IN] Database the resource to match. |
| clientId | [IN] Link client identifier of the resources to check. |
| resourceId | [IN] Link resource identifier (URI) to match. |
| bEmbedded | [IN] Denotes whether the resource to match must be embedded. \ True if the matching resource must be embedded, false if the matching resource cannot be embedded. |
| pure virtual |
Determine whether a file's associated editor is available and gather a list of editors for the file.
| linkResource | [IN] Link resource we want to edit. |
| appList | [OUT] The editor list, could be empty. |
| bDefaultEditorOnly | [IN] If kTrue, return default editor only, kFalse to gether all editors for the file. |
Get a link related to the source item. Returns the UID of first associated link. Does not search the item's hierarchy, see FindLink() instead.
| itemRef | [IN] Reference to item we are examining. |
| pure virtual |
Use this method to get the scheme of the link, i.e whether a placed link is from file system, CC Libraries or any other source.
| iLink | [IN] The link in question. |
Gets the OPI name of the link resource associated to the source item.\ If there is no OPI name, an empty string is returned.
| itemRef | [IN] Reference to item we are examining. |
| name | [OUT] OPI name of the link resource.\ On the Mac an OPI file name is an HFS/POSIX path.\ On Windows, an OPI file name is a local or UNC path.\ If the link resource does not reference a file, the returned OPI name is the resource's long name. |
Get the size of a UID.
| db | [IN] The document containing the UID. |
| uid | [IN] UID. |
| pure virtual |
Serializes a file's XMP metadata to a string.
| theFile | [IN] The file to examine. |
| packet | [OUT] A reference to the string to which the metadata is serialized. |
| pure virtual |
| pure virtual |
Use this method to identify whether or not a data link is from within a placed InDesign document. That is, is this link a placed image, for example, on a page within an InDesign document which has been placed within another InDesign document? If so, then we may not want users to be allowed to perform certain operations on the link.
| iLink | [IN] The link in question. |
| pure virtual |
Use this method to check whether the underlying link content is locally available or not
| iLink | [IN] The link in question. |
| pure virtual |
Determine if the link information for a page item is embedded. A link is embedded if the link resource store state associated with the link is set to ILinkResource::kEmbedded.
| itemRef | [IN] Reference to item we are testing |
| pure virtual |
Determine if the link information for a page item is missing. The link is missing if there is no link (ILink) associated with the link object (ILinkObject). A link is missing if the link resource state associated with the link is set to ILinkResource::kMissing. If the link is embedded, it is not missing.
| itemRef | [IN] Reference to item we are testing |
| pure virtual |
If IsLinkMissing returns false and IsLinkEmbedded returns false, determine if the associated ILink's GetResourceModificationState is ILink::kResourceModified or the ILinkResource's state is not ILinkResource::kAvailable.
| itemRef | [IN] Reference to item we are testing |
| pure virtual |
Determines if a link resource is associated with any link.
| resourceRef | [IN] Reference to link resource to check. |
Returns a stream that contains the data link's data.
| itemRef | [IN] UIDRef of the linked page item. |
| pure virtual |
Replaces the set of links on the target item with those that exist on the source item. This method assumes the source and target items support the ILinkObject interface. All links that exist on the target item are deleted prior to the operation. A new link (ILink) is associated with the target (ILinkObject) to every resource (ILinkResource) that is linked to on the source item. No links are deleted on the source item as part of this operation. New links are created, associated with the target item.
| iDataBase | [IN] Document databse the items exist in. |
| sourceItemUID | [IN] Source of the copy operation. |
| targetItemUID | [IN] Target of the copy operation. |
| pure virtual |