widget/nsIStandaloneNativeMenu.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial