# Accessibility::Hyperlink Interface Reference

`import "Accessibility_Hyperlink.idl";`

## Public Member Functions

Accessible | getObject (in long i)
string | getURI (in long i)
boolean | isValid ()

## Data Fields

readonly attribute short | nAnchors
readonly attribute long | startIndex
readonly attribute long | endIndex

## Detailed Description

Instances of Hyperlink are returned by Hypertext objects, and are the means by which end users and clients interact with linked, and in some cases embedded, content. Hyperlinks may have multiple "anchors", where an anchor corresponds to a reference to a particular resource with a corresponding resource identified (URI). Hyperlinks may be queried for their URIs, or queried for the objects corresponding to their anchors. The objects thus obtained are instances of Accessible, and may be queried, and manipulated via the Action interface.

Note:
  A Hyperlink implementor is normally NOT an Accessible; the preferred usage is for a Hyperlink's associated "objects" (accessed via the getObject method) are Accessibles. This means that Actions such as "open link" are normally invoked on the result of Hyperlink::getObject rather than directly on the Hyperlink instance. For historical reasons some implementors of Hyperlink implement Action as well. This usage on the part of implementing applications and toolkits is discouraged, but clients of Hyperlink should be aware of it and prepared to handle such usage.

## Member Function Documentation

Accessible Accessibility::Hyperlink::getObject | ( | in long | i | ) |

Gets the i'th object, (where i is an integer between 0 and Hyperlink::numAnchors - 1, inclusive) associated with a Hyperlink. The objects returned are usually actionable (i.e. they should implement Accessibility::Action), and the available actions often include "open", "bookmark", "save link as", etc. They may also implement Accessibility::StreamableContent, although clients can normally use getURI to obtain a resource locator via which the object's data may be accessed.

Note:
  the most common application for 'multi anchor' hyperlinks in HTML is probably "client side imagemaps". A clickable image which uses the HTML 'usemap' attribute should have one anchor for every <area> element that includes an HREF. The objects corresponding to these map areas may implement Accessibility::Component, to represent their onscreen bounding box, and may expose their 'shape' as as name-value pair via Accessibility::Accessible::getAttributeSet.

Returns:
  an Accessible object instance representing the Hyperlink's ith anchor, or through which the content associated with the `ith` anchor can be accessed.

string Accessibility::Hyperlink::getURI | ( | in long | i | ) |

Obtain a resource locator ('URI') which can be used to access the content to which this link "points" or is connected.

Returns:
  a string corresponding to the URI of the Hyperlink's 'ith' anchor, if one exists, or a NIL string otherwise.

boolean Accessibility::Hyperlink::isValid | ( |  | ) |

Check the hyperlink to see if a connection to its backing content can be established, or if its URI is valid.

Note:
  instances of invalid hyperlinks include links with malformed URIs, or for which a contact to the service provider specified in the URI cannot be established.

Returns:
  `True` if the object's content is available, or `False` if the hyperlink's URI is invalid, or a connection to the resource can not be established.

## Field Documentation

readonly attribute long Accessibility::Hyperlink::endIndex

the ending offset within the containing Hypertext content with which this Hyperlink is associated; that is, the offset of the first element past the range within the Hypertext associated with this Hyperlink.

readonly attribute short Accessibility::Hyperlink::nAnchors

the number of separate anchors associated with this Hyperlink

readonly attribute long Accessibility::Hyperlink::startIndex

the starting offset within the containing Hypertext content with which this Hyperlink is associated

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

- /home/liyuan/src/at-spi/idl/Accessibility_Hyperlink.idl