Bug 1850635 [wpt PR 41704] - Implement parseHTMLUnsafe and setHTMLUnsafe, a=testonly
[gecko.git] / accessible / interfaces / nsIAccessibleHyperLink.idl
blobe2926d4f0f51876bfec4009308315c060d7d113b
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 interface nsIURI;
10 interface nsIAccessible;
12 /**
13 * A cross-platform interface that supports hyperlink-specific properties and
14 * methods. Anchors, image maps, xul:labels with class="text-link" implement this interface.
16 [scriptable, builtinclass, uuid(883643d4-93a5-4f32-922c-6f06e01363c1)]
17 interface nsIAccessibleHyperLink : nsISupports
19 /**
20 * Returns the offset of the link within the parent accessible.
22 readonly attribute long startIndex;
24 /**
25 * Returns the end index of the link within the parent accessible.
27 * @note The link itself is represented by one embedded character within the
28 * parent text, so the endIndex should be startIndex + 1.
30 readonly attribute long endIndex;
32 /**
33 * Determines whether the link is valid (e. g. points to a valid URL).
35 * @note XXX Currently only used with ARIA links, and the author has to
36 * specify that the link is invalid via the aria-invalid="true" attribute.
37 * In all other cases, TRUE is returned.
39 readonly attribute boolean valid;
41 /**
42 * The numbber of anchors within this Hyperlink. Is normally 1 for anchors.
43 * This anchor is, for example, the visible output of the html:a tag.
44 * With an Image Map, reflects the actual areas within the map.
46 readonly attribute long anchorCount;
48 /**
49 * Returns the URI at the given index.
51 * @note ARIA hyperlinks do not have an URI to point to, since clicks are
52 * processed via JavaScript. Therefore this property does not work on ARIA
53 * links.
55 * @param index The 0-based index of the URI to be returned.
57 * @return the nsIURI object containing the specifications for the URI.
59 nsIURI getURI (in long index);
61 /**
62 * Returns a reference to the object at the given index.
64 * @param index The 0-based index whose object is to be returned.
66 * @return the nsIAccessible object at the desired index.
68 nsIAccessible getAnchor (in long index);
72 Assumptions:
74 The object associated with object or anchor index
75 is an nsIAccessible.
76 A URI can be represented by the nsIURI interface
77 (or nsIURL interface).
79 Note that an object which supports nsIAccessibleHyperlink
80 does *not* generally implement nsIAccessible, unlike the
81 case of the other nsiAccessible* interfaces in this directory.
83 Aaron: would the nsISupports return from
84 getObject be queryable for nsIURI and nsIURL directly?