InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CLinkObject Class Reference

#include <CLinkObject.h>

Inheritance diagram for CLinkObject:
CPMUnknown< ILinkObject >ILinkObjectIPMUnknown

Public Types

typedef CPMUnknown< ILinkObjectinherited
 
typedef object_type data_type
 

Public Member Functions

 CLinkObject (IPMUnknown *boss)
 
virtual LinkClientID GetClientID () const
 
virtual bool IsDirectLink () const
 
virtual IPMUnknownQueryLinkedObject (const PMIID &interfaceId) const
 
virtual bool CanUpdate (const ILinkResource *iResource, UID linkUID, UIFlags uiFlags, ErrorCode &err) const
 
virtual ClassID GetImportProvider (const ILinkResource *iResource, UID linkUID) const
 
virtual ClassID GetExportProvider (const ILinkResource *iResource, UID linkUID) const
 
virtual ClassID GetResolveProvider (const ILinkResource *iResource, UID linkUID) const
 
virtual UIDList GetLinks () const
 
virtual void MarkLinksModified () const
 
virtual void ClearLinksModified () const
 
virtual void ReadWrite (IPMStream *s, ImplementationID prop)
 
- Public Member Functions inherited from CPMUnknown< ILinkObject >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Attributes

LinkClientID fClientId
 
- Protected Attributes inherited from CPMUnknown< ILinkObject >
HelperInterface fHelperInterface
 

Additional Inherited Members

- Protected Member Functions inherited from CPMUnknown< ILinkObject >
 CPMUnknown (IPMUnknown *boss)
 

Detailed Description

CLinkObject is a pure virtual base class that inherits from ILinkObject and maintains and persists a list of the links referenced by the object. The class also stores and persists the client identifier of the link object.

All classes that implement the ILinkObject interface should inherit from the CLinkObject class.

See Also
ILinkObject

Member Function Documentation

virtual bool CLinkObject::CanUpdate (const ILinkResourceiResource,
UID linkUID,
UIFlags uiFlags,
ErrorCode & err 
) const
inlinevirtual

Determines if an update should be allowed to proceed.

Parameters
iResource[IN] Associated link resource.
linkUID[IN] UID of the associated link.
uiFlags[IN] Denotes whether to allow UI.
err[OUT] Error code.
Returns
True to proceed with the update, else false.

Implements ILinkObject.

virtual void CLinkObject::ClearLinksModified () const
virtual

Called to notify all associated links that the object in no longer modified.

Implements ILinkObject.

virtual LinkClientID CLinkObject::GetClientID () const
inlinevirtual

Returns the object's link client identifier.

Returns
Object's link client identifier.

Implements ILinkObject.

virtual ClassID CLinkObject::GetExportProvider (const ILinkResourceiResource,
UID linkUID 
) const
inlinevirtual

Returns the class id of the update link service provider used to export the contents of the object out to an resource.

Parameters
iResource[IN] Link resource to export to.
linkUID[IN] UID of the associated link.
Returns
Id of the update link service provider to use to export. kInvalidClass if no provider is available and the object should do the export.

Implements ILinkObject.

virtual ClassID CLinkObject::GetImportProvider (const ILinkResourceiResource,
UID linkUID 
) const
inlinevirtual

Returns the class id of the update link service provider used to import the contents of an resource into the object.

Parameters
iResource[IN] Link resource to import from.
linkUID[IN] UID of the associated link.
Returns
Id of the update link service provider to use to import. kInvalidClass if no provider is available and the object should do the import.

Implements ILinkObject.

virtual UIDList CLinkObject::GetLinks () const
inlinevirtual

Gets the list of links that reference the object.

Returns
List of links that reference the object.

Implements ILinkObject.

virtual ClassID CLinkObject::GetResolveProvider (const ILinkResourceiResource,
UID linkUID 
) const
inlinevirtual

Returns the class id of the update link service provider used to export and/or an import when both the object and the link resource have changed and the link needs to perform an update

Parameters
iResource[IN] Link resource that has also changed.
linkUID[IN] UID of the associated link.
Returns
Id of the update link service provider to use to resolve. kInvalidClass if no provider is available and the object should do the resolve.

Implements ILinkObject.

virtual bool CLinkObject::IsDirectLink () const
inlinevirtual

Determines whether this object is on the same boss as the object that owns the link (a direct link), or is on a different boss than the object that owns the link (an indirect link). \ A UID based object like a page item is an example of a direct link. A non-UID based object like an XML element is an example of an indirect link.

Returns
True if the link is a direct link, else false if an indirect link.

Implements ILinkObject.

virtual void CLinkObject::MarkLinksModified () const
virtual

Called to notify all associated links that the object has been modified.

Implements ILinkObject.

virtual IPMUnknown* CLinkObject::QueryLinkedObject (const PMIIDinterfaceId) const
virtual

Returns the object with the given interface identifier that is on the same boss as the object that owns the link. \ If a direct link, the returned object will be on the same boss as this object. If an indirect link, the returned object will be on a different boss.

Parameters
interfaceId[IN] Interface identifier of the object to retrieve.
Returns
Object with the given interface identifier. \ Nil if the no object can be instantiated.

Implements ILinkObject.

virtual void CLinkObject::ReadWrite (IPMStreams,
ImplementationID prop 
)
virtual

If you override this implementation, please ensure you either write the UID of any link that points to this link object, or call into this implementation. This is needed to ensure the link relationships are (re)created when copying and pasting within and between documents.

See Also
ILinkObject

Member Data Documentation

LinkClientID CLinkObject::fClientId
protected

The object's link client identifier. Objects are only allowed to link with links and resource that have the same client identifier.