Hyperlink

Inheritance: java.lang.Object, com.aspose.slides.PVIObject

All Implemented Interfaces: com.aspose.slides.IHyperlink, com.aspose.slides.IDOMObject

public final class Hyperlink extends PVIObject implements IHyperlink, IDOMObject

Represents a hyperlink.

Constructors

ConstructorDescription
Hyperlink(String url)Creates an instance of a hyperlink.
Hyperlink(ISlide slide)Creates an instance of a hyperlink which points to specific slide.
Hyperlink(Hyperlink source, String targetFrame, String tooltip, boolean history, boolean stopSoundsOnClick, boolean highlightClick)Creates an instance of a hyperlink using another hyperlink as source, overriding secondary properties.

Methods

MethodDescription
getVersion()
getNoAction()Returns a special “do nothing” hyperlink.
getMedia()Returns a special “play mediafile” hyperlink.
getNextSlide()Returns a hyperlink to the next slide.
getPreviousSlide()Returns a hyperlink to the previous slide.
getFirstSlide()Returns a hyperlink to the first slide of the presentation.
getLastSlide()Returns a hyperlink to the last slide of the presentation.
getLastVievedSlide()Returns a hyperlink to the last viewed slide.
getEndShow()Returns a hyperlink which ends the show.
getActionType()Returns type of Hyperlink’s action.
getExternalUrl()Specifies the external URL.
getTargetSlide()If the Hyperlink targets specific slide returns this slide.
getExternalUrlOriginal()Represents a hyperlink that is set for this portion without regard to the actual content of the portion.
getTargetFrame()Returns the frame within the parent HTML frameset for the target of the parent hyperlink when one exists.
setTargetFrame(String value)Returns the frame within the parent HTML frameset for the target of the parent hyperlink when one exists.
getTooltip()Returns the string which may be surfaced in a user interface as associated with the parent hyperlink.
setTooltip(String value)Returns the string which may be surfaced in a user interface as associated with the parent hyperlink.
getHistory()Determines whether the target of the parent hyperlink shall be added to a list of viewed hyperlinks when it is invoked.
setHistory(boolean value)Determines whether the target of the parent hyperlink shall be added to a list of viewed hyperlinks when it is invoked.
getHighlightClick()Determines whether the hyperlink should be highlighted on click.
setHighlightClick(boolean value)Determines whether the hyperlink should be highlighted on click.
getStopSoundOnClick()Determines whether the sound should be stopped on hyperlink click.
setStopSoundOnClick(boolean value)Determines whether the sound should be stopped on hyperlink click.
getSound()Represents the playing sound of the hyperlink.
setSound(IAudio value)Represents the playing sound of the hyperlink.
getColorSource()Represents the source of hyperlink color - either styles or portion format.
setColorSource(int value)Represents the source of hyperlink color - either styles or portion format.
equals(Object obj)Determines whether the two Hyperlink instances are equal.
equals(IHyperlink hlink)Determines whether the two Hyperlink instances are equal.
op_Equality(Hyperlink hlink1, Hyperlink hlink2)Tests two hyperlinks for equality.
op_Inequality(Hyperlink hlink1, Hyperlink hlink2)Tests two hyperlinks for inequality.
hashCode()Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getParent_Immediate()
public Hyperlink(String url)

Creates an instance of a hyperlink.

Parameters:

ParameterTypeDescription
urljava.lang.StringHyperlink URL.
public Hyperlink(ISlide slide)

Creates an instance of a hyperlink which points to specific slide. Note: created hyperlink should be assigned to some object from the same presentation, otherwise link will be saved as NoAction.

Parameters:

ParameterTypeDescription
slideISlideTarget slide.
public Hyperlink(Hyperlink source, String targetFrame, String tooltip, boolean history, boolean stopSoundsOnClick, boolean highlightClick)

Creates an instance of a hyperlink using another hyperlink as source, overriding secondary properties.

Parameters:

ParameterTypeDescription
sourceHyperlinkSource hyperlink
targetFramejava.lang.StringTarget frame
tooltipjava.lang.StringTooltip text
historybooleanDetermines whether the target of the parent hyperlink shall be added to a list of viewed hyperlinks when it is invoked.
stopSoundsOnClickbooleanDetermines whether the sound should be stopped on hyperlink click.
highlightClickbooleanDetermines whether the hyperlink should be highlighted on click.

getVersion()

public long getVersion()

Version. Read-only long.

Returns: long

getNoAction()

public static Hyperlink getNoAction()

Returns a special “do nothing” hyperlink. Read-only Hyperlink.

Returns: Hyperlink

getMedia()

public static Hyperlink getMedia()

Returns a special “play mediafile” hyperlink. Used in AudioFrame and VideoFrame. Read-only Hyperlink.

Returns: Hyperlink

getNextSlide()

public static Hyperlink getNextSlide()

Returns a hyperlink to the next slide. Read-only Hyperlink.

Returns: Hyperlink

getPreviousSlide()

public static Hyperlink getPreviousSlide()

Returns a hyperlink to the previous slide. Read-only Hyperlink.

Returns: Hyperlink

getFirstSlide()

public static Hyperlink getFirstSlide()

Returns a hyperlink to the first slide of the presentation. Read-only Hyperlink.

Returns: Hyperlink

getLastSlide()

public static Hyperlink getLastSlide()

Returns a hyperlink to the last slide of the presentation. Read-only Hyperlink.

Returns: Hyperlink

getLastVievedSlide()

public static Hyperlink getLastVievedSlide()

Returns a hyperlink to the last viewed slide. Read-only Hyperlink.

Returns: Hyperlink

getEndShow()

public static Hyperlink getEndShow()

Returns a hyperlink which ends the show. Read-only Hyperlink.

