nsIContextMenuListener

IID:3478b6b0-3875-11d4-94ef-0020183bf181
Inherits From:nsISupports
Status:FROZEN

An optional interface for embedding clients wishing to receive notifications for context menu events (e.g. generated by a user right-mouse clicking on a link). The embedder implements this interface on the web browser chrome object associated with the window that notifications are required for. When a context menu event, the browser will call this interface if present.


Constants

PRUint32 CONTEXT_NONE = 0
PRUint32 CONTEXT_LINK = 1
PRUint32 CONTEXT_IMAGE = 2
PRUint32 CONTEXT_DOCUMENT = 4
PRUint32 CONTEXT_TEXT = 8
PRUint32 CONTEXT_INPUT = 16

Methods

void onShowContextMenu ( PRUint32 contextFlags , nsIDOMEvent event , nsIDOMNode node )

void onShowContextMenu ( PRUint32 contextFlags , nsIDOMEvent event , nsIDOMNode node )

Called when the browser receives a context menu event (e.g. user is right-mouse clicking somewhere on the document). The combination of flags, event and node provided in the call indicate where and what was clicked on.

The following table describes what context flags and node combinations are possible.

aContextFlagaNode
CONTEXT_LINK<A>
CONTEXT_IMAGE<IMG>
CONTEXT_IMAGE CONTEXT_LINK<IMG> with an <A> as an ancestor
CONTEXT_INPUT<INPUT>
CONTEXT_TEXT<TEXTAREA>
CONTEXT_DOCUMENT<HTML>

Arguments:
contextFlags: Flags indicating the kind of context.
event: The DOM context menu event.
node: The DOM node most relevant to the context.
Returns:
NS_OK always.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com