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

#include <IHyperlinkTable.h>

Inheritance diagram for IHyperlinkTable:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IHYPERLINKTABLE }
 
enum  WhichCache {
  kHyperlinks, kSources, kDestinations, kBookmarks,
  kXRefFormats, kAll
}
 

Public Member Functions

virtual void InvalidateNameCache (IHyperlinkTable::WhichCache whichCache)=0
 
virtual bool16 HasExternalDestination () const =0
 
virtual void SetHasExternalDestination (bool16 fHasExternDest)=0
 
virtual void AddHyperlinkSource (const UID hyperlinkSource)=0
 
virtual void RemoveHyperlinkSource (const UID hyperlinkSource)=0
 
virtual int32 GetHyperlinkSourceCount () const =0
 
virtual UID GetNthHyperlinkSource (int32 hyperlinkIndex) const =0
 
virtual int32 GetHyperlinkSourceIndex (const UID hyperlinkSourceUID) const =0
 
virtual void GenerateNewHyperlinkSourceName (PMString *pName)=0
 
virtual void AddHyperlinkDestination (const UID hyperlinkDestination)=0
 
virtual void RemoveHyperlinkDestination (int32 hyperlinkDestinationKey)=0
 
virtual void SwapHyperlinkDestinations (int32 destKey1, int32 destKey2)=0
 
virtual int32 GetHyperlinkDestinationCount () const =0
 
virtual bool16 IsValidHyperlinkDestinationKey (int32 hyperlinkDestinationKey) const =0
 
virtual UID GetHyperlinkDestinationWithKey (int32 hyperlinkKey) const =0
 
virtual void GenerateNewHyperlinkDestinationName (PMString *pName)=0
 
virtual
UniqueKeyToUIDMap::const_iterator 
GetDestinationKeyToUIDMapBeginIter () const =0
 
virtual
UniqueKeyToUIDMap::const_iterator 
GetDestinationKeyToUIDMapEndIter () const =0
 
virtual
UniqueKeyToUIDMap::const_reverse_iterator 
GetDestinationKeyToUIDMapRBeginIter () const =0
 
virtual
UniqueKeyToUIDMap::const_reverse_iterator 
GetDestinationKeyToUIDMapREndIter () const =0
 
virtual void AddHyperlink (const UID hyperlink)=0
 
virtual UID RemoveHyperlink (const UID hyperlinkUID)=0
 
virtual void MoveHyperlink (const UID hyperlink, const UID moveBefore)=0
 
virtual UID GetNthHyperlink (int32 hyperlinkIndex) const =0
 
virtual int32 GetHyperlinkWithUID (const UID hyperlink) const =0
 
virtual int32 GetHyperlinkCount () const =0
 
virtual void GenerateNewHyperlinkName (PMString *pName)=0
 
virtual UID GetHyperlinkOfSource (UIDRef sourceUIDRef) const =0
 
virtual void AddBookmark (const UID bookmark)=0
 
virtual void RemoveBookmark (const UID bookmarkUID)=0
 
virtual void MoveBookmark (const UID bookmark, int32 newLoc)=0
 
virtual UID GetNthBookmark (int32 bookmarkIndex) const =0
 
virtual int32 GetBookmarkWithUID (const UID bookmark) const =0
 
virtual int32 GetBookmarkCount () const =0
 
virtual void GenerateNewHyperlinkBookmarkName (PMString *pName)=0
 
virtual void AddXRefFormat (const UID xRefFormat)=0
 
virtual bool16 RemoveXRefFormat (const UID xRefFormat)=0
 
virtual int32 GetXRefFormatCount () const =0
 
virtual UID GetNthXRefFormat (int32 formatIndex) const =0
 
virtual int32 GetXRefFormatIndex (const UID xRefFormatUID) const =0
 
virtual bool16 HasXRefFormatName (const PMString &name)=0
 
virtual UID GetXRefFormatOfName (const PMString &name)=0
 
virtual void GenerateNewXRefFormatName (PMString *pName)=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

Interface on the document (kDocBoss) that 

manages references to hyperlink sources, destinations and hyperlinks.

An interface off the document, contains four lists:

  • the hyperlink sources defined in this document
  • the hyperlink destinations defined in this document
  • the hyperlinks defined in this document (the connection between the sources & destinations)
  • the bookmarks defined in the document

Note 1 : there is no requirement that the number of sources match the number of destinations, or the number of hyperlinks. i.e. a hyperlink is valid if either the source or destination (or both) is (are) valid.

Note 2 : this table manages references to hyperlink sources, destinations and hyperlinks, but does not create or delete the sources, destinations, or hyperlink UIDs.

See Also
kHyperlinkBoss
IHyperlinkSource
IHyperlinkDestination
IHyperlink

Member Enumeration Documentation

Use this to indicate which type of object needs its cache updated
Enumerator
kHyperlinks 

Update hyperlink names

kSources 

Update source names

kDestinations 

Update destination names

kBookmarks 

Update bookmark names

kXRefFormats 

Update cross reference format names

kAll 

Update all names

Member Function Documentation

virtual void IHyperlinkTable::AddBookmark (const UID bookmark)
pure virtual

