01 /*
02 * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * 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 import java.util.*;
29 import java.awt.*;
30 import javax.swing.text.*;
31
32 /**
33 * <P>The AccessibleHypertext class is the base class for all
34 * classes that present hypertext information on the display. This class
35 * provides the standard mechanism for an assistive technology to access
36 * that text via its content, attributes, and spatial location.
37 * It also provides standard mechanisms for manipulating hyperlinks.
38 * Applications can determine if an object supports the AccessibleHypertext
39 * interface by first obtaining its AccessibleContext (see {@link Accessible})
40 * and then calling the {@link AccessibleContext#getAccessibleText}
41 * method of AccessibleContext. If the return value is a class which extends
42 * AccessibleHypertext, then that object supports AccessibleHypertext.
43 *
44 * @see Accessible
45 * @see Accessible#getAccessibleContext
46 * @see AccessibleContext
47 * @see AccessibleText
48 * @see AccessibleContext#getAccessibleText
49 *
50 * @version
51 * @author Peter Korn
52 */
53 public interface AccessibleHypertext extends AccessibleText {
54
55 /**
56 * Returns the number of links within this hypertext document.
57 *
58 * @return number of links in this hypertext doc.
59 */
60 public abstract int getLinkCount();
61
62 /**
63 * Returns the nth Link of this Hypertext document.
64 *
65 * @param linkIndex within the links of this Hypertext
66 * @return Link object encapsulating the nth link(s)
67 */
68 public abstract AccessibleHyperlink getLink(int linkIndex);
69
70 /**
71 * Returns the index into an array of hyperlinks that
72 * is associated with this character index, or -1 if there
73 * is no hyperlink associated with this index.
74 *
75 * @param charIndex index within the text
76 * @return index into the set of hyperlinks for this hypertext doc.
77 */
78 public abstract int getLinkIndex(int charIndex);
79 }
|