1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.accessibility;
16 import org.eclipse.swt.internal.SWTEventListener;
19 * Classes which implement this interface provide methods
20 * that handle AccessibleHyperlink events.
22 * After creating an instance of a class that implements
23 * this interface it can be added to an accessible using the
24 * <code>addAccessibleHyperlinkListener</code> method and removed using
25 * the <code>removeAccessibleHyperlinkListener</code> method.
28 * @see AccessibleHyperlinkAdapter
29 * @see AccessibleHyperlinkEvent
33 public interface AccessibleHyperlinkListener extends SWTEventListener {
35 * Returns the anchor for the link at the specified index.
37 * @param e an event object containing the following fields:<ul>
38 * <li>[in] index - a 0 based index identifying the anchor if this object
39 * has more than one link, as in the case of an image map</li>
40 * <li>[typical out] result - the returned anchor</li>
41 * <li>[optional out] accessible - the returned anchor.
42 * Note: The returned anchor can either be a string or an accessible.
43 * For example, for a text link this could be the substring of the containing string
44 * where the substring is overridden with link behavior, and for an image link this could be
45 * the accessible for the image.</li>
48 public void getAnchor(AccessibleHyperlinkEvent e);
51 * Returns the target of the link at the specified index.
53 * @param e an event object containing the following fields:<ul>
54 * <li>[in] index - a 0 based index identifying the anchor if this object
55 * has more than one link, as in the case of an image map</li>
56 * <li>[typical out] result - the returned target</li>
57 * <li>[optional out] accessible - the returned target.
58 * Note: The returned target can either be a string or an accessible.
59 * For example, this could be a string URI, or the accessible for the target
60 * object to be activated when the link is activated.</li>
63 public void getAnchorTarget(AccessibleHyperlinkEvent e);
66 * Returns the 0 based character offset at which the textual representation of the hyperlink starts.
68 * The returned value is related to the AccessibleTextExtended interface of the object that
69 * owns this hyperlink.
72 * @param e an event object containing the following fields:<ul>
73 * <li>[out] index</li>
76 public void getStartIndex(AccessibleHyperlinkEvent e);
79 * Returns the 0 based character offset at which the textual representation of the hyperlink ends.
81 * The returned value is related to the AccessibleTextExtended interface of the object that
82 * owns this hyperlink. The character at the index is not part of the hypertext.
85 * @param e an event object containing the following fields:<ul>
86 * <li>[out] index</li>
89 public void getEndIndex(AccessibleHyperlinkEvent e);