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 /** 15 * This adapter class provides default implementations for the 16 * methods described by the <code>AccessibleTextListener</code> interface. 17 * <p> 18 * Classes that wish to deal with <code>AccessibleTextEvent</code>s can 19 * extend this class and override only the methods that they are 20 * interested in. 21 * </p><p> 22 * Note: Accessibility clients use child identifiers to specify 23 * whether they want information about a control or one of its children. 24 * Child identifiers are increasing integers beginning with 0. 25 * The identifier CHILDID_SELF represents the control itself. 26 * When returning a child identifier to a client, you may use CHILDID_NONE 27 * to indicate that no child or control has the required information. 28 * </p><p> 29 * Note: This adapter is typically used by implementors of 30 * a custom control to provide very detailed information about 31 * the control instance to accessibility clients. 32 * </p> 33 * 34 * @see AccessibleTextListener 35 * @see AccessibleTextEvent 36 * 37 * @since 3.0 38 */ 39 public abstract class AccessibleTextAdapter implements AccessibleTextListener { 40 41 /** 42 * Sent when an accessibility client requests the current character offset 43 * of the text caret. 44 * The default behavior is to do nothing. 45 * <p> 46 * Return the caret offset in the <code>offset</code> 47 * field of the event object. 48 * </p> 49 * 50 * @param e an event object containing the following fields:<ul> 51 * <li>childID [IN] - an identifier specifying a child of the control</li> 52 * <li>offset [OUT] - the current offset of the text caret</li> 53 * </ul> 54 */ 55 public void getCaretOffset (AccessibleTextEvent e) { 56 } 57 58 /** 59 * Sent when an accessibility client requests the range of the current 60 * text selection. 61 * The default behavior is to do nothing. 62 * <p> 63 * Return the selection start offset and non-negative length in the 64 * <code>offset</code> and <code>length</code> fields of the event object. 65 * </p> 66 * 67 * @param e an event object containing the following fields:<ul> 68 * <li>childID [IN] - an identifier specifying a child of the control</li> 69 * <li>offset [OUT] - the offset of the current text selection</li> 70 * <li>length [OUT] - the length of the current text selection</li> 71 * </ul> 72 */ 73 public void getSelectionRange (AccessibleTextEvent e) { 74 } 75 } 76