Accessibility
IDataLinkHelper
API classesBoss classesText interfacesSample plug-insSamples by typeCommonSnippetsBuild number
                   

IDataLinkHelper Class Reference

This interface contains helper methods related to IDataLink. More...

#include <IDataLinkHelper.h>

Inheritance diagram for IDataLinkHelper:

IPMUnknownList of all members.

Public Types

enum  { kDefaultIID = IID_IDATALINKHELPER }

Public Methods

virtual int32 AddDataLink (IDataBase *db, UID pageitem, IDataLink *dl, ClassID provider=0, PMString *formatName=nil)=0
 Add the specified data link to a document.

virtual int32 AddMultipleDataLinks (IDataBase *db, UID pageitem, K2Vector< PMString * > *stringList, K2Vector< PMString * > *formatNameList, ICommand **pCommand, IDataLink *defaultPath)=0
 Add multiple data links to a document.

virtual int32 RemoveDataLink (const UIDList *itemList)=0
 Remove one or more data links from a document.

virtual int32 GetLinkedFile (IDataBase *db, UID pageitem, SysFile *sysfile)=0
 Get the data link's SysFile if the file exists and it is a file type data link (kDataLinkBoss).

virtual IPMStreamCreateLinkedStream (IDataBase *db, UID pageitem)=0
 Create a stream that contains the data link's data.

virtual UID GetFirstPageItemUID (IDataBase *db, UID pageItemUID)=0
 Get the first page item UID associated with the linked item.

virtual void GetAssociatedDataLinks (IDataBase *db, UID pageitemUID, UIDList *list)=0
 Get all the data links associated with the given page item.

virtual void GetPageNumber (IDataLink *dl, PMString *pagenumber, int32 *pgNumber, bool16 bAbbreviate=kTrue, bool16 bReversePref=kFalse)=0
 Get the page number of the given data link.

virtual bool16 HasInternalDataChanged (IDataLink *dl)=0
 Determine whether the internal data we maintain has been edited by the user.

virtual bool16 IsLinkNeeded (IDataLink *dl)=0
 Determine whether the link is needed.

virtual void GetExtension (PMString &basename, PMString &extension)=0
 Get the file extension for the given base name.

virtual IDataLinkCreateDataLink (const SysFile &file, PMString *formatName=nil)=0
 Create a data link given a SysFile.

virtual ErrorCode InitializeDataLink (IPMUnknown *boss, const SysFile &file, PMString *formatName=nil)=0
 Set up a data link off the given boss with the given SysFile and format string.

virtual UID NewDataLinkUID (IDataBase *db, IDataLink *dl)=0
 Create a new data link based on the given datalink in the given database.

virtual UID FindAssociatedPageItem (IDataBase *db, UID uid)=0
 Find a page item in the page item hierarchy that has an associated IDataLink.

virtual int32 SetFormatName (IDataLink *dl, PMString &formatName)=0
 Set the format string of the given data link.

virtual bool16 IsLinkMissing (IDataBase *db, UID pageItemUID)=0
 Return whether a link is missing or not.

virtual void GetSelectedDataLinks (UIDList *pageItemUIDs, UIDList *dataLinkUIDs)=0
 Given a list of page item UIDs, return all their associated data links including data links of their children.

virtual bool16 CheckLinks (IDocument *document)=0
 Check links before printing.

virtual IDataLinkCreateDataLinkFromString (const PMString &filename, const PMString &formatName, IDataLink *defaultPath)=0
 Create a data link given a filename string.

virtual ICoreFilenameCreatePublicationDir (IDataBase *db)=0
 Get the publication's directory.

virtual void GetNameInfoFromEmbedded (IDataBase *db, UID pageitem, NameInfo *ni, PMString *formatName, uint32 *filetype)=0
 Get the page item's provider and ask it for the format name and type.

virtual ErrorCode CreateFileFromEmbedded (IDataBase *db, UID pageitem, ICoreFilename *cfn)=0
 Create a file from the embedded data.

virtual ICoreFilenameCreateCoreFilename (IDataLink *dl)=0
 Create a ICoreFilename from the given data link for file type links (kDataLinkBoss).

virtual IDataLink::StateType AutoFindFile (NameInfo *pubdirni, IDataLink *dl, IMissingLink *missingLink=nil)=0
 Search for a data link using several fast search strategies.

virtual void GetOPIName (IDataBase *db, UID pageitem, PMString &name)=0
 Get the OPI name of the given page item.

virtual uint64 GetUIDSize (IDataBase *db, UID uid)=0
 Get the size of a UID.

virtual UID GetAssociatedPageItem (IDataLink *dl)=0
 Get the page item associated with the given data link.

virtual PMString GetPageItemName (IDataLink *dl)=0
 Get the name of the page item.

virtual ErrorCode GetSysFile (IDataLink *dl, SysFile &sysFile)=0
 Get the data link's SysFile for file type links (kDataLinkBoss).


Detailed Description

This interface contains helper methods related to IDataLink.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
kDefaultIID 

00047 { kDefaultIID = IID_IDATALINKHELPER };

Member Function Documentation

