1 /*******************************************************************************
2  * Copyright (c) 2000, 2008 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  * Port to the D programming language:
11  *     Frank Benoit <benoit@tionex.de>
12  *******************************************************************************/
13 module org.eclipse.swt.accessibility.AccessibleTextAdapter;
14 
15 import org.eclipse.swt.accessibility.AccessibleTextEvent;
16 import org.eclipse.swt.accessibility.AccessibleTextListener;
17 
18 /**
19  * This adapter class provides default implementations for the
20  * methods described by the <code>AccessibleTextListener</code> interface.
21  * <p>
22  * Classes that wish to deal with <code>AccessibleTextEvent</code>s can
23  * extend this class and override only the methods that they are
24  * interested in.
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  * When returning a child identifier to a client, you may use CHILDID_NONE
31  * to indicate that no child or control has the required information.
32  * </p><p>
33  * Note: This adapter 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 AccessibleTextListener
39  * @see AccessibleTextEvent
40  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
41  *
42  * @since 3.0
43  */
44 public abstract class AccessibleTextAdapter : AccessibleTextListener {
45 
46     /**
47      * Sent when an accessibility client requests the current character offset
48      * of the text caret.
49      * The default behavior is to do nothing.
50      * <p>
51      * Return the caret offset in the <code>offset</code>
52      * field of the event object.
53      * </p>
54      *
55      * @param e an event object containing the following fields:<ul>
56      *    <li>childID [IN] - an identifier specifying a child of the control</li>
57      *    <li>offset [OUT] - the current offset of the text caret</li>
58      * </ul>
59      */
60     public void getCaretOffset (AccessibleTextEvent e) {
61     }
62 
63     /**
64      * Sent when an accessibility client requests the range of the current
65      * text selection.
66      * The default behavior is to do nothing.
67      * <p>
68      * Return the selection start offset and non-negative length in the
69      * <code>offset</code> and <code>length</code> fields of the event object.
70      * </p>
71      *
72      * @param e an event object containing the following fields:<ul>
73      *    <li>childID [IN] - an identifier specifying a child of the control</li>
74      *    <li>offset [OUT] - the offset of the current text selection</li>
75      *    <li>length [OUT] - the length of the current text selection</li>
76      * </ul>
77      */
78     public void getSelectionRange (AccessibleTextEvent e) {
79     }
80 }