michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMElement; michael@0: michael@0: /** michael@0: * Platform-independent interface to platform native menu objects. michael@0: */ michael@0: michael@0: [scriptable, uuid(7F7201EB-510C-4CEF-BDF0-04A15A7A4A8C)] michael@0: interface nsIStandaloneNativeMenu : nsISupports michael@0: { michael@0: /** michael@0: * Initialize the native menu using given XUL DOM element. michael@0: * michael@0: * @param aDOMElement A XUL DOM element of tag type |menu| or |menupopup|. michael@0: */ michael@0: void init(in nsIDOMElement aDOMElement); michael@0: michael@0: /** michael@0: * This method must be called before the menu is opened and displayed to the michael@0: * user. It allows the platform code to update the menu and also determine michael@0: * whether the menu should even be shown. michael@0: * michael@0: * @return true if the menu can be shown, false if it should not be shown michael@0: */ michael@0: boolean menuWillOpen(); michael@0: michael@0: /** michael@0: * The native object representing the XUL menu that was passed to Init(). On michael@0: * Mac OS X, this will be a NSMenu pointer, which will be retained and michael@0: * autoreleased when the attribute is retrieved. michael@0: */ michael@0: [noscript] readonly attribute voidPtr nativeMenu; michael@0: michael@0: /** michael@0: * Activate the native menu item specified by |anIndexString|. This method michael@0: * is intended to be used by the test suite. michael@0: * michael@0: * @param anIndexString string containing a list of indices separated by michael@0: * pipe ('|') characters michael@0: */ michael@0: void activateNativeMenuItemAt(in AString anIndexString); michael@0: michael@0: /** michael@0: * Force an update of the native menu item specified by |anIndexString|. This michael@0: * method is intended to be used by the test suite. michael@0: * michael@0: * @param anIndexString string containing a list of indices separated by michael@0: * pipe ('|') characters michael@0: */ michael@0: void forceUpdateNativeMenuAt(in AString anIndexString); michael@0: };