J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | package javax.accessibility; |
| 27 | |
| 28 | |
| 29 | import java.util.*; |
| 30 | import java.awt.*; |
| 31 | import javax.swing.text.*; |
| 32 | |
| 33 | |
| 34 | /** |
| 35 | * <P>The AccessibleHypertext class is the base class for all |
| 36 | * classes that present hypertext information on the display. This class |
| 37 | * provides the standard mechanism for an assistive technology to access |
| 38 | * that text via its content, attributes, and spatial location. |
| 39 | * It also provides standard mechanisms for manipulating hyperlinks. |
| 40 | * Applications can determine if an object supports the AccessibleHypertext |
| 41 | * interface by first obtaining its AccessibleContext (see {@link Accessible}) |
| 42 | * and then calling the {@link AccessibleContext#getAccessibleText} |
| 43 | * method of AccessibleContext. If the return value is a class which extends |
| 44 | * AccessibleHypertext, then that object supports AccessibleHypertext. |
| 45 | * |
| 46 | * @see Accessible |
| 47 | * @see Accessible#getAccessibleContext |
| 48 | * @see AccessibleContext |
| 49 | * @see AccessibleText |
| 50 | * @see AccessibleContext#getAccessibleText |
| 51 | * |
| 52 | * @author Peter Korn |
| 53 | */ |
| 54 | public interface AccessibleHypertext extends AccessibleText { |
| 55 | |
| 56 | /** |
| 57 | * Returns the number of links within this hypertext document. |
| 58 | * |
| 59 | * @return number of links in this hypertext doc. |
| 60 | */ |
| 61 | public abstract int getLinkCount(); |
| 62 | |
| 63 | /** |
| 64 | * Returns the nth Link of this Hypertext document. |
| 65 | * |
| 66 | * @param linkIndex within the links of this Hypertext |
| 67 | * @return Link object encapsulating the nth link(s) |
| 68 | */ |
| 69 | public abstract AccessibleHyperlink getLink(int linkIndex); |
| 70 | |
| 71 | /** |
| 72 | * Returns the index into an array of hyperlinks that |
| 73 | * is associated with this character index, or -1 if there |
| 74 | * is no hyperlink associated with this index. |
| 75 | * |
| 76 | * @param charIndex index within the text |
| 77 | * @return index into the set of hyperlinks for this hypertext doc. |
| 78 | */ |
| 79 | public abstract int getLinkIndex(int charIndex); |
| 80 | } |