1. /*
  2. * @(#)AccessibleHypertext.java 1.5 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.accessibility;
  8. import java.lang.*;
  9. import java.util.*;
  10. import java.awt.*;
  11. import javax.swing.text.*;
  12. /**
  13. * <P>The AccessibleHypertext class is the base class for all
  14. * classes that present hypertext information on the display. This class
  15. * provides the standard mechanism for an assistive technology to access
  16. * that text via its content, attributes, and spatial location.
  17. * It also provides standard mechanisms for manipulating hyperlinks.
  18. * Applications can determine if an object supports the AccessibleHypertext
  19. * interface by first obtaining its AccessibleContext (see {@link Accessible})
  20. * and then calling the {@link AccessibleContext#getAccessibleText}
  21. * method of AccessibleContext. If the return value is a class which extends
  22. * AccessibleHypertext, then that object supports AccessibleHypertext.
  23. *
  24. * @see Accessible
  25. * @see Accessible#getAccessibleContext
  26. * @see AccessibleContext
  27. * @see AccessibleText
  28. * @see AccessibleContext#getAccessibleText
  29. *
  30. * @version
  31. * @author Peter Korn
  32. */
  33. public interface AccessibleHypertext extends AccessibleText {
  34. /**
  35. * Returns the number of links within this hypertext doc.
  36. *
  37. * @return number of links in this hypertext doc.
  38. */
  39. public abstract int getLinkCount();
  40. /**
  41. * Returns the nth Link of this Hypertext document.
  42. *
  43. * @param linkIndex within the links of this Hypertext
  44. * @return Link object encapsulating the nth link(s)
  45. */
  46. public abstract AccessibleHyperlink getLink(int linkIndex);
  47. /**
  48. * Returns the index into an array of hyperlinks that
  49. * is associated with this character index, or -1 if there
  50. * is no hyperlink associated with this index.
  51. *
  52. * @param charIndex index within the text
  53. * @return index into the set of hyperlinks for this hypertext doc.
  54. */
  55. public abstract int getLinkIndex(int charIndex);
  56. }