]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/accessibility/AccessibleControlAdapter.java
b1de1ec4c57eb7733af6e52e999c1d58cdbc5260
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / accessibility / AccessibleControlAdapter.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2016 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.accessibility;
15
16
17 /**
18  * This adapter class provides default implementations for the
19  * methods described by the <code>AccessibleControlListener</code> interface.
20  * <p>
21  * Classes that wish to deal with <code>AccessibleControlEvent</code>s can
22  * extend this class and override only the methods that they are
23  * interested in.
24  * </p><p>
25  * Note: Accessibility clients use child identifiers to specify
26  * whether they want information about a control or one of its children.
27  * Child identifiers are increasing integers beginning with 0.
28  * The identifier CHILDID_SELF represents the control itself.
29  * When returning a child identifier to a client, you may use CHILDID_NONE
30  * to indicate that no child or control has the required information.
31  * </p><p>
32  * Note: This adapter is typically used by implementors of
33  * a custom control to provide very detailed information about
34  * the control instance to accessibility clients.
35  * </p>
36  *
37  * @see AccessibleControlListener
38  * @see AccessibleControlEvent
39  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
40  *
41  * @since 2.0
42  */
43 public abstract class AccessibleControlAdapter implements AccessibleControlListener {
44
45         /**
46          * Sent when an accessibility client requests the identifier
47          * of the control child at the specified display coordinates.
48          * The default behavior is to do nothing.
49          * <p>
50          * Return the identifier of the child at display point (x, y)
51          * in the <code>childID</code> field of the event object.
52          * Return CHILDID_SELF if point (x, y) is in the control itself
53          * and not in any child. Return CHILDID_NONE if point (x, y)
54          * is not contained in either the control or any of its children.
55          * </p>
56          *
57          * @param e an event object containing the following fields:<ul>
58          *    <li>x, y [IN] - the specified point in display coordinates</li>
59          *    <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
60          *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
61          * </ul>
62          */
63         @Override
64         public void getChildAtPoint(AccessibleControlEvent e) {
65         }
66
67         /**
68          * Sent when an accessibility client requests the location
69          * of the control, or the location of a child of the control.
70          * The default behavior is to do nothing.
71          * <p>
72          * Return a rectangle describing the location of the specified
73          * control or child in the <code>x, y, width, and height</code>
74          * fields of the event object.
75          * </p>
76          *
77          * @param e an event object containing the following fields:<ul>
78          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
79          *    <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
80          * </ul>
81          */
82         @Override
83         public void getLocation(AccessibleControlEvent e) {
84         }
85
86         /**
87          * Sent when an accessibility client requests the accessible object
88          * for a child of the control by index or childID, or when a client
89          * requests the index of an accessible object in its parent.
90          * <p>
91          * The childID field in the event object can be one of the following:</p>
92          * <ul>
93          *    <li>an integer child ID - return the accessible object for the specified child ID,
94          *      or null if the specified child does not have its own accessible</li>
95          *    <li>{@link ACC#CHILDID_CHILD_AT_INDEX} - return the accessible child object at the specified index,
96          *      or null if this object has no children</li>
97          *    <li>{@link ACC#CHILDID_CHILD_INDEX} - return the index of this accessible in its parent</li>
98          * </ul>
99          *
100          * @param e an event object containing the following fields:<ul>
101          *    <li>childID [IN] - an identifier specifying a child of the control, or one of the predefined CHILDID constants</li>
102          *    <li>detail [Optional IN] - the index of the child accessible to be returned when childID = CHILDID_CHILD_AT_INDEX</li>
103          *    <li>detail [Optional OUT] - the index of this accessible in its parent when childID = CHILDID_CHILD_INDEX</li>
104          *    <li>accessible [Optional OUT] - an Accessible for the specified childID or index, or null if one does not exist</li>
105          * </ul>
106          */
107         @Override
108         public void getChild(AccessibleControlEvent e) {
109         }
110
111         /**
112          * Sent when an accessibility client requests the number of
113          * children in the control.
114          * The default behavior is to do nothing.
115          * <p>
116          * Return the number of child items in the <code>detail</code>
117          * field of the event object.
118          * </p>
119          *
120          * @param e an event object containing the following fields:<ul>
121          *    <li>detail [OUT] - the number of child items in this control</li>
122          * </ul>
123          */
124         @Override
125         public void getChildCount(AccessibleControlEvent e) {
126         }
127
128         /**
129          * Sent when an accessibility client requests the default action
130          * of the control, or the default action of a child of the control.
131          * The default behavior is to do nothing.
132          * <p>
133          * This string is typically a verb describing what the user does to it.
134          * For example, a Push Button's default action is "Press", a Check Button's
135          * is "Check" or "UnCheck", and List items have the default action "Double Click".
136          * </p><p>
137          * Return a string describing the default action of the specified
138          * control or child in the <code>result</code> field of the event object.
139          * Returning null tells the client to use the platform default action string.
140          * </p>
141          *
142          * @param e an event object containing the following fields:<ul>
143          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
144          *    <li>result [OUT] - the requested default action string, or null</li>
145          * </ul>
146          */
147         @Override
148         public void getDefaultAction(AccessibleControlEvent e) {
149         }
150
151         /**
152          * Sent when an accessibility client requests the identity of
153          * the child or control that has keyboard focus.
154          * The default behavior is to do nothing.
155          * <p>
156          * Return the identifier of the child that has focus in the
157          * <code>childID</code> field of the event object.
158          * Return CHILDID_SELF if the control itself has keyboard focus.
159          * Return CHILDID_NONE if neither the control nor any of its children has focus.
160          * </p>
161          *
162          * @param e an event object containing the following fields:<ul>
163          *    <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
164          *    <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
165          * </ul>
166          */
167         @Override
168         public void getFocus(AccessibleControlEvent e) {
169         }
170
171         /**
172          * Sent when an accessibility client requests the role
173          * of the control, or the role of a child of the control.
174          * The default behavior is to do nothing.
175          * <p>
176          * Return a role constant (constant defined in ACC beginning with ROLE_)
177          * that describes the role of the specified control or child in the
178          * <code>detail</code> field of the event object.
179          * </p>
180          *
181          * @param e an event object containing the following fields:<ul>
182          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
183          *    <li>detail [OUT] - a role constant describing the role of the control or child</li>
184          * </ul>
185          */
186         @Override
187         public void getRole(AccessibleControlEvent e) {
188         }
189
190         /**
191          * Sent when an accessibility client requests the identity of
192          * the child or control that is currently selected.
193          * The default behavior is to do nothing.
194          * <p>
195          * Return the identifier of the selected child in the
196          * <code>childID</code> field of the event object.
197          * Return CHILDID_SELF if the control itself is selected.
198          * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
199          * Return CHILDID_NONE if neither the control nor any of its children are selected.
200          * </p>
201          *
202          * @param e an event object containing the following fields:<ul>
203          *    <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
204          *    <li>children [Optional OUT] - the array of childIDs for the selected children if CHILDID_MULTIPLE is returned</li>
205          *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
206          * </ul>
207          */
208         @Override
209         public void getSelection(AccessibleControlEvent e) {
210         }
211
212         /**
213          * Sent when an accessibility client requests the state
214          * of the control, or the state of a child of the control.
215          * The default behavior is to do nothing.
216          * <p>
217          * Return a state mask (mask bit constants defined in ACC beginning with STATE_)
218          * that describes the current state of the specified control or child in the
219          * <code>detail</code> field of the event object.
220          * </p>
221          *
222          * @param e an event object containing the following fields:<ul>
223          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
224          *    <li>detail [OUT] - a state mask describing the current state of the control or child</li>
225          * </ul>
226          */
227         @Override
228         public void getState(AccessibleControlEvent e) {
229         }
230
231         /**
232          * Sent when an accessibility client requests the value
233          * of the control, or the value of a child of the control.
234          * The default behavior is to do nothing.
235          * <p>
236          * Many controls do not return a value. Examples of controls
237          * that do are: Combo returns the text string, Text returns
238          * its contents, ProgressBar returns a string representing a
239          * percentage, and Tree items return a string representing
240          * their level in the tree.
241          * </p><p>
242          * Return a string describing the value of the specified control
243          * or child in the <code>result</code> field of the event object.
244          * Returning null tells the client to use the platform value string.
245          * </p>
246          *
247          * @param e an event object containing the following fields:<ul>
248          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
249          *    <li>result [OUT] - the requested value string, or null</li>
250          * </ul>
251          */
252         @Override
253         public void getValue(AccessibleControlEvent e) {
254         }
255
256         /**
257          * Sent when an accessibility client requests the children, or visible children,
258          * of the control. The default behavior is to do nothing.
259          * <p>
260          * Return the children as an array of childIDs or accessibles in the
261          * <code>children</code> field of the event object.
262          * </p>
263          *
264          * @param e an event object containing the following fields:<ul>
265          *    <li>detail [IN] - a flag that may have one of the following values:<ul>
266          *      <li>0 (default) - return all children</li>
267          *      <li>VISIBLE - return all visible children</li>
268          *    </ul>
269          *    <li>children [Typical OUT] - an array of childIDs</li>
270          *    <li>children [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
271          * </ul>
272          */
273         @Override
274         public void getChildren(AccessibleControlEvent e) {
275         }
276 }