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

Classes | |
| class | ChangeData |
Public Types | |
| enum | { kDefaultIID = IID_ILINKMANAGER } |
| enum | OperationType { kAsynchronous = 0, kSynchronous } |
| typedef std::vector< UID > | QueryResult |
Public Member Functions | |
| virtual bool | IsModelChanging () const =0 |
LinkResource methods | |
| virtual UID | CreateResource (const URI &uri, LinkClientID clientId, bool bUseExisting)=0 |
| virtual ErrorCode | ReinitResource (UID resourceUID, const URI &uri, bool updateResourceStateSync=true)=0 |
| virtual ErrorCode | DeleteResource (UID resourceUID)=0 |
| virtual ILinkResource * | QueryResourceByUID (UID resourceUID) const =0 |
| virtual ErrorCode | UpdateResourceState (UID resourceUID, OperationType opType)=0 |
| virtual void | CancelUpdateResourceState (UID resourceUID)=0 |
| virtual void | WaitForUpdateResourceStateCompletion (UID resourceUID)=0 |
| virtual ErrorCode | ResolveResource (UID resourceUID, const URI &relativeURI, bool bIgnoreStamp)=0 |
| virtual uint32 | QueryResources (const LinkResourceQuery &query, LinkClientID clientId, QueryResult &result) const =0 |
| uint32 | QueryResources (const LinkResourceQuery &query, QueryResult &result) const |
| virtual uint32 | QueryResources (const LinkResourceQuery &query, LinkClientID clientId, UIDList &result) const =0 |
| uint32 | QueryResources (const LinkResourceQuery &query, UIDList &result) const |
| virtual ClassID | GetResourceProviderByScheme (const WideString &scheme) const =0 |
Link methods | |
| virtual UID | CreateLink (ILink::LinkType type, LinkClientID clientId, UID resourceUID, UID objectUID)=0 |
| virtual UID | CreateLink (ClassID classID, LinkClientID clientId, UID resourceUID, UID objectUID)=0 |
| virtual ErrorCode | DeleteLink (UID linkUID, bool bDeleteResource)=0 |
| virtual ILink * | QueryLinkByUID (UID linkUID) const =0 |
| virtual uint32 | QueryLinks (const LinkQuery &query, LinkClientID clientId, QueryResult &result) const =0 |
| uint32 | QueryLinks (const LinkQuery &query, QueryResult &result) const |
| virtual uint32 | QueryLinks (const LinkQuery &query, LinkClientID clientId, UIDList &result) const =0 |
| uint32 | QueryLinks (const LinkQuery &query, UIDList &result) const |
| virtual uint32 | QueryLinksByResourceUID (UID resourceUID, bool bChildLinksOK, QueryResult &result) const =0 |
| virtual uint32 | QueryLinksByResourceUID (UID resourceUID, bool bChildLinksOK, UIDList &result) const =0 |
| virtual uint32 | QueryLinksByObjectUID (UID objectUID, QueryResult &result) const =0 |
| virtual uint32 | QueryLinksByObjectUID (UID objectUID, UIDList &result) const =0 |
LinkObject methods | |
| virtual ILinkObject * | QueryObjectByUID (UID objectUID) 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 |
ILinkManager is used to own and manage all ILink and ILinkResource objects in a document. In addition the manager maintains Meta information on every link and resource that can be easily and quickly queried using a LinkQuery or LinkResourceQuery.
There should be one, and only one, ILinkManager per InDesign database. However, different flavors of links can be differentiated by the LinkClientID. For example, InDesign placed links all have a client identifier of kIDLinkClientID, and hyperlinks have a client id of kHyperlinkLinkClientID. Both flavors of links are managed by the same manager, but the manager prevents links and resources with different client ids from interacting with each other. Therefore, a link with a client id of kIDLinkClientID cannot link a resource with a client id of kHyperlinkLinkClientID. The client ids can also be utilized to control where and how the links and resources are displayed to the user. For example, the Links Panel only shows links and resources with a client id of kIDLinkClientID; hyperlinks have their own UI.
Most operations provided by the manager, with the exception of queries, should be initiated from the ILinkFacade.
| typedef std::vector<UID> ILinkManager::QueryResult |
A QueryResult is used to contain the results of a LinkQuery and LinkResourceQuery.
| pure virtual |
Cancels an asynchronous link resource state update request.
| resourceUID | [IN] UID of the link resource to cancel the asynchronous request for. |
| pure virtual |
Creates a new link of the given type.
| type | [IN] Type of link to create. |
| clientId | [IN] Link client identifier of the link to create. The id must match the client id of the resource. |
| resourceUID | [IN] UID of the link resource to link. |
| objectUID | [IN] UID of the link object to link. |
| pure virtual |
Creates a new link of the given class.
| classID | [IN] Class identifier of link to create. |
| clientId | [IN] Link client identifier of the link to create. The id must match the client id of the resource. |
| resourceUID | [IN] UID of the link resource to link. |
| objectUID | [IN] UID of the link object to link. |
| pure virtual |
Creates a new link resource from a URI.
| uri | [IN] URI of the link resource to create. |
| clientId | [IN] Link client identifier of the resource to create. |
| bUseExisting | [IN] Denotes whether to return the UID of an existing link resource if one already exists with the given URI. Pass true to return the UID of an existing link resource if possible, false to always create a new link resource. |
| pure virtual |
Deletes a link.
| linkUID | [IN] UID of the link to delete. |
| bDeleteResource | [IN] Denotes whether to delete the link resource held by the link if it is not referenced by any other link. |
| pure virtual |
Deletes a link resource. \ An resource that is currently referenced by a link cannot be deleted. \ The resource's child resources (and associated child links) are also deleted as long as no other resources or links reference them.
| resourceUID | [IN] UID of the link resource to delete. |
| pure virtual |
Returns the class id of the link resource provider associated with the given scheme.
| scheme | [IN] Scheme to get the link resource provider for. |
| pure virtual |
Returns whether any links or link resources are in the process of being added, deleted or changed.
Returns the link with the given UID.
| linkUID | [IN] UID of the link to retrieve. |
| pure virtual |
Returns the UIDs of the links that match the given query.
| query | [IN] Query to perform on the links. |
| clientId | [IN] Link client identifier of the links to query. |
| result | [OUT] UIDs of the links that match the query. |
| pure virtual |
Returns the UIDs of the links that link the given object.
| objectUID | [IN] UID of the link object. |
| result | [OUT] UIDs of the links that link the given object. |
| pure virtual |
Returns the UIDs of the links that link the given resource.
| resourceUID | [IN] UID of the link resource. |
| bChildLinksOK | [IN] Denotes whether to include child links in the results. |
| result | [OUT] UIDs of the links that link the given resource. |
| pure virtual |
Returns the link object with the given UID.
| objectUID | [IN] UID of the link object to retrieve. |
| pure virtual |
Returns the link resource with the given UID.
| resourceUID | [IN] UID of the link resource to retrieve. |
| pure virtual |
Returns the UIDs of the link resources that match the given query.
| query | [IN] Query to perform on the link resources. |
| clientId | [IN] Link client identifier of the resources to query. |
| result | [OUT] UIDs of the link resources that match the query. |
| pure virtual |
Reinitializes a link resource with a the given URI while preserving the link resource's current UID. The state of the link resource is the same as if it were newly created.
| resourceUID | [IN] UID of the link resource to reintialize. |
| uri | [IN] URI of the link resource. |
| updateResourceStateSync | [IN] whether the linkResource state should be updated synchronously |
| pure virtual |
Attempts to automatically (find without user interaction) the location of a link resource.
| resourceUID | [IN] UID of the link resource to resolve. |
| relativeURI | [IN] Relative location of where to start the search. \ For example, this is often the location of the document, and depending upon the protocal of the link may not be utilized. |
| bIgnoreStamp | [IN] Denotes whether to ignore the resource's stamp when looking for potential matches. |
| pure virtual |
Updates the state of a link resource.
| resourceUID | [IN] UID of the link resource to update. |
| opType | [IN] Denotes whether to perform the state update operation asynchronously or synchronously. |
| pure virtual |
Wait for the asynchronous link resource state update request to get completed.
| resourceUID | [IN] UID of the link resource whose asynchronous request needs to be completed. |