1 /******************************************************************************* 2 * Copyright (c) 2000, 2003 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.swt.accessibility; 12 13 14 import org.eclipse.swt.internal.*; 15 16 /** 17 * Classes that implement this interface provide methods 18 * that deal with the events that are generated when an 19 * accessibility client sends a message to a control. 20 * <p> 21 * After creating an instance of a class that implements 22 * this interface it can be added to a control using the 23 * <code>addAccessibleTextListener</code> method and removed 24 * using the <code>removeAccessibleTextListener</code> method. 25 * When a client requests information the appropriate method 26 * will be invoked. 27 * </p><p> 28 * Note: Accessibility clients use child identifiers to specify 29 * whether they want information about a control or one of its children. 30 * Child identifiers are increasing integers beginning with 0. 31 * The identifier CHILDID_SELF represents the control itself. 32 * </p><p> 33 * Note: This interface is typically used by implementors of 34 * a custom control to provide very detailed information about 35 * the control instance to accessibility clients. 36 * </p> 37 * 38 * @see AccessibleTextAdapter 39 * @see AccessibleTextEvent 40 * 41 * @since 3.0 42 */ 43 public interface AccessibleTextListener extends SWTEventListener { 44 45 /** 46 * Sent when an accessibility client requests the current character offset 47 * of the text caret. 48 * <p> 49 * Return the caret offset in the <code>offset</code> 50 * field of the event object. 51 * </p> 52 * 53 * @param e an event object containing the following fields:<ul> 54 * <li>childID [IN] - an identifier specifying a child of the control</li> 55 * <li>offset [OUT] - the current offset of the text caret</li> 56 * </ul> 57 */ 58 public void getCaretOffset (AccessibleTextEvent e); 59 60 /** 61 * Sent when an accessibility client requests the range of the current 62 * text selection. 63 * <p> 64 * Return the selection start offset and non-negative length in the 65 * <code>offset</code> and <code>length</code> fields of the event object. 66 * </p> 67 * 68 * @param e an event object containing the following fields:<ul> 69 * <li>childID [IN] - an identifier specifying a child of the control</li> 70 * <li>offset [OUT] - the offset of the current text selection</li> 71 * <li>length [OUT] - the length of the current text selection</li> 72 * </ul> 73 */ 74 public void getSelectionRange (AccessibleTextEvent e); 75 } 76