michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 nsIDOMEvent; michael@0: interface nsIDOMNode; michael@0: interface imgIContainer; michael@0: interface nsIURI; michael@0: interface nsIContextMenuInfo; michael@0: michael@0: /* THIS IS A PUBLIC EMBEDDING API */ michael@0: michael@0: /** michael@0: * nsIContextMenuListener2 michael@0: * michael@0: * This is an extended version of nsIContextMenuListener michael@0: * It provides a helper class, nsIContextMenuInfo, to allow access to michael@0: * background images as well as various utilities. michael@0: * michael@0: * @see nsIContextMenuListener michael@0: * @see nsIContextMenuInfo michael@0: */ michael@0: michael@0: [scriptable, uuid(7fb719b3-d804-4964-9596-77cf924ee314)] michael@0: interface nsIContextMenuListener2 : nsISupports michael@0: { michael@0: /** Flag. No context. */ michael@0: const unsigned long CONTEXT_NONE = 0; michael@0: /** Flag. Context is a link element. */ michael@0: const unsigned long CONTEXT_LINK = 1; michael@0: /** Flag. Context is an image element. */ michael@0: const unsigned long CONTEXT_IMAGE = 2; michael@0: /** Flag. Context is the whole document. */ michael@0: const unsigned long CONTEXT_DOCUMENT = 4; michael@0: /** Flag. Context is a text area element. */ michael@0: const unsigned long CONTEXT_TEXT = 8; michael@0: /** Flag. Context is an input element. */ michael@0: const unsigned long CONTEXT_INPUT = 16; michael@0: /** Flag. Context is a background image. */ michael@0: const unsigned long CONTEXT_BACKGROUND_IMAGE = 32; michael@0: michael@0: /** michael@0: * Called when the browser receives a context menu event (e.g. user is right-mouse michael@0: * clicking somewhere on the document). The combination of flags, along with the michael@0: * attributes of aUtils, indicate where and what was clicked on. michael@0: * michael@0: * The following table describes what context flags and node combinations are michael@0: * possible. michael@0: * michael@0: * aContextFlags aUtils.targetNode michael@0: * michael@0: * CONTEXT_LINK michael@0: * CONTEXT_IMAGE michael@0: * CONTEXT_IMAGE | CONTEXT_LINK with as an ancestor michael@0: * CONTEXT_INPUT michael@0: * CONTEXT_INPUT | CONTEXT_IMAGE with type=image michael@0: * CONTEXT_TEXT