Path: blob/master/src/java.desktop/share/classes/javax/accessibility/AccessibleHypertext.java
41153 views
/*1* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.accessibility;2627/**28* The {@code AccessibleHypertext} class is the base class for all classes that29* present hypertext information on the display. This class provides the30* standard mechanism for an assistive technology to access that text via its31* content, attributes, and spatial location. It also provides standard32* mechanisms for manipulating hyperlinks. Applications can determine if an33* object supports the {@code AccessibleHypertext} interface by first obtaining34* its {@code AccessibleContext} (see {@link Accessible}) and then calling the35* {@link AccessibleContext#getAccessibleText} method of36* {@code AccessibleContext}. If the return value is a class which extends37* {@code AccessibleHypertext}, then that object supports38* {@code AccessibleHypertext}.39*40* @author Peter Korn41* @see Accessible42* @see Accessible#getAccessibleContext43* @see AccessibleContext44* @see AccessibleText45* @see AccessibleContext#getAccessibleText46*/47public interface AccessibleHypertext extends AccessibleText {4849/**50* Returns the number of links within this hypertext document.51*52* @return number of links in this hypertext doc53*/54public abstract int getLinkCount();5556/**57* Returns the nth Link of this Hypertext document.58*59* @param linkIndex within the links of this Hypertext60* @return Link object encapsulating the nth link(s)61*/62public abstract AccessibleHyperlink getLink(int linkIndex);6364/**65* Returns the index into an array of hyperlinks that is associated with66* this character index, or -1 if there is no hyperlink associated with this67* index.68*69* @param charIndex index within the text70* @return index into the set of hyperlinks for this hypertext doc71*/72public abstract int getLinkIndex(int charIndex);73}747576