Add a new bookmark

Parameters
bookmark- UID of bookmark to add
virtual void IHyperlinkTable::AddHyperlink (const UID hyperlink)
pure virtual

Add a new hyperlink

Parameters
hyperlink- UID of hyperlink to add
virtual void IHyperlinkTable::AddHyperlinkDestination (const UID hyperlinkDestination)
pure virtual

Add a new hyperlink destination

Parameters
hyperlinkDestination- Destination to add
virtual void IHyperlinkTable::AddHyperlinkSource (const UID hyperlinkSource)
pure virtual

Add a new hyperlink source

Parameters
hyperlinkSource- UID to add
virtual void IHyperlinkTable::AddXRefFormat (const UID xRefFormat)
pure virtual

Add a new cross reference format

Parameters
xRefFormat- UID of format to add
virtual void IHyperlinkTable::GenerateNewHyperlinkBookmarkName (PMStringpName)
pure virtual
    Generates a unique bookmark name, of the form

"Bookmark_1", "Bookmark_2", ....

Parameters
pName- Default name to try to use
virtual void IHyperlinkTable::GenerateNewHyperlinkDestinationName (PMStringpName)
pure virtual

Generates a unique hyperlink destination name, of the form "Anchor_1", "Anchor_1", ....

Parameters
pName- Default name to try to use
virtual void IHyperlinkTable::GenerateNewHyperlinkName (PMStringpName)
pure virtual
    Generates a unique hyperlink destination name, of the form

"Hyperlink_1", "Hyperlink_1", ....

Parameters
pName- Default name to use
virtual void IHyperlinkTable::GenerateNewHyperlinkSourceName (PMStringpName)
pure virtual
    Generates a unique hyperlink source name, of the form

"Source_1", "Source_1", ....

Parameters
pName- Default name to try to use
virtual void IHyperlinkTable::GenerateNewXRefFormatName (PMStringpName)
pure virtual
    Generates a unique cross reference format name, of the form

"cross reference format_1", "cross reference format_2", ....

Parameters
pName- Default name to try to use
virtual int32 IHyperlinkTable::GetBookmarkCount () const
pure virtual

Return the number of bookmark defined in this document (This ignored the bookmark hierarchy)

Parameters
none
Returns
int32 - Number of bookamrks in this document
virtual int32 IHyperlinkTable::GetBookmarkWithUID (const UID bookmark) const
pure virtual

Use for locating a specified bookmark

Parameters
bookmark- UID of the bookmark you want
Returns
int32 - Index of the specified bookmark
virtual UniqueKeyToUIDMap::const_iterator IHyperlinkTable::GetDestinationKeyToUIDMapBeginIter () const
pure virtual

Returns the begin iterator of destination map

virtual UniqueKeyToUIDMap::const_iterator IHyperlinkTable::GetDestinationKeyToUIDMapEndIter () const
pure virtual

Returns the end iterator of destination map

virtual UniqueKeyToUIDMap::const_reverse_iterator IHyperlinkTable::GetDestinationKeyToUIDMapRBeginIter () const
pure virtual

Returns the reverse begin iterator of destination map

virtual UniqueKeyToUIDMap::const_reverse_iterator IHyperlinkTable::GetDestinationKeyToUIDMapREndIter () const
pure virtual

Returns the reverse end iterator of destination map

virtual int32 IHyperlinkTable::GetHyperlinkCount () const
pure virtual

Return the number of hyperlinks defined in this document

Parameters
none
Returns
int32 - Number of hyperlinks in this table
virtual int32 IHyperlinkTable::GetHyperlinkDestinationCount () const
pure virtual

Return the number of hyperlink destinations defined in this document

Parameters
none
Returns
int32 - Number of destinations in the table
virtual UID IHyperlinkTable::GetHyperlinkDestinationWithKey (int32 hyperlinkKey) const
pure virtual

Given a unique key, retrieve the UID of the hyperlink destination

Parameters
hyperlinkKey- Unique key for the destination
Returns
UID - UID of the specified destination
virtual UID IHyperlinkTable::GetHyperlinkOfSource (UIDRef sourceUIDRef) const
pure virtual

given the source UIDRef, return the UID of the Hyperlink that uses it.

Parameters
sourceUIDRef- Source to find a hyperlink for
Returns
UID - Returns kInvalidUID if the source isn't used at all.
virtual int32 IHyperlinkTable::GetHyperlinkSourceCount () const
pure virtual

Return the number of hyperlink sources defined in this document

Parameters
none
Returns
int32 - Number of hyperlink sources in the Table
virtual int32 IHyperlinkTable::GetHyperlinkSourceIndex (const UID hyperlinkSourceUID) const
pure virtual

return the index of the specified hyperlink source in the table

Parameters
hyperlinkSourceUID- UID to get the index of
Returns
int32 - Index of source
virtual int32 IHyperlinkTable::GetHyperlinkWithUID (const UID hyperlink) const
pure virtual

Use for locating a specified hyperlink

Parameters
hyperlink- UID of hyperlink we want
Returns
int32 - Index of specified hyperlink
virtual UID IHyperlinkTable::GetNthBookmark (int32 bookmarkIndex) const
pure virtual