Returns: Hyperlink

getActionType()

public final int getActionType()

Returns type of Hyperlink’s action. Read-only HyperlinkActionType.

Returns: int

getExternalUrl()

public final String getExternalUrl()

Specifies the external URL. Read-only String.

Returns: java.lang.String

getTargetSlide()

public final ISlide getTargetSlide()

If the Hyperlink targets specific slide returns this slide. Read-only ISlide.

Returns: ISlide

getExternalUrlOriginal()

public final String getExternalUrlOriginal()

Represents a hyperlink that is set for this portion without regard to the actual content of the portion.


PowerPoint behaves specifically for links and their corresponding text in a portion. It allows to create text for the hyperlink in the form of a valid URL, different from the real address of the link. In this case, when you view the link in the edit window, it will be changed to match the text portion. This property represents the original value of the hyperlink.

Returns: java.lang.String

getTargetFrame()

public final String getTargetFrame()

Returns the frame within the parent HTML frameset for the target of the parent hyperlink when one exists. Read/wite String.

Returns: java.lang.String

setTargetFrame(String value)

public final void setTargetFrame(String value)

Returns the frame within the parent HTML frameset for the target of the parent hyperlink when one exists. Read/wite String.

Parameters:

ParameterTypeDescription
valuejava.lang.String

getTooltip()

public final String getTooltip()

Returns the string which may be surfaced in a user interface as associated with the parent hyperlink. Read/write String.

Returns: java.lang.String

setTooltip(String value)

public final void setTooltip(String value)

Returns the string which may be surfaced in a user interface as associated with the parent hyperlink. Read/write String.

Parameters:

ParameterTypeDescription
valuejava.lang.String

getHistory()

public final boolean getHistory()

Determines whether the target of the parent hyperlink shall be added to a list of viewed hyperlinks when it is invoked. Read/write boolean.

Returns: boolean

setHistory(boolean value)

public final void setHistory(boolean value)

Determines whether the target of the parent hyperlink shall be added to a list of viewed hyperlinks when it is invoked. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getHighlightClick()

public final boolean getHighlightClick()

Determines whether the hyperlink should be highlighted on click. Read/write boolean.

Returns: boolean

setHighlightClick(boolean value)

public final void setHighlightClick(boolean value)

Determines whether the hyperlink should be highlighted on click. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getStopSoundOnClick()

public final boolean getStopSoundOnClick()

Determines whether the sound should be stopped on hyperlink click. Read/write boolean.

Returns: boolean

setStopSoundOnClick(boolean value)

public final void setStopSoundOnClick(boolean value)

Determines whether the sound should be stopped on hyperlink click. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getSound()

public final IAudio getSound()

Represents the playing sound of the hyperlink. Read/write IAudio.


Presentation presentation = new Presentation("demo.pptx");
 try {
     ISlide slide = presentation.getSlides().get_Item(0);

     // Get the first shape hyperlink
     IHyperlink link = presentation.getSlides().get_Item(0).getShapes().get_Item(0).getHyperlinkClick();

     if (link.getSound() != null)
     {
         // Extract the hyperlink sound in byte array
         byte[] audioData = link.getSound().getBinaryData();
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Returns: IAudio

setSound(IAudio value)

public final void setSound(IAudio value)

Represents the playing sound of the hyperlink. Read/write IAudio.


Presentation presentation = new Presentation("demo.pptx");
 try {
     ISlide slide = presentation.getSlides().get_Item(0);

     // Get the first shape hyperlink
     IHyperlink link = presentation.getSlides().get_Item(0).getShapes().get_Item(0).getHyperlinkClick();

     if (link.getSound() != null)
     {
         // Extract the hyperlink sound in byte array
         byte[] audioData = link.getSound().getBinaryData();
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Parameters:

ParameterTypeDescription
valueIAudio

getColorSource()

public final int getColorSource()

Represents the source of hyperlink color - either styles or portion format. Read/write HyperlinkColorSource.

Returns: int

setColorSource(int value)

public final void setColorSource(int value)

Represents the source of hyperlink color - either styles or portion format. Read/write HyperlinkColorSource.

Parameters:

ParameterTypeDescription
valueint

equals(Object obj)

public boolean equals(Object obj)

Determines whether the two Hyperlink instances are equal.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe Hyperlink to compare with the current Hyperlink.

Returns: boolean - true if the specified Hyperlink is equal to the current Hyperlink; otherwise, false.

public final boolean equals(IHyperlink hlink)

Determines whether the two Hyperlink instances are equal.

Parameters:

ParameterTypeDescription
hlinkIHyperlinkThe Hyperlink to compare with the current Hyperlink.

Returns: boolean - true if the specified Hyperlink is equal to the current Hyperlink; otherwise, false.

public static boolean op_Equality(Hyperlink hlink1, Hyperlink hlink2)

Tests two hyperlinks for equality.

Parameters:

ParameterTypeDescription
hlink1HyperlinkFirst hyperlink to be tested.
hlink2HyperlinkSecond hyperlink to be tested.

Returns: boolean - true if hyperlinks are equal.

public static boolean op_Inequality(Hyperlink hlink1, Hyperlink hlink2)

Tests two hyperlinks for inequality.

Parameters:

ParameterTypeDescription
hlink1HyperlinkFirst hyperlink to be tested.
hlink2HyperlinkSecond hyperlink to be tested.

Returns: boolean - false if hyperlinks are equal.

hashCode()

public int hashCode()

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

Returns: int - Hash code for an URL.

getParent_Immediate()

public final IDOMObject getParent_Immediate()

Returns Parent_Immediate object. Read-only IDOMObject.

Returns: com.aspose.slides.IDOMObject