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