2003-04-22 07:24:52 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2003-04-22 07:24:52 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
2003-04-22 07:24:52 +00:00
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla browser.
|
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1999
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Bill Haneman (bill.haneman@sun.com)
|
|
|
|
* John Gaunt (jgaunt@netscape.com)
|
2003-04-22 07:24:52 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2003-04-22 07:24:52 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2003-04-22 07:24:52 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIAccessible;
|
|
|
|
|
2008-03-30 15:33:01 +00:00
|
|
|
/**
|
|
|
|
* A cross-platform interface that supports hyperlink-specific properties and
|
|
|
|
* methods. Anchors, image maps, xul:labels with class="text-link" implement this interface.
|
|
|
|
*/
|
2008-04-11 15:57:36 +00:00
|
|
|
[scriptable, uuid(38c60bfa-6040-4bfe-93f2-acd6a909bb60)]
|
2003-04-22 07:24:52 +00:00
|
|
|
interface nsIAccessibleHyperLink : nsISupports
|
|
|
|
{
|
2008-03-30 15:33:01 +00:00
|
|
|
/**
|
|
|
|
* Returns the offset of the link within the parent accessible.
|
|
|
|
*/
|
2003-04-22 07:24:52 +00:00
|
|
|
readonly attribute long startIndex;
|
2008-03-30 15:33:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the end index of the link within the parent accessible.
|
|
|
|
*
|
|
|
|
* @note The link itself is represented by one embedded character within the
|
|
|
|
* parent text, so the endIndex should be startIndex + 1.
|
|
|
|
*/
|
2003-04-22 07:24:52 +00:00
|
|
|
readonly attribute long endIndex;
|
|
|
|
|
2008-03-30 15:33:01 +00:00
|
|
|
/**
|
|
|
|
* Determines whether the link is valid (e. g. points to a valid URL).
|
|
|
|
*
|
|
|
|
* @note XXX Currently only used with ARIA links, and the author has to
|
|
|
|
* specify that the link is invalid via the aria-invalid="true" attribute.
|
|
|
|
* In all other cases, TRUE is returned.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean valid;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determines whether the element currently has the focus, e. g. after
|
|
|
|
* returning from the destination page.
|
|
|
|
*
|
|
|
|
* @note ARIA links can only be focused if they have the tabindex
|
|
|
|
* attribute set. Also, state_focused should then be set on the accessible
|
|
|
|
* for this link.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean selected;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The numbber of anchors within this Hyperlink. Is normally 1 for anchors.
|
|
|
|
* This anchor is, for example, the visible output of the html:a tag.
|
|
|
|
* With an Image Map, reflects the actual areas within the map.
|
|
|
|
*/
|
2008-04-11 15:57:36 +00:00
|
|
|
readonly attribute long anchorCount;
|
2003-04-22 07:24:52 +00:00
|
|
|
|
2008-03-30 15:33:01 +00:00
|
|
|
/**
|
|
|
|
* Returns the URI at the given index.
|
|
|
|
*
|
|
|
|
* @note ARIA hyperlinks do not have an URI to point to, since clicks are
|
|
|
|
* processed via JavaScript. Therefore this property does not work on ARIA
|
|
|
|
* links.
|
|
|
|
*
|
|
|
|
* @param index The 0-based index of the URI to be returned.
|
|
|
|
*
|
|
|
|
* @return the nsIURI object containing the specifications for the URI.
|
|
|
|
*/
|
|
|
|
nsIURI getURI (in long index);
|
2003-04-22 07:24:52 +00:00
|
|
|
|
2008-03-30 15:33:01 +00:00
|
|
|
/**
|
|
|
|
* Returns a reference to the object at the given index.
|
|
|
|
*
|
|
|
|
* @param index The 0-based index whose object is to be returned.
|
|
|
|
*
|
|
|
|
* @return the nsIAccessible object at the desired index.
|
|
|
|
*/
|
|
|
|
nsIAccessible getAnchor (in long index);
|
2003-04-22 07:24:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Assumptions:
|
|
|
|
|
|
|
|
The object associated with object or anchor index
|
|
|
|
is an nsIAccessible.
|
|
|
|
A URI can be represented by the nsIURI interface
|
|
|
|
(or nsIURL interface).
|
|
|
|
|
|
|
|
Note that an object which supports nsIAccessibleHyperlink
|
|
|
|
does *not* generally implement nsIAccessible, unlike the
|
|
|
|
case of the other nsiAccessible* interfaces in this directory.
|
|
|
|
|
|
|
|
Aaron: would the nsISupports return from
|
|
|
|
getObject be queryable for nsIURI and nsIURL directly?
|
|
|
|
|
|
|
|
*/
|