001: /*******************************************************************************
002: * Copyright (c) 2000, 2003 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: import org.eclipse.swt.internal.SWTEventListener;
013:
014: /**
015: * Classes that implement this interface provide methods
016: * that deal with the events that are generated when an
017: * accessibility client sends a message to a control.
018: * <p>
019: * After creating an instance of a class that implements
020: * this interface it can be added to a control using the
021: * <code>addAccessibleListener</code> method and removed
022: * using the <code>removeAccessibleListener</code> method.
023: * When a client requests information, the appropriate method
024: * will be invoked.
025: * </p><p>
026: * Note: Accessibility clients use child identifiers to specify
027: * whether they want information about a control or one of its children.
028: * Child identifiers are increasing integers beginning with 0.
029: * The identifier CHILDID_SELF represents the control itself.
030: * </p>
031: *
032: * @see AccessibleAdapter
033: * @see AccessibleEvent
034: *
035: * @since 2.0
036: */
037: public interface AccessibleListener extends SWTEventListener {
038:
039: /**
040: * Sent when an accessibility client requests the name
041: * of the control, or the name of a child of the control.
042: * <p>
043: * Return the name of the control or specified child in the
044: * <code>result</code> field of the event object. Returning
045: * an empty string tells the client that the control or child
046: * does not have a name, and returning null tells the client
047: * to use the platform name.
048: * </p>
049: *
050: * @param e an event object containing the following fields:<ul>
051: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
052: * <li>result [OUT] - the requested name string, or null</li>
053: * </ul>
054: */
055: public void getName(AccessibleEvent e);
056:
057: /**
058: * Sent when an accessibility client requests the help string
059: * of the control, or the help string of a child of the control.
060: * <p>
061: * The information in this property should be similar to the help
062: * provided by toolTipText. It describes what the control or child
063: * does or how to use it, as opposed to getDescription, which
064: * describes appearance.
065: * </p><p>
066: * Return the help string of the control or specified child in
067: * the <code>result</code> field of the event object. Returning
068: * an empty string tells the client that the control or child
069: * does not have a help string, and returning null tells the
070: * client to use the platform help string.
071: * </p>
072: *
073: * @param e an event object containing the following fields:<ul>
074: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
075: * <li>result [OUT] - the requested help string, or null</li>
076: * </ul>
077: */
078: public void getHelp(AccessibleEvent e);
079:
080: /**
081: * Sent when an accessibility client requests the keyboard shortcut
082: * of the control, or the keyboard shortcut of a child of the control.
083: * <p>
084: * A keyboard shortcut can either be a mnemonic, or an accelerator.
085: * As a general rule, if the control or child can receive keyboard focus,
086: * then you should expose its mnemonic, and if it cannot receive keyboard
087: * focus, then you should expose its accelerator.
088: * </p><p>
089: * Return the keyboard shortcut string of the control or specified child
090: * in the <code>result</code> field of the event object. Returning an
091: * empty string tells the client that the control or child does not
092: * have a keyboard shortcut string, and returning null tells the client
093: * to use the platform keyboard shortcut string.
094: * </p>
095: *
096: * @param e an event object containing the following fields:<ul>
097: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
098: * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
099: * </ul>
100: */
101: public void getKeyboardShortcut(AccessibleEvent e);
102:
103: /**
104: * Sent when an accessibility client requests a description
105: * of the control, or a description of a child of the control.
106: * <p>
107: * This is a textual description of the control or child's visual
108: * appearance, which is typically only necessary if it cannot be
109: * determined from other properties such as role.
110: * </p><p>
111: * Return the description of the control or specified child in
112: * the <code>result</code> field of the event object. Returning
113: * an empty string tells the client that the control or child
114: * does not have a description, and returning null tells the
115: * client to use the platform description.
116: * </p>
117: *
118: * @param e an event object containing the following fields:<ul>
119: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
120: * <li>result [OUT] - the requested description string, or null</li>
121: * </ul>
122: */
123: public void getDescription(AccessibleEvent e);
124: }
|