1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 IBM Corporation and others.
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/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.accessibility;
16 import org.eclipse.swt.internal.SWTEventListener;
19 * Classes which implement this interface provide methods
20 * that handle AccessibleAction events.
22 * After creating an instance of a class that implements
23 * this interface it can be added to an accessible using the
24 * <code>addAccessibleActionListener</code> method and removed using
25 * the <code>removeAccessibleActionListener</code> method.
28 * @see AccessibleActionAdapter
29 * @see AccessibleActionEvent
33 public interface AccessibleActionListener extends SWTEventListener {
35 * Returns the number of accessible actions available in this object.
37 * If there are more than one, the first one (index 0) is considered the
38 * "default" action of the object.
41 * @param e an event object containing the following fields:<ul>
42 * <li>[out] count - the number of actions, or zero if there are no actions</li>
45 public void getActionCount(AccessibleActionEvent e);
48 * Performs the specified action on the object.
50 * @param e an event object containing the following fields:<ul>
51 * <li>[in] index - a 0 based index specifying the action to perform.
52 * If the index lies outside the valid range no action is performed.</li>
53 * <li>[out] result - set to {@link ACC#OK} if the action was performed.</li>
56 public void doAction(AccessibleActionEvent e);
59 * Returns a description of the specified action.
61 * @param e an event object containing the following fields:<ul>
62 * <li>[in] index - a 0 based index specifying which action's description to return</li>
63 * <li>[out] result - a localized string describing the specified action,
64 * or null if the index lies outside the valid range</li>
67 public void getDescription(AccessibleActionEvent e);
70 * Returns a string representing one or more key bindings, if there
71 * are any, associated with the specified action.
73 * The returned string is of the following form: mnemonic;accelerator
74 * for example: "C;CTRL+C" for the Copy item in a typical Edit menu.
77 * @param e an event object containing the following fields:<ul>
78 * <li>[in] index - a 0 based index specifying which action's key bindings to return</li>
79 * <li>[out] result - a semicolon-delimited string of localized key bindings
80 * (example: "C;CTRL+C"), or null if the index lies outside the valid range</li>
83 public void getKeyBinding(AccessibleActionEvent e);
86 * Returns the name of the specified action.
88 * There is no need to implement this method for single action controls
89 * since that would be redundant with AccessibleControlListener.getDefaultAction.
92 * @param e an event object containing the following fields:<ul>
93 * <li>[in] index - a 0 based index specifying which action's name to return</li>
94 * <li>[in] localized - a boolean indicating whether or not to return a localized name</li>
95 * <li>[out] result - the name of the specified action,
96 * or null if the index lies outside the valid range</li>
99 public void getName(AccessibleActionEvent e);