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