Struct xpcom::interfaces::nsIMenuBuilder [] [src]

#[repr(C)]
pub struct nsIMenuBuilder { /* fields omitted */ }

interface nsIMenuBuilder : nsISupports

/**
 * An interface used to construct native toolbar or context menus from <menu>
 */

Methods

impl nsIMenuBuilder
[src]

[src]

Cast this nsIMenuBuilder to one of its base interfaces.

impl nsIMenuBuilder
[src]

[src]

/**
   * Create the top level menu or a submenu. The implementation should create
   * a new context for this menu, so all subsequent methods will add new items
   * to this newly created menu.
   */

void openContainer (in DOMString aLabel);

[src]

/**
   * Add a new menu item. All menu item details can be obtained from
   * the element. This method is not called for hidden elements or elements
   * with no or empty label. The icon should be loaded only if aCanLoadIcon
   * is true.
   */

void addItemFor (in nsIDOMElement aElement, in boolean aCanLoadIcon);

[src]

/**
   * Create a new separator.
   */

void addSeparator ();

[src]

/**
   * Remove last added separator.
   * Sometimes it's needed to remove last added separator, otherwise it's not
   * possible to implement the postprocessing in one pass.
   * See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#building-menus-and-toolbars
   */

void undoAddSeparator ();

[src]

/**
   * Set the context to the parent menu.
   */

void closeContainer ();

[src]

/**
   * Returns a JSON string representing the menu hierarchy. For a context menu,
   * it will be of the form:
   *  {
   *    type: "menu",
   *    children: [
   *      {
   *        type: "menuitem",
   *        label: "label",
   *        icon: "image.png"
   *      },
   *      {
   *        type: "separator",
   *      },
   *    ];
   */

AString toJSONString ();

[src]

/**
   * Invoke the action of the menuitem with assigned id aGeneratedItemId.
   *
   * @param aGeneratedItemId the menuitem id
   */

void click (in DOMString aGeneratedItemId);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIMenuBuilder
[src]

IID: nsIID = nsID(2482283663, 53315, 20293, [151, 253, 151, 113, 234, 26, 249, 118])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIMenuBuilder
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIMenuBuilder
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.