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

#include <IDataLinkHelper.h>

Inheritance diagram for IDataLinkHelper:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDATALINKHELPER }
 

Public Member Functions

virtual int32 RemoveDataLink (const UIDList *itemList)=0
 
virtual void GetExtension (PMString &basename, PMString &extension)=0
 
virtual IDataLinkCreateDataLink (const IDFile &file, PMString *formatName=nil)=0
 
virtual ErrorCode InitializeDataLink (IPMUnknown *boss, const IDFile &file, PMString *formatName=nil)=0
 
virtual UID NewDataLinkUID (IDataBase *db, IDataLink *dl)=0
 
virtual bool16 IsLinkMissing (IDataBase *db, UID pageItemUID)=0
 
virtual ICoreFilenameCreatePublicationDir (IDataBase *db)=0
 
virtual void GetNameInfoFromEmbedded (IDataBase *db, UID pageitem, NameInfo *ni, PMString *formatName, uint32 *filetype)=0
 
virtual IDataLink::StateType AutoFindFile (NameInfo *pubdirni, IDataLink *dl, IMissingLink *missingLink=nil, bool32 bIgnoreDateTime=kFalse)=0
 
virtual uint64 GetUIDSize (IDataBase *db, UID uid)=0
 
virtual ErrorCode GetSysFile (IDataLink *dl, IDFile &sysFile)=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 interface contains helper methods related to IDataLink.

Member Function Documentation

virtual IDataLink::StateType IDataLinkHelper::AutoFindFile (NameInfo * pubdirni,
IDataLinkdl,
IMissingLinkmissingLink = nil,
bool32 bIgnoreDateTime = kFalse 
)
pure virtual

Search for a data link using several fast search strategies.

Parameters
NameInfo*pubdirni: Directory to use when looking for relative positioned links.
IDataLink*dl: Data link pointer.
IMissingLink*missingLink = nil: Optional parameter to speed up searching when repeatedly calling AutoFindFile for many missing links. Can use InterfacePtr<IMissingLink> missingLink((IMissingLink *)::CreateObject(kMissingLinkBoss, IID_IMISSINGLINK));
bool32bIgnoreDateTime = kFalse: [IN] if kFalse, then any potential matches will be ignored if the modification date is more than 1 hour different from the date/time returned via dl->GetStoredState(). If kTrue, then the date/time of potential matches is ignored.
Returns
IDataLink::StateType: The state of the link, found, missing or modified.
virtual IDataLink* IDataLinkHelper::CreateDataLink (const IDFilefile,
PMStringformatName = nil 
)
pure virtual

Create a data link given a IDFile.

Parameters
constIDFile &file: The IDFile.
PMString*formatName = nil: The optional format string of describing the file data.
Returns
IDataLink *: Return nil on failure.
virtual ICoreFilename* IDataLinkHelper::CreatePublicationDir (IDataBasedb)
pure virtual

Get the publication's directory.

Parameters
IDataBase*db: The document.
Returns
ICoreFilename *: Return nil on failure.
virtual void IDataLinkHelper::GetExtension (PMStringbasename,
PMStringextension 
)
pure virtual

Get the file extension for the given base name.

Parameters
PMString&basename: The base name.
PMString&extension: Return the file extension.
virtual void IDataLinkHelper::GetNameInfoFromEmbedded (IDataBasedb,
UID pageitem,
NameInfo * ni,
PMStringformatName,
uint32 * filetype 
)
pure virtual

Get the page item's provider and ask it for the format name and type. Make up the name.

Parameters
IDataBase*db: The document containing the page item and data link.
UIDpageitemUID: The page item of the associated data link.
NameInfo*ni: Return name information.
PMString*formatName: Return format string.
uint32*filetype: Return file type.
virtual ErrorCode IDataLinkHelper::GetSysFile (IDataLinkdl,
IDFilesysFile 
)
pure virtual

Get the data link's IDFile for file type links (kDataLinkBoss).

Parameters
IDataLink*dl: Data link pointer.
IDFile&sysFile: Return IDFile.
Returns
ErrorCode: kSuccess when successful.
virtual uint64 IDataLinkHelper::GetUIDSize (IDataBasedb,
UID uid 
)
pure virtual

Get the size of a UID.

Parameters
IDataBase*db: The document containing the UID.
UIDuid: UID.
Returns
uint64: Size of the UID.
virtual ErrorCode IDataLinkHelper::InitializeDataLink (IPMUnknownboss,
const IDFilefile,
PMStringformatName = nil 
)
pure virtual

Set up a data link off the given boss with the given IDFile and format string.

Parameters
IPMUnknown*boss: A boss that holds an IDataLink.
constIDFile &file: The IDFile.
PMString*formatName = nil: The optional format string of describing the file data.
Returns
ErrorCode: Return kSuccess when successful.
virtual bool16 IDataLinkHelper::IsLinkMissing (IDataBasedb,
UID pageItemUID 
)
pure virtual

Return whether a link is missing or not.

Parameters
IDataBase*db: The document containing the page item and data link.
UIDpageitemUID: The page item of the associated data link.
Returns
bool16: Return true when the link is missing (not found).
virtual UID IDataLinkHelper::NewDataLinkUID (IDataBasedb,
IDataLinkdl 
)
pure virtual

Create a new data link based on the given datalink in the given database.

Parameters
IDataBase*db: The document containing the data link.
IDataLink*dl: Data link pointer.
Returns
UID: UID of a new IDataLink or kInvalidUID on failure.
virtual int32 IDataLinkHelper::RemoveDataLink (const UIDListitemList)
pure virtual

Remove one or more data links from a document. Embedded data is removed for embedded links.

Parameters
constUIDList* itemList: A list of page items. The associated data links of these page items are deleted.
Returns
int32: Return 0 when successful.