]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/accessibility/AccessibleControlListener.java
Merge branch 'bug-623' into release/1.43.0
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / accessibility / AccessibleControlListener.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2010 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 import org.eclipse.swt.internal.*;
18
19 /**
20  * Classes that implement this interface provide methods
21  * that deal with the events that are generated when an
22  * accessibility client sends a message to a control.
23  * <p>
24  * After creating an instance of a class that implements
25  * this interface it can be added to a control using the
26  * <code>addAccessibleControlListener</code> method and removed
27  * using the <code>removeAccessibleControlListener</code> method.
28  * When a client requests information the appropriate method
29  * will be invoked.
30  * </p><p>
31  * Note: Accessibility clients use child identifiers to specify
32  * whether they want information about a control or one of its children.
33  * Child identifiers are increasing integers beginning with 0.
34  * The identifier CHILDID_SELF represents the control itself.
35  * </p><p>
36  * Note: This interface is typically used by implementors of
37  * a custom control to provide very detailed information about
38  * the control instance to accessibility clients.
39  * </p>
40  *
41  * @see AccessibleControlAdapter
42  * @see AccessibleControlEvent
43  *
44  * @since 2.0
45  */
46 public interface AccessibleControlListener extends SWTEventListener {
47
48         /**
49          * Sent when an accessibility client requests the identifier
50          * of the control child at the specified display coordinates.
51          * <p>
52          * Return the identifier of the child at display point (x, y)
53          * in the <code>childID</code> field of the event object.
54          * Return CHILDID_SELF if point (x, y) is in the control itself
55          * and not in any child. Return CHILDID_NONE if point (x, y)
56          * is not contained in either the control or any of its children.
57          * </p>
58          *
59          * @param e an event object containing the following fields:<ul>
60          *    <li>x, y [IN] - the specified point in display coordinates</li>
61          *    <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
62          *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
63          * </ul>
64          */
65         public void getChildAtPoint(AccessibleControlEvent e);
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          * <p>
71          * Return a rectangle describing the location of the specified
72          * control or child in the <code>x, y, width, and height</code>
73          * fields of the event object.
74          * </p>
75          *
76          * @param e an event object containing the following fields:<ul>
77          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
78          *    <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
79          * </ul>
80          */
81         public void getLocation(AccessibleControlEvent e);
82
83         /**
84          * Sent when an accessibility client requests the accessible object
85          * for a child of the control by index or childID, or when a client
86          * requests the index of an accessible object in its parent.
87          * <p>
88          * The childID field in the event object can be one of the following:</p>
89          * <ul>
90          *    <li>an integer child ID - return the accessible object for the specified child ID,
91          *      or null if the specified child does not have its own accessible</li>
92          *    <li>{@link ACC#CHILDID_CHILD_AT_INDEX} - return the accessible child object at the specified index,
93          *      or null if this object has no children</li>
94          *    <li>{@link ACC#CHILDID_CHILD_INDEX} - return the index of this accessible in its parent</li>
95          * </ul>
96          *
97          * @param e an event object containing the following fields:<ul>
98          *    <li>childID [IN] - an identifier specifying a child of the control, or one of the predefined CHILDID constants</li>
99          *    <li>detail [Optional IN] - the index of the child accessible to be returned when childID = CHILDID_CHILD_AT_INDEX</li>
100          *    <li>detail [Optional OUT] - the index of this accessible in its parent when childID = CHILDID_CHILD_INDEX</li>
101          *    <li>accessible [Optional OUT] - an Accessible for the specified childID or index, or null if one does not exist</li>
102          * </ul>
103          */
104         public void getChild(AccessibleControlEvent e);
105
106         /**
107          * Sent when an accessibility client requests the number of
108          * children in the control.
109          * <p>
110          * Return the number of child items in the <code>detail</code>
111          * field of the event object.
112          * </p>
113          *
114          * @param e an event object containing the following fields:<ul>
115          *    <li>detail [OUT] - the number of child items in this control</li>
116          * </ul>
117          */
118         public void getChildCount(AccessibleControlEvent e);
119
120         /**
121          * Sent when an accessibility client requests the default action
122          * of the control, or the default action of a child of the control.
123          * <p>
124          * This string is typically a verb describing what the user does to it.
125          * For example, a Push Button's default action is "Press", a Check Button's
126          * is "Check" or "UnCheck", and List items have the default action "Double Click".
127          * </p><p>
128          * Return a string describing the default action of the specified
129          * control or child in the <code>result</code> field of the event object.
130          * Returning null tells the client to use the platform default action string.
131          * </p>
132          *
133          * @param e an event object containing the following fields:<ul>
134          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
135          *    <li>result [OUT] - the requested default action string, or null</li>
136          * </ul>
137          */
138         public void getDefaultAction(AccessibleControlEvent e);
139
140         /**
141          * Sent when an accessibility client requests the identity of
142          * the child or control that has keyboard focus.
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          * Sent when an accessibility client requests the role
159          * of the control, or the role of a child of the control.
160          * <p>
161          * Return a role constant (constant defined in ACC beginning with ROLE_)
162          * that describes the role of the specified control or child in the
163          * <code>detail</code> field of the event object.
164          * </p>
165          *
166          * @param e an event object containing the following fields:<ul>
167          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
168          *    <li>detail [OUT] - a role constant describing the role of the control or child</li>
169          * </ul>
170          */
171         public void getRole(AccessibleControlEvent e);
172
173         /**
174          * Sent when an accessibility client requests the identity of
175          * the child or control that is currently selected.
176          * <p>
177          * Return the identifier of the selected child in the
178          * <code>childID</code> field of the event object.
179          * Return CHILDID_SELF if the control itself is selected.
180          * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
181          * Return CHILDID_NONE if neither the control nor any of its children are selected.
182          * </p>
183          *
184          * @param e an event object containing the following fields:<ul>
185          *    <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
186          *    <li>children [Optional OUT] - the array of childIDs for the selected children if CHILDID_MULTIPLE is returned</li>
187          *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
188          * </ul>
189          */
190         public void getSelection(AccessibleControlEvent e);
191
192         /**
193          * Sent when an accessibility client requests the state
194          * of the control, or the state of a child of the control.
195          * <p>
196          * Return a state mask (mask bit constants defined in ACC beginning with STATE_)
197          * that describes the current state of the specified control or child in the
198          * <code>detail</code> field of the event object.
199          * </p>
200          *
201          * @param e an event object containing the following fields:<ul>
202          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
203          *    <li>detail [OUT] - a state mask describing the current state of the control or child</li>
204          * </ul>
205          */
206         public void getState(AccessibleControlEvent e);
207
208         /**
209          * Sent when an accessibility client requests the value
210          * of the control, or the value of a child of the control.
211          * <p>
212          * Many controls do not return a value. Examples of controls
213          * that do are: Combo returns the text string, Text returns
214          * its contents, ProgressBar returns a string representing a
215          * percentage, and Tree items return a string representing
216          * their level in the tree.
217          * </p><p>
218          * Return a string describing the value of the specified control
219          * or child in the <code>result</code> field of the event object.
220          * Returning null tells the client to use the platform value string.
221          * </p>
222          *
223          * @param e an event object containing the following fields:<ul>
224          *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
225          *    <li>result [OUT] - the requested value string, or null</li>
226          * </ul>
227          */
228         public void getValue(AccessibleControlEvent e);
229
230         /**
231          * Sent when an accessibility client requests the children, or visible children,
232          * of the control.
233          * <p>
234          * Return the children as an array of childIDs or accessibles in the
235          * <code>children</code> field of the event object.
236          * </p>
237          *
238          * @param e an event object containing the following fields:<ul>
239          *    <li>detail [IN] - a flag that may have one of the following values:<ul>
240          *      <li>0 (default) - return all children</li>
241          *      <li>VISIBLE - return all visible children</li>
242          *    </ul>
243          *    <li>children [Typical OUT] - an array of childIDs</li>
244          *    <li>children [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
245          * </ul>
246          */
247         public void getChildren(AccessibleControlEvent e);
248 }