Visit Mozilla.org

nsIAccessibleHyperLink

From MDC


Contents

nsIAccessibleHyperLink is defined in accessible/public/atk/nsIAccessibleHyperLink.idl. It is scriptable and unfrozen (hasn't changed since Mozilla 1.9).

Inherits from: nsISupports

Note: Assumption; An object which supports nsIAccessibleHyperlink does *not* generally implement nsIAccessible, unlike the case of the other nsiAccessible* interfaces in this directory.

[edit] Method overview

nsIAccessible getAnchor(in long index);
nsIURI getURI(in long index);

[edit] Attributes

Note: Assumption; The object associated with object or anchor index is an nsIAccessible. A URI can be represented by the nsIURI interface(or nsIURL interface).
Attribute Type Description
anchorCount long The number of anchors within the hyperlink. For anchors, this value is normally 1. The anchor is, for example, the visible output of the HTML <a&gt tag. With an image map, this reflects the actual areas within the map. Read only.
startIndex long The starting index of the hyperlink. Read only.
endIndex long The ending index of the hyperlink. Read only.
selected boolean Indicates whether or not the element currently has focus, for example after returning from the destination page. Read only.
Note: ARIA links can only be focused if they have the tabindex attribute set. In addition, state_focused should be set on the accessible for the link.
valid boolean Indicates whether or not the link is valid (i.e., pointing to a valid URL). Read only.
Note: Currently this is only used with ARIA links, and the author needs to specify that the link is invalid with the aria-invalid="true" attribute. Otherwise, true is returned.

[edit] Methods

[edit] getAnchor()

This method returns a reference to an accessible object.

 nsIAccessible getAnchor(
   in long index
 );
[edit] Parameters
index
The 0-based index of the anchor to retrieve.
[edit] Return value

Returns an nsIAccessible object.

[edit] getURI()

This method gets an object, which represents the hyperlink.

 nsIURI getURI (
   in long index
 );
[edit] Parameters
index
The 0-based index of the URI to return.
Note: ARIA hyperlinks do not have a URI to point to, since clicks are processed using JavaScript. Because of that, this method doesn't work on ARIA links.
[edit] Return value

Returns an nsIURI object.

[edit] See also