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

#include <IDatalink.h>

Inheritance diagram for IDataLink:
IPMUnknownCPMUnknown< IDataLink >CusDtLnkAliasedDataLink

Public Types

enum  { kDefaultIID = IID_IDATALINK }
 
enum  StateType { kLinkNormal = 0, kLinkOutOfDate, kLinkMissing, kEmbedded }
 

Public Member Functions

virtual void ReadWrite (IPMStream *s, ImplementationID prop)=0
 
virtual int32 GetNameInfo (NameInfo *ni, PMString *formatName, uint32 *filetype)=0
 
virtual StateType GetStoredState (uint64 *size, uint64 *time)=0
 
virtual PMStringGetBaseName ()=0
 
virtual PMStringGetFullName ()=0
 
virtual int32 SetNameInfo (NameInfo *ni, PMString *formatName, uint32 filetype, const PMString *fullPath=nil)=0
 
virtual int32 SetStoredState (uint64 *size, uint64 *time, StateType state)=0
 
virtual int32 Combine (NameInfo *dirname, NameInfo *newname)=0
 
virtual bool16 CompareBaseName (NameInfo *ni)=0
 
virtual bool16 CompareDirectory (NameInfo *ni)=0
 
virtual bool16 FindRelative (NameInfo *dirname, NameInfo *newname, ProgressParam *pp)=0
 
virtual StateType GetCurrentState (NameInfo *ni, uint64 *size, uint64 *time, uint32 *filetype, ProgressParam *pp)=0
 
virtual int32 Copy (NameInfo *dirname, ProgressParam *pp)=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

This file defines an interface for linking to data. The links UI uses goes through this interface to get all the information it needs about the link. DataLink.cpp implements this interface for files (Macintosh and Windows files in a core way). Other implementations could be written. In the design I planned for URL files (files on the internet), OLE linked files, and "files" stored in a database.

Member Enumeration Documentation

The current (or stored) state of a link.
Enumerator
kLinkNormal 

The link is up-to-date and not missing.

kLinkOutOfDate 

The link has been modified but not updated.

kLinkMissing 

The link could not be found.

kEmbedded 

The file has been embedded in the InDesign document.

Member Function Documentation

virtual int32 IDataLink::Combine (NameInfo * dirname,
NameInfo * newname 
)
pure virtual

Creates new name information for a link by combining the current link's basename with the directory specified by the dirname parameter. Combine is used by the find missing command to look for missing links in other directories.

Parameters
dirname[IN] The directory to prepend to the basename
newName[OUT] The name created by adding dirname to basename
Returns
0 when the routine is successful.

Implemented in CusDtLnkAliasedDataLink.

virtual bool16 IDataLink::CompareBaseName (NameInfo * ni)
pure virtual

Determines whether the given name information has the same basename as the current link.

Parameters
ni[IN] The NameInfo to compare this link's basename with
Returns
kTrue when ni specifies the same basename.

Implemented in CusDtLnkAliasedDataLink.

virtual bool16 IDataLink::CompareDirectory (NameInfo * ni)
pure virtual

Determines whether the given directory is the same the the current link.

Parameters
ni[IN] The NameInfo to compare this link's directory with
Returns
kTrue when ni specifies the same directory.

Implemented in CusDtLnkAliasedDataLink.

virtual int32 IDataLink::Copy (NameInfo * dirname,
ProgressParampp 
)
pure virtual

Used to make a copy of a link in the specified directory.

Parameters
dirname[OUT] Will be filled with the link information
ppspecifies a callback routine that should be called to give the user feedback on slow operations.
Returns
0 when the routine is successful.

Implemented in CusDtLnkAliasedDataLink.

virtual bool16 IDataLink::FindRelative (NameInfo * dirname,
NameInfo * newname,
ProgressParampp 
)
pure virtual

Looks for the current link by looking relative to the given directory. This operation should be fairly fast. Searching the whole disk is currently too slow.

Parameters
dirname[IN] The original nameinfo of the file we are looking for
newname[OUT] Filled with the new name of a link if it is found
ppSpecifies a callback routine that should be called to give the user feedback on slow operations
Returns
kTrue indicates that the link was found.

Implemented in CusDtLnkAliasedDataLink.

virtual PMString* IDataLink::GetBaseName ()
pure virtual

Returns a string pointer to a short name that identifies the link. This is the string shown in the links palette. For file links the base name is the filename without any directory information.

Returns
The string containing the name of the link. NOTE: The string pointer returned is maintained by this interface and must not be freed.

Implemented in CusDtLnkAliasedDataLink.

virtual StateType IDataLink::GetCurrentState (NameInfo * ni,
uint64 * size,
uint64 * time,
uint32 * filetype,
ProgressParampp 
)
pure virtual

GetCurrentState gets the link's size, time and type by looking at the link on disk.

Parameters
ni[OUT] The link to get info on. If this is 0 the current link will be used
size[OUT] The number of bytes of data that the link represents
time[OUT] The Windows time value, the number of milliseconds since January 1, 1601
filetype[OUT] The Macintosh file type or 0
ppSpecifies a callback routine that should be called to give the user feedback on slow operations
Returns
The current state of this link
See Also
GetStoredState

Implemented in CusDtLnkAliasedDataLink.

virtual PMString* IDataLink::GetFullName ()
pure virtual

Returns a long name that identifies the link. This is the string shown in the links information dialog. For file links the full name is the complete path name.

Returns
The string containing the name of the link. NOTE: The string pointer returned is maintained by this interface and must not be freed.

Implemented in CusDtLnkAliasedDataLink.

virtual int32 IDataLink::GetNameInfo (NameInfo * ni,
PMStringformatName,
uint32 * filetype 
)
pure virtual

Gets the name and type of a link

Parameters
ni[OUT] The name info to be setup
formatName[OUT] The format name of the linked file
filetype[OUT] The file type of the linked file
Returns
Success or Failure (0 = success)

Implemented in CusDtLnkAliasedDataLink.

virtual StateType IDataLink::GetStoredState (uint64 * size,
uint64 * time 
)
pure virtual

If GetCurrentState takes a lot of time and the user cancels it this method can be used to get the state which was last set.

Parameters
size[OUT] The number of bytes of data that the link represents(Optional)
time[OUT] The Windows time value, the number of milliseconds since January 1, 1601 (Optional)
Returns
The stored state of this link
See Also
GetCurrentState

Implemented in CusDtLnkAliasedDataLink.

virtual void IDataLink::ReadWrite (IPMStreams,
ImplementationID prop 
)
pure virtual

Persistence related method; reads from or writes to given stream

Parameters
s[IN] the persistent in and out stream.
prop[IN] the implementation ID

Implemented in CusDtLnkAliasedDataLink.

virtual int32 IDataLink::SetNameInfo (NameInfo * ni,
PMStringformatName,
uint32 filetype,
const PMStringfullPath = nil 
)
pure virtual

Sets the name and type for the link.

Parameters
ni[IN] The information to use when setting up the NameInfo
formatName[IN] The format name for the link
filetype[IN] The file type of the linked file
fullPath[IN] The path to the file
Returns
0 when the routine is successful.

Implemented in CusDtLnkAliasedDataLink.

virtual int32 IDataLink::SetStoredState (uint64 * size,
uint64 * time,
StateType state 
)
pure virtual

Sets the size, time and state information that is stored with the object.

Parameters
size[IN] The number of bytes of data that the link represents (Optional)
time[IN] The Windows time value, the number of milliseconds since January 1, 1601 (Optional)
state[IN] The current state of this link
Returns
0 when the routine is successful.

Implemented in CusDtLnkAliasedDataLink.