virtual int32 AddDataLink IDataBase  db,
UID   pageitem,
IDataLink  dl,
ClassID   provider = 0,
PMString  formatName = nil
[pure virtual]
 

Add the specified data link to a document.

Parameters:
IDataBase  *db: The document where the data link is added.
UID  pageitem: The page item of the associated data link.
ClassID  provider: The ClassID of the import provider used to import the data.
PMString  *formatName: The format of the linked data. This string is shown in the Link Information dialog.
Returns:
int32: Return 0 when successful.

virtual int32 AddMultipleDataLinks IDataBase  db,
UID   pageitem,
K2Vector< PMString * > *   stringList,
K2Vector< PMString * > *   formatNameList,
ICommand **   pCommand,
IDataLink  defaultPath
[pure virtual]
 

Add multiple data links to a document.

For example, OPI links of a placed EPS file.

Parameters:
IDataBase  *db: The document where the data links are added.
UID  pageitem: The page item of the associated data links.
K2Vector<PMString  *> *stringList: A list of file specifications. One string for each data link. If full paths are not specified and defaultPath is specified, it used for the path.
K2Vector<PMString  *> *formatNameList: A list of formats, one for each data link.
ICommand  **pCommand: Pass nil, or to take owner ship of the command for release later pass in a command pointer.
IDataLink  *defaultPath: Pass nil, or pass a data link pointer to use as the directory to look for the links when they are specified without path information.
Returns:
int32: Return 0 when successful.

virtual IDataLink::StateType AutoFindFile NameInfo *   pubdirni,
IDataLink  dl,
IMissingLink  missingLink = nil
[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));
Returns:
IDataLink::StateType: The state of the link, found, missing or modified.

virtual bool16 CheckLinks IDocument  document [pure virtual]
 

Check links before printing.

Return true when it is OK to print without warning.

Parameters:
IDocument  *document: Document to check.
Returns:
bool16: Return true when it is OK to print.

virtual ICoreFilename* CreateCoreFilename IDataLink  dl [pure virtual]
 

Create a ICoreFilename from the given data link for file type links (kDataLinkBoss).

Parameters:
IDataLink  *dl: Data link pointer.
Returns:
ICoreFilename *: Return nil on failure.

virtual IDataLink* CreateDataLink const SysFile  file,
PMString  formatName = nil
[pure virtual]
 

Create a data link given a SysFile.

Parameters:
const SysFile &file: The SysFile.
PMString  *formatName = nil: The optional format string of describing the file data.
Returns:
IDataLink *: Return nil on failure.

virtual IDataLink* CreateDataLinkFromString const PMString  filename,
const PMString  formatName,
IDataLink  defaultPath
[pure virtual]
 

Create a data link given a filename string.

Parameters:
const PMString &filename: The filename string.
PMString  &formatName: The format string of describing the file data.
IDataLink  *defaultPath: The path to use when the filename doesn't contain a path.
Returns:
IDataLink *: New data link, return nil on failure.

virtual ErrorCode CreateFileFromEmbedded IDataBase  db,
UID   pageitem,
ICoreFilename  cfn
[pure virtual]
 

Create a file from the embedded data.

Parameters:
IDataBase  *db: The document containing the page item.
UID  pageitem: The page item of the associated data link.
ICoreFilename  *cfn: The file to create.
Returns:
ErrorCode: kSuccess when successful.

virtual IPMStream* CreateLinkedStream IDataBase  db,
UID   pageitem
[pure virtual]
 

Create a stream that contains the data link's data.

Parameters:
IDataBase  *db: The document containing the page item and data link.
UID  pageitem: The page item of the associated data link.
Returns:
IPMStream *: Return nil on failure.

virtual ICoreFilename* CreatePublicationDir IDataBase  db [pure virtual]
 

Get the publication's directory.

Parameters:
IDataBase  *db: The document.
Returns:
ICoreFilename *: Return nil on failure.

virtual UID FindAssociatedPageItem IDataBase  db,
UID   uid
[pure virtual]
 

Find a page item in the page item hierarchy that has an associated IDataLink.

Look first at the given page item then its children. Return the first page item that has a data link.

Parameters:
IDataBase  *db: The document containing the page item and data link.
UID:  Page item UID.
Returns:
UID: Return page item UID.

virtual void GetAssociatedDataLinks IDataBase  db,
UID   pageitemUID,
UIDList  list
[pure virtual]
 

Get all the data links associated with the given page item.

Parameters:
IDataBase  *db: The document containing the page item and data link.
UID  pageitemUID: The page item of the associated data link.
UIDList  *list: The list is filled in with IDataLink UIDs.

virtual UID GetAssociatedPageItem IDataLink  dl [pure virtual]
 

Get the page item associated with the given data link.

The page item is in the same data base as the data link.

Parameters:
IDataLink  *dl: Data link pointer.
Returns:
UID: Page item UID.

virtual void GetExtension PMString  basename,
PMString  extension
[pure virtual]
 

Get the file extension for the given base name.

Parameters:
PMString  &basename: The base name.
PMString  &extension: Return the file extension.

