InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ILinkManager Class Referenceabstract

#include <ILinkManager.h>

Inheritance diagram for ILinkManager:
IPMUnknown

Classes

class  ChangeData
 

Public Types

enum  { kDefaultIID = IID_ILINKMANAGER }
 
enum  OperationType { kAsynchronous = 0, kSynchronous }
 
typedef std::vector< UIDQueryResult
 

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 ILinkResourceQueryResourceByUID (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 ILinkQueryLinkByUID (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 ILinkObjectQueryObjectByUID (UID objectUID) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

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.

See Also
ILink
ILinkFacade
ILinkObject
ILinkResource
LinkResourceQuery
LinkQuery
UID
URI

Member Typedef Documentation

typedef std::vector<UID> ILinkManager::QueryResult

A QueryResult is used to contain the results of a LinkQuery and LinkResourceQuery.

Member Enumeration Documentation

Identifiers that denote how an resource state update or auto resolve operation should be performed.
Enumerator
kAsynchronous 

Perform the operation asynchronously.

kSynchronous 

Perform the operation synchronously.

Member Function Documentation

virtual void ILinkManager::CancelUpdateResourceState (UID resourceUID)
pure virtual

Cancels an asynchronous link resource state update request.

Parameters
resourceUID[IN] UID of the link resource to cancel the asynchronous request for.
virtual UID ILinkManager::CreateLink (ILink::LinkType type,
LinkClientID clientId,
UID resourceUID,
UID objectUID 
)
pure virtual

Creates a new link of the given type.

Parameters
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.
Returns
UID of the created link. \ kInvalidUID if the create fails.
virtual UID ILinkManager::CreateLink (ClassID classID,
LinkClientID clientId,
UID resourceUID,
UID objectUID 
)
pure virtual

Creates a new link of the given class.

Parameters
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.
Returns
UID of the created link. \ kInvalidUID if the create fails.
virtual UID ILinkManager::CreateResource (const URIuri,
LinkClientID clientId,
bool bUseExisting 
)
pure virtual

Creates a new link resource from a URI.

Parameters
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.
Returns
UID of the created or existing link resource. \ kInvalidUID if the create fails.
virtual ErrorCode ILinkManager::DeleteLink (UID linkUID,
bool bDeleteResource 
)
pure virtual

Deletes a link.

Parameters
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.
Returns
kSuccess if the link is deleted, else an error code.
virtual ErrorCode ILinkManager::DeleteResource (UID resourceUID)
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.

Parameters
resourceUID[IN] UID of the link resource to delete.
Returns
kSuccess if the link resource is deleted, else an error code.
virtual ClassID ILinkManager::GetResourceProviderByScheme (const WideStringscheme) const
pure virtual

Returns the class id of the link resource provider associated with the given scheme.

Parameters
scheme[IN] Scheme to get the link resource provider for.
Returns
Id of the link resource provider associated with the given scheme. kInvalidClass if no provider is associated with the scheme.
virtual bool ILinkManager::IsModelChanging () const
pure virtual

Returns whether any links or link resources are in the process of being added, deleted or changed.

Returns
True if the link or resources are currently being added, deleted or changed; else false.
virtual ILink* ILinkManager::QueryLinkByUID (UID linkUID) const
pure virtual

Returns the link with the given UID.

Parameters
linkUID[IN] UID of the link to retrieve.
Returns
Link with the given UID. \ Nil if the no link is found.
virtual uint32 ILinkManager::QueryLinks (const LinkQueryquery,
LinkClientID clientId,
QueryResultresult 
) const
pure virtual

Returns the UIDs of the links that match the given query.

Parameters
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.
Returns
Number of links that matched the query.
virtual uint32 ILinkManager::QueryLinksByObjectUID (UID objectUID,
QueryResultresult 
) const
pure virtual

Returns the UIDs of the links that link the given object.

Parameters
objectUID[IN] UID of the link object.
result[OUT] UIDs of the links that link the given object.
Returns
Number links that link the given object.
virtual uint32 ILinkManager::QueryLinksByResourceUID (UID resourceUID,
bool bChildLinksOK,
QueryResultresult 
) const
pure virtual

Returns the UIDs of the links that link the given resource.

Parameters
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.
Returns
Number links that link the given resource.
virtual ILinkObject* ILinkManager::QueryObjectByUID (UID objectUID) const
pure virtual

Returns the link object with the given UID.

Parameters
objectUID[IN] UID of the link object to retrieve.
Returns
Link object with the given UID. \ Nil if the no link object is found.
virtual ILinkResource* ILinkManager::QueryResourceByUID (UID resourceUID) const
pure virtual

Returns the link resource with the given UID.

Parameters
resourceUID[IN] UID of the link resource to retrieve.
Returns
Link resource with the given UID. \ Nil if the no link resource is found.
virtual uint32 ILinkManager::QueryResources (const LinkResourceQueryquery,
LinkClientID clientId,
QueryResultresult 
) const
pure virtual

Returns the UIDs of the link resources that match the given query.

Parameters
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.
Returns
Number link resources that matched the query.
virtual ErrorCode ILinkManager::ReinitResource (UID resourceUID,
const URIuri,
bool updateResourceStateSync = true 
)
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.

Parameters
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
Returns
kSuccess if the link resource is successfully reintialized with the given URI, else an error code.
virtual ErrorCode ILinkManager::ResolveResource (UID resourceUID,
const URIrelativeURI,
bool bIgnoreStamp 
)
pure virtual

Attempts to automatically (find without user interaction) the location of a link resource.

Parameters
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.
Returns
kSuccess if the link resource is successfully resolved, else an error code.
virtual ErrorCode ILinkManager::UpdateResourceState (UID resourceUID,
OperationType opType 
)
pure virtual

Updates the state of a link resource.

Parameters
resourceUID[IN] UID of the link resource to update.
opType[IN] Denotes whether to perform the state update operation asynchronously or synchronously.
Returns
kSuccess if the link resource's state is successfully updated, else an error code. \ When performing the operation asynchronously, the returned error code denotes whether the state update request was successfully queued.
virtual void ILinkManager::WaitForUpdateResourceStateCompletion (UID resourceUID)
pure virtual

Wait for the asynchronous link resource state update request to get completed.

Parameters
resourceUID[IN] UID of the link resource whose asynchronous request needs to be completed.