1 /*******************************************************************************
2  * Copyright (c) 2009, 2010 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  * Port to the D programming language:
11  *     alice <stigma@disroot.org>
12  *******************************************************************************/
13 module org.eclipse.swt.accessibility.AccessibleActionListener;
14 
15 import org.eclipse.swt.internal.SWTEventListener;
16 
17 import org.eclipse.swt.accessibility.AccessibleActionEvent;
18 
19 /**
20  * Classes which implement this interface provide methods
21  * that handle AccessibleAction events.
22  * <p>
23  * After creating an instance of a class that implements
24  * this interface it can be added to an accessible using the
25  * <code>addAccessibleActionListener</code> method and removed using
26  * the <code>removeAccessibleActionListener</code> method.
27  * </p>
28  *
29  * @see AccessibleActionAdapter
30  * @see AccessibleActionEvent
31  *
32  * @since 3.6
33  */
34 public interface AccessibleActionListener : SWTEventListener {
35     /**
36      * Returns the number of accessible actions available in this object.
37      * <p>
38      * If there are more than one, the first one (index 0) is considered the
39      * "default" action of the object.
40      * </p>
41      *
42      * @param e an event object containing the following fields:<ul>
43      * <li>[out] count - the number of actions, or zero if there are no actions</li>
44      * </ul>
45      */
46     public void getActionCount(AccessibleActionEvent e);
47 
48     /**
49      * Performs the specified action on the object.
50      *
51      * @param e an event object containing the following fields:<ul>
52      * <li>[in] index - a 0 based index specifying the action to perform.
53      * 		If the index lies outside the valid range no action is performed.</li>
54      * <li>[out] result - set to {@link ACC#OK} if the action was performed.</li>
55      * </ul>
56      */
57     public void doAction(AccessibleActionEvent e);
58 
59     /**
60      * Returns a description of the specified action.
61      *
62      * @param e an event object containing the following fields:<ul>
63      * <li>[in] index - a 0 based index specifying which action's description to return</li>
64      * <li>[out] result - a localized string describing the specified action,
65      * 		or null if the index lies outside the valid range</li>
66      * </ul>
67      */
68     public void getDescription(AccessibleActionEvent e);
69 
70     /**
71      * Returns a string representing one or more key bindings, if there
72      * are any, associated with the specified action.
73      * <p>
74      * The returned string is of the following form: mnemonic;accelerator
75      * for example: "C;CTRL+C" for the Copy item in a typical Edit menu.
76      * </p>
77      *
78      * @param e an event object containing the following fields:<ul>
79      * <li>[in] index - a 0 based index specifying which action's key bindings to return</li>
80      * <li>[out] result - a semicolon-delimited string of localized key bindings
81      * 		(example: "C;CTRL+C"), or null if the index lies outside the valid range</li>
82      * </ul>
83      */
84     public void getKeyBinding(AccessibleActionEvent e);
85 
86     /**
87      * Returns the name of the specified action.
88      * <p>
89      * There is no need to implement this method for single action controls
90      * since that would be redundant with AccessibleControlListener.getDefaultAction.
91      * </p>
92      *
93      * @param e an event object containing the following fields:<ul>
94      * <li>[in] index - a 0 based index specifying which action's name to return</li>
95      * <li>[in] localized - a boolean indicating whether or not to return a localized name</li>
96      * <li>[out] result - the name of the specified action,
97      * 		or null if the index lies outside the valid range</li>
98      * </ul>
99      */
100     public void getName(AccessibleActionEvent e);
101 }