virtual UID GetFirstPageItemUID IDataBase  db,
UID   pageItemUID
[pure virtual]
 

Get the first page item UID associated with the linked item.

For non-text items it just returns the given UID. For text items it returns the UID of the first frame that contains the text.

Parameters:
IDataBase  *db: The document containing the page item and data link.
UID  pageitem: The page item of the associated data link.
Returns:
UID: Return kInvalidUID on failure.

virtual int32 GetLinkedFile IDataBase  db,
UID   pageitem,
SysFile  sysfile
[pure virtual]
 

Get the data link's SysFile if the file exists and it is a file type data link (kDataLinkBoss).

Parameters:
IDataBase  *db: The document containing the page item and data link.
UID  pageitem: The page item of the associated data link.
Returns:
int32: Return 0 when successful.

virtual void GetNameInfoFromEmbedded IDataBase  db,
UID   pageitem,
NameInfo *   ni,
PMString  formatName,
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.
UID  pageitemUID: The page item of the associated data link.
NameInfo  *ni: Return name information.
PMString  *formatName: Return format string.
uint32  *filetype: Return file type.

virtual void GetOPIName IDataBase  db,
UID   pageitem,
PMString  name
[pure virtual]
 

Get the OPI name of the given page item.

If there is no OPI name, the empty string is returned.

Parameters:
IDataBase  *db: The document containing the page item.
UID  pageItemUID: Page item UID.
PMString  &name: Return the OPI filename string, or an empty string.

virtual PMString GetPageItemName IDataLink  dl [pure virtual]
 

Get the name of the page item.

This is the name displayed in the Links palette.

Parameters:
IDataLink  *dl: Data link pointer.
Returns:
PMString: Name of the page item.

virtual void GetPageNumber IDataLink  dl,
PMString  pagenumber,
int32  pgNumber,
bool16   bAbbreviate = kTrue,
bool16   bReversePref = kFalse
[pure virtual]
 

Get the page number of the given data link.

Parameters:
IDataLink  *dl: Data link pointer.
PMString  *pagenumber: Return parameter, the page number string.
int32  *pgNumber: Return parameter, the page number as a number.
bool16  bAbbreviate = kTrue: Whether to abbreviate the page number string.
bool16  bReversePref = kFalse: Whether to reverse the numbering style for the page number string.

virtual void GetSelectedDataLinks UIDList  pageItemUIDs,
UIDList  dataLinkUIDs
[pure virtual]
 

Given a list of page item UIDs, return all their associated data links including data links of their children.

Parameters:
UIDList  *pageItemUIDs: List of page items.
UIDList  *dataLinkUIDs: The list is filled with IDataLink UIDs.

virtual ErrorCode GetSysFile IDataLink  dl,
SysFile  sysFile
[pure virtual]
 

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

Parameters:
IDataLink  *dl: Data link pointer.
SysFile&  sysFile: Return SysFile.
Returns:
ErrorCode: kSuccess when successful.

virtual uint64 GetUIDSize IDataBase  db,
UID   uid
[pure virtual]
 

Get the size of a UID.

Parameters:
IDataBase  *db: The document containing the UID.
UID  uid: UID.
Returns:
uint64: Size of the UID.

virtual bool16 HasInternalDataChanged IDataLink  dl [pure virtual]
 

Determine whether the internal data we maintain has been edited by the user.

For example, whether the user has edited text using InDesign.

Parameters:
IDataLink  *dl: Data link pointer.
Returns:
bool16: Return whether the internal data has been changed.

virtual ErrorCode InitializeDataLink IPMUnknown  boss,
const SysFile  file,
PMString  formatName = nil
[pure virtual]
 

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

Parameters:
IPMUnknown  *boss: A boss that holds an IDataLink.
const SysFile &file: The SysFile.
PMString  *formatName = nil: The optional format string of describing the file data.
Returns:
ErrorCode: Return kSuccess when successful.

virtual bool16 IsLinkMissing IDataBase  db,
UID   pageItemUID
[pure virtual]
 

Return whether a link is missing or not.

Parameters:
IDataBase  *db: The document containing the page item and data link.
UID  pageitemUID: The page item of the associated data link.
Returns:
bool16: Return true when the link is missing (not found).

virtual bool16 IsLinkNeeded IDataLink  dl [pure virtual]
 

Determine whether the link is needed.

For small images the proxy image contains all the data exactly as on disk.

Parameters:
IDataLink  *dl: Data link pointer.
Returns:
bool16: Return whether the link is needed.

virtual UID NewDataLinkUID IDataBase  db,
IDataLink  dl
[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 RemoveDataLink const UIDList  itemList [pure virtual]
 

Remove one or more data links from a document.

Embedded data is removed for embedded links.

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

virtual int32 SetFormatName IDataLink  dl,
PMString  formatName
[pure virtual]
 

Set the format string of the given data link.

Parameters:
IDataLink  *dl: Data link pointer.
PMString  &formatName: The format string describing the data.
Returns:
int32: Return 0 when successful.

The documentation for this class was generated from the following file:

Boss classes that aggregate this interface