|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 |
|
7 interface nsIDOMElement; |
|
8 |
|
9 /** |
|
10 * Platform-independent interface to platform native menu objects. |
|
11 */ |
|
12 |
|
13 [scriptable, uuid(7F7201EB-510C-4CEF-BDF0-04A15A7A4A8C)] |
|
14 interface nsIStandaloneNativeMenu : nsISupports |
|
15 { |
|
16 /** |
|
17 * Initialize the native menu using given XUL DOM element. |
|
18 * |
|
19 * @param aDOMElement A XUL DOM element of tag type |menu| or |menupopup|. |
|
20 */ |
|
21 void init(in nsIDOMElement aDOMElement); |
|
22 |
|
23 /** |
|
24 * This method must be called before the menu is opened and displayed to the |
|
25 * user. It allows the platform code to update the menu and also determine |
|
26 * whether the menu should even be shown. |
|
27 * |
|
28 * @return true if the menu can be shown, false if it should not be shown |
|
29 */ |
|
30 boolean menuWillOpen(); |
|
31 |
|
32 /** |
|
33 * The native object representing the XUL menu that was passed to Init(). On |
|
34 * Mac OS X, this will be a NSMenu pointer, which will be retained and |
|
35 * autoreleased when the attribute is retrieved. |
|
36 */ |
|
37 [noscript] readonly attribute voidPtr nativeMenu; |
|
38 |
|
39 /** |
|
40 * Activate the native menu item specified by |anIndexString|. This method |
|
41 * is intended to be used by the test suite. |
|
42 * |
|
43 * @param anIndexString string containing a list of indices separated by |
|
44 * pipe ('|') characters |
|
45 */ |
|
46 void activateNativeMenuItemAt(in AString anIndexString); |
|
47 |
|
48 /** |
|
49 * Force an update of the native menu item specified by |anIndexString|. This |
|
50 * method is intended to be used by the test suite. |
|
51 * |
|
52 * @param anIndexString string containing a list of indices separated by |
|
53 * pipe ('|') characters |
|
54 */ |
|
55 void forceUpdateNativeMenuAt(in AString anIndexString); |
|
56 }; |