Mercurial > projects > dwt-linux
comparison dwt/accessibility/AccessibleControlAdapter.d @ 42:787b5413b0ce
accessibility package
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Jan 2008 05:07:22 +0100 |
parents | |
children | 8cec8f536af3 |
comparison
equal
deleted
inserted
replaced
41:c83c51423d03 | 42:787b5413b0ce |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2006 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 module dwt.accessibility.AccessibleControlAdapter; | |
12 | |
13 import dwt.accessibility.AccessibleControlListener; | |
14 import dwt.accessibility.AccessibleControlEvent; | |
15 | |
16 /** | |
17 * This adapter class provides default implementations for the | |
18 * methods described by the <code>AccessibleControlListener</code> interface. | |
19 * <p> | |
20 * Classes that wish to deal with <code>AccessibleControlEvent</code>s can | |
21 * extend this class and override only the methods that they are | |
22 * interested in. | |
23 * </p><p> | |
24 * Note: Accessibility clients use child identifiers to specify | |
25 * whether they want information about a control or one of its children. | |
26 * Child identifiers are increasing integers beginning with 0. | |
27 * The identifier CHILDID_SELF represents the control itself. | |
28 * When returning a child identifier to a client, you may use CHILDID_NONE | |
29 * to indicate that no child or control has the required information. | |
30 * </p><p> | |
31 * Note: This adapter 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 AccessibleControlListener | |
37 * @see AccessibleControlEvent | |
38 * | |
39 * @since 2.0 | |
40 */ | |
41 public abstract class AccessibleControlAdapter : AccessibleControlListener { | |
42 | |
43 /** | |
44 * Sent when an accessibility client requests the identifier | |
45 * of the control child at the specified display coordinates. | |
46 * The default behavior is to do nothing. | |
47 * <p> | |
48 * Return the identifier of the child at display point (x, y) | |
49 * in the <code>childID</code> field of the event object. | |
50 * Return CHILDID_SELF if point (x, y) is in the control itself | |
51 * and not in any child. Return CHILDID_NONE if point (x, y) | |
52 * is not contained in either the control or any of its children. | |
53 * </p> | |
54 * | |
55 * @param e an event object containing the following fields:<ul> | |
56 * <li>x, y [IN] - the specified point in display coordinates</li> | |
57 * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li> | |
58 * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li> | |
59 * </ul> | |
60 */ | |
61 public void getChildAtPoint(AccessibleControlEvent e) { | |
62 } | |
63 | |
64 /** | |
65 * Sent when an accessibility client requests the location | |
66 * of the control, or the location of a child of the control. | |
67 * The default behavior is to do nothing. | |
68 * <p> | |
69 * Return a rectangle describing the location of the specified | |
70 * control or child in the <code>x, y, width, and height</code> | |
71 * fields of the event object. | |
72 * </p> | |
73 * | |
74 * @param e an event object containing the following fields:<ul> | |
75 * <li>childID [IN] - an identifier specifying the control or one of its children</li> | |
76 * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li> | |
77 * </ul> | |
78 */ | |
79 public void getLocation(AccessibleControlEvent e) { | |
80 } | |
81 | |
82 /** | |
83 * Sent when an accessibility client requests the accessible object | |
84 * for a child of the control. | |
85 * The default behavior is to do nothing. | |
86 * <p> | |
87 * Return an <code>Accessible</code> for the specified control or | |
88 * child in the <code>accessible</code> field of the event object. | |
89 * Return null if the specified child does not have its own | |
90 * <code>Accessible</code>. | |
91 * </p> | |
92 * | |
93 * @param e an event object containing the following fields:<ul> | |
94 * <li>childID [IN] - an identifier specifying a child of the control</li> | |
95 * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li> | |
96 * </ul> | |
97 */ | |
98 public void getChild(AccessibleControlEvent e) { | |
99 } | |
100 | |
101 /** | |
102 * Sent when an accessibility client requests the number of | |
103 * children in the control. | |
104 * The default behavior is to do nothing. | |
105 * <p> | |
106 * Return the number of child items in the <code>detail</code> | |
107 * field of the event object. | |
108 * </p> | |
109 * | |
110 * @param e an event object containing the following fields:<ul> | |
111 * <li>detail [OUT] - the number of child items in this control</li> | |
112 * </ul> | |
113 */ | |
114 public void getChildCount(AccessibleControlEvent e) { | |
115 } | |
116 | |
117 /** | |
118 * Sent when an accessibility client requests the default action | |
119 * of the control, or the default action of a child of the control. | |
120 * The default behavior is to do nothing. | |
121 * <p> | |
122 * This string is typically a verb describing what the user does to it. | |
123 * For example, a Push Button's default action is "Press", a Check Button's | |
124 * is "Check" or "UnCheck", and List items have the default action "Double Click". | |
125 * </p><p> | |
126 * Return a string describing the default action of the specified | |
127 * control or child in the <code>result</code> field of the event object. | |
128 * Returning null tells the client to use the platform default action string. | |
129 * </p> | |
130 * | |
131 * @param e an event object containing the following fields:<ul> | |
132 * <li>childID [IN] - an identifier specifying the control or one of its children</li> | |
133 * <li>result [OUT] - the requested default action string, or null</li> | |
134 * </ul> | |
135 */ | |
136 public void getDefaultAction(AccessibleControlEvent e) { | |
137 } | |
138 | |
139 /** | |
140 * Sent when an accessibility client requests the identity of | |
141 * the child or control that has keyboard focus. | |
142 * The default behavior is to do nothing. | |
143 * <p> | |
144 * Return the identifier of the child that has focus in the | |
145 * <code>childID</code> field of the event object. | |
146 * Return CHILDID_SELF if the control itself has keyboard focus. | |
147 * Return CHILDID_NONE if neither the control nor any of its children has focus. | |
148 * </p> | |
149 * | |
150 * @param e an event object containing the following fields:<ul> | |
151 * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li> | |
152 * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li> | |
153 * </ul> | |
154 */ | |
155 public void getFocus(AccessibleControlEvent e) { | |
156 } | |
157 | |
158 /** | |
159 * Sent when an accessibility client requests the role | |
160 * of the control, or the role of a child of the control. | |
161 * The default behavior is to do nothing. | |
162 * <p> | |
163 * Return a role constant (constant defined in ACC beginning with ROLE_) | |
164 * that describes the role of the specified control or child in the | |
165 * <code>detail</code> field of the event object. | |
166 * </p> | |
167 * | |
168 * @param e an event object containing the following fields:<ul> | |
169 * <li>childID [IN] - an identifier specifying the control or one of its children</li> | |
170 * <li>detail [OUT] - a role constant describing the role of the control or child</li> | |
171 * </ul> | |
172 */ | |
173 public void getRole(AccessibleControlEvent e) { | |
174 } | |
175 | |
176 /** | |
177 * Sent when an accessibility client requests the identity of | |
178 * the child or control that is currently selected. | |
179 * The default behavior is to do nothing. | |
180 * <p> | |
181 * Return the identifier of the selected child in the | |
182 * <code>childID</code> field of the event object. | |
183 * Return CHILDID_SELF if the control itself is selected. | |
184 * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field. | |
185 * Return CHILDID_NONE if neither the control nor any of its children are selected. | |
186 * </p> | |
187 * | |
188 * @param e an event object containing the following fields:<ul> | |
189 * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li> | |
190 * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li> | |
191 * </ul> | |
192 */ | |
193 public void getSelection(AccessibleControlEvent e) { | |
194 } | |
195 | |
196 /** | |
197 * Sent when an accessibility client requests the state | |
198 * of the control, or the state of a child of the control. | |
199 * The default behavior is to do nothing. | |
200 * <p> | |
201 * Return a state mask (mask bit constants defined in ACC beginning with STATE_) | |
202 * that describes the current state of the specified control or child in the | |
203 * <code>detail</code> field of the event object. | |
204 * </p> | |
205 * | |
206 * @param e an event object containing the following fields:<ul> | |
207 * <li>childID [IN] - an identifier specifying the control or one of its children</li> | |
208 * <li>detail [OUT] - a state mask describing the current state of the control or child</li> | |
209 * </ul> | |
210 */ | |
211 public void getState(AccessibleControlEvent e) { | |
212 } | |
213 | |
214 /** | |
215 * Sent when an accessibility client requests the value | |
216 * of the control, or the value of a child of the control. | |
217 * The default behavior is to do nothing. | |
218 * <p> | |
219 * Many controls do not return a value. Examples of controls | |
220 * that do are: Combo returns the text string, Text returns | |
221 * its contents, ProgressBar returns a string representing a | |
222 * percentage, and Tree items return a string representing | |
223 * their level in the tree. | |
224 * </p><p> | |
225 * Return a string describing the value of the specified control | |
226 * or child in the <code>result</code> field of the event object. | |
227 * Returning null tells the client to use the platform value string. | |
228 * </p> | |
229 * | |
230 * @param e an event object containing the following fields:<ul> | |
231 * <li>childID [IN] - an identifier specifying the control or one of its children</li> | |
232 * <li>result [OUT] - the requested value string, or null</li> | |
233 * </ul> | |
234 */ | |
235 public void getValue(AccessibleControlEvent e) { | |
236 } | |
237 | |
238 /** | |
239 * Sent when an accessibility client requests the children of the control. | |
240 * The default behavior is to do nothing. | |
241 * <p> | |
242 * Return the children as an array of childIDs in the <code>children</code> | |
243 * field of the event object. | |
244 * </p> | |
245 * | |
246 * @param e an event object containing the following fields:<ul> | |
247 * <li>children [Typical OUT] - an array of childIDs</li> | |
248 * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li> | |
249 * </ul> | |
250 */ | |
251 public void getChildren(AccessibleControlEvent e) { | |
252 } | |
253 } |