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]
pub fn coerce<T: nsIMenuBuilderCoerce>(&self) -> &T
[src]
Cast this nsIMenuBuilder
to one of its base interfaces.
impl nsIMenuBuilder
[src]
pub unsafe fn OpenContainer(&self, aLabel: &nsAString) -> nsresult
[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);
pub unsafe fn AddItemFor(
&self,
aElement: *const nsIDOMElement,
aCanLoadIcon: bool
) -> nsresult
[src]
&self,
aElement: *const nsIDOMElement,
aCanLoadIcon: bool
) -> nsresult
/**
* 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);
pub unsafe fn AddSeparator(&self) -> nsresult
[src]
/**
* Create a new separator.
*/
void addSeparator ();
pub unsafe fn UndoAddSeparator(&self) -> nsresult
[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 ();
pub unsafe fn CloseContainer(&self) -> nsresult
[src]
/**
* Set the context to the parent menu.
*/
void closeContainer ();
pub unsafe fn ToJSONString(&self, _retval: &mut nsAString) -> nsresult
[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 ();
pub unsafe fn Click(&self, aGeneratedItemId: &nsAString) -> nsresult
[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>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIMenuBuilder
[src]
const IID: nsIID
IID: nsIID = nsID(2482283663, 53315, 20293, [151, 253, 151, 113, 234, 26, 249, 118])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIMenuBuilder
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.