Use for indexing through defined bookmark

Parameters
bookmarkIndex- Index of the bookmark you want
Returns
UID - UID of the specified bookmark
virtual UID IHyperlinkTable::GetNthHyperlink (int32 hyperlinkIndex) const
pure virtual

Use for indexing through defined hyperlinks

Parameters
hyperlinkIndex- Index of hyperlink we want
Returns
UID - UID of specified hyperlink
virtual UID IHyperlinkTable::GetNthHyperlinkSource (int32 hyperlinkIndex) const
pure virtual

Use for indexing through defined hyperlink sources

Parameters
hyperlinkIndex- Index that we want the UID for
Returns
UID - UID of expected source
virtual UID IHyperlinkTable::GetNthXRefFormat (int32 formatIndex) const
pure virtual

Use for indexing through defined cross reference format

Parameters
formatIndex- Index of the format you want
Returns
UID - UID of the specified format
virtual int32 IHyperlinkTable::GetXRefFormatCount () const
pure virtual

Return the number of cross reference format defined in this document

Returns
int32 - Number of cross reference formats in this document
virtual int32 IHyperlinkTable::GetXRefFormatIndex (const UID xRefFormatUID) const
pure virtual

return the index of the specified cross reference format in the table

Parameters
xRefFormatUID- UID to get the index of
Returns
int32 - Index of format
virtual UID IHyperlinkTable::GetXRefFormatOfName (const PMStringname)
pure virtual

return UID of the format with specified name if the namealready exists.

Parameters
name- x-ref format name to check
Returns
bool16 - UID of the format if the name exists, otherwise kInvaludUID.
virtual bool16 IHyperlinkTable::HasExternalDestination () const
pure virtual

Returns kTrue if there is any hyperlink point to external destination.

virtual bool16 IHyperlinkTable::HasXRefFormatName (const PMStringname)
pure virtual

return kTrue if the specified format name already exists.

Parameters
name- x-ref format name to check
Returns
bool16 - kTrue if the name exists, otherwise return kFalse.
virtual void IHyperlinkTable::InvalidateNameCache (IHyperlinkTable::WhichCache whichCache)
pure virtual

Invalidate the name cache for items stored in this table You need to call this anytime the name of a hyperlink/source/destination/bookmark changes so that the code for generating a new name will be right.

Parameters
whichCache- Indicates what type of item you changed.
virtual bool16 IHyperlinkTable::IsValidHyperlinkDestinationKey (int32 hyperlinkDestinationKey) const
pure virtual

Check if the index of the specified hyperlink destination is in the table

Parameters
hyperlinkDestinationKey
Returns
bool16 - kTrue if the destination key is found in the table
virtual void IHyperlinkTable::MoveBookmark (const UID bookmark,
int32 newLoc 
)
pure virtual

Move a bookmark to a new location

Parameters
bookmark- Bookmark to move
newLoc- New location of the bookmark (-1 will move to the end of the list)
virtual void IHyperlinkTable::MoveHyperlink (const UID hyperlink,
const UID moveBefore 
)
pure virtual

Move a hyperlink around in the table

Parameters
hyperlink- UID of hyperlink to move
moveBefore- UID of hyperlink we are trying to move before (kInvalidUID == move to end)
virtual void IHyperlinkTable::RemoveBookmark (const UID bookmarkUID)
pure virtual

Remove the Bbookmark 'UID'

Parameters
bookmarkUID- UID of bookmark to remove
virtual UID IHyperlinkTable::RemoveHyperlink (const UID hyperlinkUID)
pure virtual

Remove the hyperlink 'UID'

Parameters
hyperlinkUID- UID of hyperlink to remove
Returns
UID of the source that used to be associated with this hyperlink
virtual void IHyperlinkTable::RemoveHyperlinkDestination (int32 hyperlinkDestinationKey)
pure virtual

Remove a hyperlink destination

Parameters
hyperlinkDestinationKey- Unique key of the destination to remove
virtual void IHyperlinkTable::RemoveHyperlinkSource (const UID hyperlinkSource)
pure virtual

remove a hyperlink source. May orphan a hyperlink destination (i.e. can end up with a target with no sources (in this document)

Parameters
hyperlinkSource- Source to remove
virtual bool16 IHyperlinkTable::RemoveXRefFormat (const UID xRefFormat)
pure virtual

Remove the cross reference format 'UID'. Only custom defined format can be removed.

Parameters
xRefFormat- UID of custom defined cross reference format to remove
Returns
bool16 - kTrue if the format is removed successfully, kFalse otherwise. We return kFalse if the format is one of the application default formats.
virtual void IHyperlinkTable::SetHasExternalDestination (bool16 fHasExternDest)
pure virtual

Sets the flag indicating if there is any hyperlink pointing to external destination. This method is only for conversion purpose and most time you should not set the flag manually.

virtual void IHyperlinkTable::SwapHyperlinkDestinations (int32 destKey1,
int32 destKey2 
)
pure virtual

Swap the UIDs of two keys in the destination map

Parameters
destKey1- Unique key of the first destination
destKey2- Unique key of the second destination