1 /*******************************************************************************
2 * Copyright (c) 2000, 2005 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;
17 import org.eclipse.swt.internal.*;
20 * Classes that implement this interface provide methods
21 * that deal with the events that are generated when an
22 * accessibility client sends a message to a control.
24 * After creating an instance of a class that implements
25 * this interface it can be added to a control using the
26 * <code>addAccessibleTextListener</code> method and removed
27 * using the <code>removeAccessibleTextListener</code> method.
28 * When a client requests information the appropriate method
31 * Note: Accessibility clients use child identifiers to specify
32 * whether they want information about a control or one of its children.
33 * Child identifiers are increasing integers beginning with 0.
34 * The identifier CHILDID_SELF represents the control itself.
36 * Note: This interface is typically used by implementors of
37 * a custom control to provide very detailed information about
38 * the control instance to accessibility clients.
41 * @see AccessibleTextAdapter
42 * @see AccessibleTextEvent
46 public interface AccessibleTextListener extends SWTEventListener {
49 * Sent when an accessibility client requests the current character offset
52 * Return the caret offset in the <code>offset</code>
53 * field of the event object.
56 * @param e an event object containing the following fields:<ul>
57 * <li>childID [IN] - an identifier specifying a child of the control</li>
58 * <li>offset [OUT] - the current offset of the text caret</li>
61 public void getCaretOffset (AccessibleTextEvent e);
64 * Sent when an accessibility client requests the range of the current
67 * Return the selection start offset and non-negative length in the
68 * <code>offset</code> and <code>length</code> fields of the event object.
71 * @param e an event object containing the following fields:<ul>
72 * <li>childID [IN] - an identifier specifying a child of the control</li>
73 * <li>offset [OUT] - the offset of the current text selection</li>
74 * <li>length [OUT] - the length of the current text selection</li>
77 public void getSelectionRange (AccessibleTextEvent e);