001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.swt.accessibility;
011:
012: /**
013: * This adapter class provides default implementations for the
014: * methods described by the <code>AccessibleControlListener</code> interface.
015: * <p>
016: * Classes that wish to deal with <code>AccessibleControlEvent</code>s can
017: * extend this class and override only the methods that they are
018: * interested in.
019: * </p><p>
020: * Note: Accessibility clients use child identifiers to specify
021: * whether they want information about a control or one of its children.
022: * Child identifiers are increasing integers beginning with 0.
023: * The identifier CHILDID_SELF represents the control itself.
024: * When returning a child identifier to a client, you may use CHILDID_NONE
025: * to indicate that no child or control has the required information.
026: * </p><p>
027: * Note: This adapter is typically used by implementors of
028: * a custom control to provide very detailed information about
029: * the control instance to accessibility clients.
030: * </p>
031: *
032: * @see AccessibleControlListener
033: * @see AccessibleControlEvent
034: *
035: * @since 2.0
036: */
037: public abstract class AccessibleControlAdapter implements
038: AccessibleControlListener {
039:
040: /**
041: * Sent when an accessibility client requests the identifier
042: * of the control child at the specified display coordinates.
043: * The default behavior is to do nothing.
044: * <p>
045: * Return the identifier of the child at display point (x, y)
046: * in the <code>childID</code> field of the event object.
047: * Return CHILDID_SELF if point (x, y) is in the control itself
048: * and not in any child. Return CHILDID_NONE if point (x, y)
049: * is not contained in either the control or any of its children.
050: * </p>
051: *
052: * @param e an event object containing the following fields:<ul>
053: * <li>x, y [IN] - the specified point in display coordinates</li>
054: * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
055: * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
056: * </ul>
057: */
058: public void getChildAtPoint(AccessibleControlEvent e) {
059: }
060:
061: /**
062: * Sent when an accessibility client requests the location
063: * of the control, or the location of a child of the control.
064: * The default behavior is to do nothing.
065: * <p>
066: * Return a rectangle describing the location of the specified
067: * control or child in the <code>x, y, width, and height</code>
068: * fields of the event object.
069: * </p>
070: *
071: * @param e an event object containing the following fields:<ul>
072: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
073: * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
074: * </ul>
075: */
076: public void getLocation(AccessibleControlEvent e) {
077: }
078:
079: /**
080: * Sent when an accessibility client requests the accessible object
081: * for a child of the control.
082: * The default behavior is to do nothing.
083: * <p>
084: * Return an <code>Accessible</code> for the specified control or
085: * child in the <code>accessible</code> field of the event object.
086: * Return null if the specified child does not have its own
087: * <code>Accessible</code>.
088: * </p>
089: *
090: * @param e an event object containing the following fields:<ul>
091: * <li>childID [IN] - an identifier specifying a child of the control</li>
092: * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
093: * </ul>
094: */
095: public void getChild(AccessibleControlEvent e) {
096: }
097:
098: /**
099: * Sent when an accessibility client requests the number of
100: * children in the control.
101: * The default behavior is to do nothing.
102: * <p>
103: * Return the number of child items in the <code>detail</code>
104: * field of the event object.
105: * </p>
106: *
107: * @param e an event object containing the following fields:<ul>
108: * <li>detail [OUT] - the number of child items in this control</li>
109: * </ul>
110: */
111: public void getChildCount(AccessibleControlEvent e) {
112: }
113:
114: /**
115: * Sent when an accessibility client requests the default action
116: * of the control, or the default action of a child of the control.
117: * The default behavior is to do nothing.
118: * <p>
119: * This string is typically a verb describing what the user does to it.
120: * For example, a Push Button's default action is "Press", a Check Button's
121: * is "Check" or "UnCheck", and List items have the default action "Double Click".
122: * </p><p>
123: * Return a string describing the default action of the specified
124: * control or child in the <code>result</code> field of the event object.
125: * Returning null tells the client to use the platform default action string.
126: * </p>
127: *
128: * @param e an event object containing the following fields:<ul>
129: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
130: * <li>result [OUT] - the requested default action string, or null</li>
131: * </ul>
132: */
133: public void getDefaultAction(AccessibleControlEvent e) {
134: }
135:
136: /**
137: * Sent when an accessibility client requests the identity of
138: * the child or control that has keyboard focus.
139: * The default behavior is to do nothing.
140: * <p>
141: * Return the identifier of the child that has focus in the
142: * <code>childID</code> field of the event object.
143: * Return CHILDID_SELF if the control itself has keyboard focus.
144: * Return CHILDID_NONE if neither the control nor any of its children has focus.
145: * </p>
146: *
147: * @param e an event object containing the following fields:<ul>
148: * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
149: * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
150: * </ul>
151: */
152: public void getFocus(AccessibleControlEvent e) {
153: }
154:
155: /**
156: * Sent when an accessibility client requests the role
157: * of the control, or the role of a child of the control.
158: * The default behavior is to do nothing.
159: * <p>
160: * Return a role constant (constant defined in ACC beginning with ROLE_)
161: * that describes the role of the specified control or child in the
162: * <code>detail</code> field of the event object.
163: * </p>
164: *
165: * @param e an event object containing the following fields:<ul>
166: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
167: * <li>detail [OUT] - a role constant describing the role of the control or child</li>
168: * </ul>
169: */
170: public void getRole(AccessibleControlEvent e) {
171: }
172:
173: /**
174: * Sent when an accessibility client requests the identity of
175: * the child or control that is currently selected.
176: * The default behavior is to do nothing.
177: * <p>
178: * Return the identifier of the selected child in the
179: * <code>childID</code> field of the event object.
180: * Return CHILDID_SELF if the control itself is selected.
181: * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
182: * Return CHILDID_NONE if neither the control nor any of its children are selected.
183: * </p>
184: *
185: * @param e an event object containing the following fields:<ul>
186: * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</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: /**
194: * Sent when an accessibility client requests the state
195: * of the control, or the state of a child of the control.
196: * The default behavior is to do nothing.
197: * <p>
198: * Return a state mask (mask bit constants defined in ACC beginning with STATE_)
199: * that describes the current state of the specified control or child in the
200: * <code>detail</code> field of the event object.
201: * </p>
202: *
203: * @param e an event object containing the following fields:<ul>
204: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
205: * <li>detail [OUT] - a state mask describing the current state of the control or child</li>
206: * </ul>
207: */
208: public void getState(AccessibleControlEvent e) {
209: }
210:
211: /**
212: * Sent when an accessibility client requests the value
213: * of the control, or the value of a child of the control.
214: * The default behavior is to do nothing.
215: * <p>
216: * Many controls do not return a value. Examples of controls
217: * that do are: Combo returns the text string, Text returns
218: * its contents, ProgressBar returns a string representing a
219: * percentage, and Tree items return a string representing
220: * their level in the tree.
221: * </p><p>
222: * Return a string describing the value of the specified control
223: * or child in the <code>result</code> field of the event object.
224: * Returning null tells the client to use the platform value string.
225: * </p>
226: *
227: * @param e an event object containing the following fields:<ul>
228: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
229: * <li>result [OUT] - the requested value string, or null</li>
230: * </ul>
231: */
232: public void getValue(AccessibleControlEvent e) {
233: }
234:
235: /**
236: * Sent when an accessibility client requests the children of the control.
237: * The default behavior is to do nothing.
238: * <p>
239: * Return the children as an array of childIDs in the <code>children</code>
240: * field of the event object.
241: * </p>
242: *
243: * @param e an event object containing the following fields:<ul>
244: * <li>children [Typical OUT] - an array of childIDs</li>
245: * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
246: * </ul>
247: */
248: public void getChildren(AccessibleControlEvent e) {
249: }
250: }
|