widget/nsIStandaloneNativeMenu.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIStandaloneNativeMenu.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +
    1.10 +interface nsIDOMElement;
    1.11 +
    1.12 +/**
    1.13 + * Platform-independent interface to platform native menu objects.
    1.14 + */
    1.15 +
    1.16 +[scriptable, uuid(7F7201EB-510C-4CEF-BDF0-04A15A7A4A8C)]
    1.17 +interface nsIStandaloneNativeMenu : nsISupports
    1.18 +{
    1.19 +  /**
    1.20 +   * Initialize the native menu using given XUL DOM element.
    1.21 +   *
    1.22 +   * @param aDOMElement A XUL DOM element of tag type |menu| or |menupopup|.
    1.23 +   */
    1.24 +  void init(in nsIDOMElement aDOMElement);
    1.25 +
    1.26 +  /**
    1.27 +   * This method must be called before the menu is opened and displayed to the
    1.28 +   * user. It allows the platform code to update the menu and also determine
    1.29 +   * whether the menu should even be shown.
    1.30 +   *
    1.31 +   * @return true if the menu can be shown, false if it should not be shown
    1.32 +   */
    1.33 +  boolean menuWillOpen();
    1.34 +
    1.35 +  /**
    1.36 +   * The native object representing the XUL menu that was passed to Init(). On
    1.37 +   * Mac OS X, this will be a NSMenu pointer, which will be retained and
    1.38 +   * autoreleased when the attribute is retrieved.
    1.39 +   */
    1.40 +  [noscript] readonly attribute voidPtr nativeMenu;
    1.41 +
    1.42 +  /**
    1.43 +   * Activate the native menu item specified by |anIndexString|. This method
    1.44 +   * is intended to be used by the test suite.
    1.45 +   *
    1.46 +   * @param anIndexString string containing a list of indices separated by
    1.47 +   *        pipe ('|') characters
    1.48 +   */
    1.49 +  void activateNativeMenuItemAt(in AString anIndexString);
    1.50 +
    1.51 +  /**
    1.52 +   * Force an update of the native menu item specified by |anIndexString|. This
    1.53 +   * method is intended to be used by the test suite.
    1.54 +   *
    1.55 +   * @param anIndexString string containing a list of indices separated by
    1.56 +   *        pipe ('|') characters
    1.57 +   */
    1.58 +  void forceUpdateNativeMenuAt(in AString anIndexString);
    1.59 +};

mercurial