summaryrefslogtreecommitdiff
path: root/javax/accessibility/AccessibleHypertext.java
blob: 9256df45a0da73799fea8fc3ecfee18d4118c56b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* AccessibleHypertext.java -- Java interface for aiding in accessibly rendering 
   other Java components
   Copyright (C) 2000 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
 
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.

As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */

package javax.accessibility;

/**
 * Allows an application to determine a set of hyperlinks for a 
 * document and manipulate them.
 * <p>
 * The <code>AccessibleContext.getAccessibleText()</code> method
 * should return an object which extends <code>AccessibleHypertext</code> 
 * if it supports this interface.
 *.
 * @see AccessibleContext.getAccessibleText()
 */
public interface AccessibleHypertext extends AccessibleText {

    /**
     * Returns link object denoted by the number <code>i</code> in this
     * document.
     *
     * @param i the ith hyperlink of the document
     * @return link object denoted by <code>i</code>
     */
    public abstract AccessibleHyperlink getLink(int i);
    
    /**
     * Returns the number of links in the document if any exist.  When
     * no links exist, returns -1.
     * 
     * @return the number of links
     */
    public abstract int getLinkCount();
    
    /**
     * Returns the link index for this character index into the
     * document if a hyperlink is associated with the character
     * specified by the given index.  When no association exists,
     * returns -1.
     * 
     * @param c the character index
     * @return the link index
     */
    public abstract int getLinkIndex(int c);
}