accessible/public/nsIAccessibleHyperLink.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/public/nsIAccessibleHyperLink.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,86 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface nsIURI;
    1.13 +interface nsIAccessible;
    1.14 +
    1.15 +/**
    1.16 + * A cross-platform interface that supports hyperlink-specific properties and
    1.17 + * methods.  Anchors, image maps, xul:labels with class="text-link" implement this interface.
    1.18 + */
    1.19 +[scriptable, uuid(883643d4-93a5-4f32-922c-6f06e01363c1)]
    1.20 +interface nsIAccessibleHyperLink : nsISupports
    1.21 +{
    1.22 +  /**
    1.23 +   * Returns the offset of the link within the parent accessible.
    1.24 +   */
    1.25 +  readonly attribute long startIndex;
    1.26 +
    1.27 +  /**
    1.28 +   * Returns the end index of the link within the parent accessible.
    1.29 +   *
    1.30 +   * @note  The link itself is represented by one embedded character within the
    1.31 +   * parent text, so the endIndex should be startIndex + 1.
    1.32 +   */
    1.33 +  readonly attribute long endIndex;
    1.34 +
    1.35 +  /**
    1.36 +   * Determines whether the link is valid (e. g. points to a valid URL).
    1.37 +   *
    1.38 +   * @note  XXX Currently only used with ARIA links, and the author has to
    1.39 +   * specify that the link is invalid via the aria-invalid="true" attribute.
    1.40 +   * In all other cases, TRUE is returned.
    1.41 +   */
    1.42 +  readonly attribute boolean valid;
    1.43 +
    1.44 +  /**
    1.45 +   * The numbber of anchors within this Hyperlink. Is normally 1 for anchors.
    1.46 +   * This anchor is, for example, the visible output of the html:a tag.
    1.47 +   * With an Image Map, reflects the actual areas within the map.
    1.48 +   */
    1.49 +  readonly attribute long anchorCount;
    1.50 +
    1.51 +  /**
    1.52 +   * Returns the URI at the given index.
    1.53 +   *
    1.54 +   * @note  ARIA hyperlinks do not have an URI to point to, since clicks are
    1.55 +   * processed via JavaScript. Therefore this property does not work on ARIA
    1.56 +   * links.
    1.57 +   *
    1.58 +   * @param index  The 0-based index of the URI to be returned.
    1.59 +   *
    1.60 +   * @return the nsIURI object containing the specifications for the URI.
    1.61 +   */
    1.62 +  nsIURI getURI (in long index);
    1.63 +
    1.64 +  /**
    1.65 +   * Returns a reference to the object at the given index.
    1.66 +   *
    1.67 +   * @param index  The 0-based index whose object is to be returned.
    1.68 +   *
    1.69 +   * @return the nsIAccessible object at the desired index.
    1.70 +   */
    1.71 +  nsIAccessible getAnchor (in long index);
    1.72 +};
    1.73 +
    1.74 +/*
    1.75 + Assumptions:
    1.76 +
    1.77 + The object associated with object or anchor index
    1.78 + is an nsIAccessible.
    1.79 + A URI can be represented by the nsIURI interface
    1.80 + (or nsIURL interface).
    1.81 +
    1.82 + Note that an object which supports nsIAccessibleHyperlink
    1.83 + does *not* generally implement nsIAccessible, unlike the
    1.84 +    case of the other nsiAccessible* interfaces in this directory.
    1.85 +
    1.86 +    Aaron: would the nsISupports return from
    1.87 +    getObject be queryable for nsIURI and nsIURL directly?
    1.88 +
    1.89 +*/

mercurial