class Axlsx::Hyperlink

a hyperlink object adds an action to an image when clicked so that when the image is clicked the link is fecthed. @note using the hyperlink option when calling add_image on a drawing object is the recommended way to manage hyperlinks @see {file:README} README

Attributes

action[RW]

An action to take when the link is clicked. The specification says “This can be used to specify a slide to be navigated to or a script of code to be run.” but in most cases you will not need to do anything with this. MS does reserve a few interesting strings. @see msdn.microsoft.com/en-us/library/ff532419%28v=office.12%29.aspx

@return [String]
endSnd[R]

Specifies if all sound events should be terminated when this link is clicked. @return [Boolean]

end_snd[R]

Specifies if all sound events should be terminated when this link is clicked. @return [Boolean]

highlightClick[R]

indicates that the link has already been clicked. @return [Boolean]

highlight_click[R]

indicates that the link has already been clicked. @return [Boolean]

history[R]

From the specs: Specifies whether to add this URI to the history when navigating to it. This allows for the viewing of this presentation without the storing of history information on the viewing machine. If this attribute is omitted, then a value of 1 or true is assumed. @return [Boolean]

href[RW]

The destination of the hyperlink stored in the drawing's relationships document. @return [String]

invalidUrl[RW]

The spec says: Specifies the URL when it has been determined by the generating application that the URL is invalid. That is the generating application can still store the URL but it is known that this URL is not correct.

What exactly that means is beyond me so if you ever use this, let me know! @return [String]

invalidUrl=[RW]

The spec says: Specifies the URL when it has been determined by the generating application that the URL is invalid. That is the generating application can still store the URL but it is known that this URL is not correct.

What exactly that means is beyond me so if you ever use this, let me know! @return [String]

invalid_url[RW]

The spec says: Specifies the URL when it has been determined by the generating application that the URL is invalid. That is the generating application can still store the URL but it is known that this URL is not correct.

What exactly that means is beyond me so if you ever use this, let me know! @return [String]

tgtFrame[RW]

From the specs: Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used. If this attribute is omitted, than a new window is opened. @return [String]

tgtFrame=[RW]

From the specs: Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used. If this attribute is omitted, than a new window is opened. @return [String]

tgt_frame[RW]

From the specs: Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used. If this attribute is omitted, than a new window is opened. @return [String]

tooltip[RW]

Text to show when you mouse over the hyperlink. If you do not set this, the href property will be shown. @return [String]

Public Class Methods

new(parent, options={}) { |self| ... } click to toggle source

Creates a hyperlink object

parent must be a Pic for now, although I expect that other object support this tag and its cNvPr parent
@param [Pic] parent
@option options [String] tooltip message shown when hyperlinked object is hovered over with mouse.
@option options [String] tgtFrame Target frame for opening hyperlink
@option options [String] invalidUrl supposedly use to store the href when we know it is an invalid resource.
@option options [String] href the target resource this hyperlink links to. This is actually stored on the relationship.
@option options [String] action A string that can be used to perform specific actions. For excel please see this reference: http://msdn.microsoft.com/en-us/library/ff532419%28v=office.12%29.aspx
@option options [Boolean] endSnd terminate any sound events when processing this link
@option options [Boolean] history include this link in the list of visited links for the applications history.
@option options [Boolean] highlightClick indicate that the link has already been visited.
# File lib/axlsx/drawing/hyperlink.rb, line 22
def initialize(parent, options={})
  DataTypeValidator.validate "Hyperlink.parent", [Pic], parent
  @parent = parent
  parse_options options
  yield self if block_given?
end

Public Instance Methods

endSnd=(v)
Alias for: end_snd=
end_snd=(v) click to toggle source

@see endSnd @param [Boolean] v The boolean value indicating the termination of playing sounds on click @return [Boolean]

# File lib/axlsx/drawing/hyperlink.rb, line 55
def end_snd=(v) Axlsx::validate_boolean(v); @end_snd = v end
Also aliased as: endSnd=
highlightClick=(v)
Alias for: highlight_click=
highlight_click=(v) click to toggle source

@see highlightClick @param [Boolean] v The value to assign

# File lib/axlsx/drawing/hyperlink.rb, line 65
def highlight_click=(v) Axlsx::validate_boolean(v); @highlight_click = v end
Also aliased as: highlightClick=
history=(v) click to toggle source

@see history param [Boolean] v The value to assing

# File lib/axlsx/drawing/hyperlink.rb, line 74
def history=(v) Axlsx::validate_boolean(v); @history = v end
relationship() click to toggle source

The relationship object for this hyperlink. @return [Relationship]

# File lib/axlsx/drawing/hyperlink.rb, line 88
def relationship
  Relationship.new(self, HYPERLINK_R, href, :target_mode => :External)
end
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

# File lib/axlsx/drawing/hyperlink.rb, line 95
def to_xml_string(str = '')
  serialized_tag 'a:hlinkClick', str, {:'r:id' => relationship.Id, :'xmlns:r' => XML_NS_R }
end