michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIAccessible; michael@0: michael@0: /** michael@0: * A cross-platform interface that supports hyperlink-specific properties and michael@0: * methods. Anchors, image maps, xul:labels with class="text-link" implement this interface. michael@0: */ michael@0: [scriptable, uuid(883643d4-93a5-4f32-922c-6f06e01363c1)] michael@0: interface nsIAccessibleHyperLink : nsISupports michael@0: { michael@0: /** michael@0: * Returns the offset of the link within the parent accessible. michael@0: */ michael@0: readonly attribute long startIndex; michael@0: michael@0: /** michael@0: * Returns the end index of the link within the parent accessible. michael@0: * michael@0: * @note The link itself is represented by one embedded character within the michael@0: * parent text, so the endIndex should be startIndex + 1. michael@0: */ michael@0: readonly attribute long endIndex; michael@0: michael@0: /** michael@0: * Determines whether the link is valid (e. g. points to a valid URL). michael@0: * michael@0: * @note XXX Currently only used with ARIA links, and the author has to michael@0: * specify that the link is invalid via the aria-invalid="true" attribute. michael@0: * In all other cases, TRUE is returned. michael@0: */ michael@0: readonly attribute boolean valid; michael@0: michael@0: /** michael@0: * The numbber of anchors within this Hyperlink. Is normally 1 for anchors. michael@0: * This anchor is, for example, the visible output of the html:a tag. michael@0: * With an Image Map, reflects the actual areas within the map. michael@0: */ michael@0: readonly attribute long anchorCount; michael@0: michael@0: /** michael@0: * Returns the URI at the given index. michael@0: * michael@0: * @note ARIA hyperlinks do not have an URI to point to, since clicks are michael@0: * processed via JavaScript. Therefore this property does not work on ARIA michael@0: * links. michael@0: * michael@0: * @param index The 0-based index of the URI to be returned. michael@0: * michael@0: * @return the nsIURI object containing the specifications for the URI. michael@0: */ michael@0: nsIURI getURI (in long index); michael@0: michael@0: /** michael@0: * Returns a reference to the object at the given index. michael@0: * michael@0: * @param index The 0-based index whose object is to be returned. michael@0: * michael@0: * @return the nsIAccessible object at the desired index. michael@0: */ michael@0: nsIAccessible getAnchor (in long index); michael@0: }; michael@0: michael@0: /* michael@0: Assumptions: michael@0: michael@0: The object associated with object or anchor index michael@0: is an nsIAccessible. michael@0: A URI can be represented by the nsIURI interface michael@0: (or nsIURL interface). michael@0: michael@0: Note that an object which supports nsIAccessibleHyperlink michael@0: does *not* generally implement nsIAccessible, unlike the michael@0: case of the other nsiAccessible* interfaces in this directory. michael@0: michael@0: Aaron: would the nsISupports return from michael@0: getObject be queryable for nsIURI and nsIURL directly? michael@0: michael@0: */