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: * For more information on this interface please see michael@0: * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html michael@0: * michael@0: * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C michael@0: * liability, trademark and document use rules apply. michael@0: */ michael@0: michael@0: interface MouseEvent : UIEvent { michael@0: readonly attribute long screenX; michael@0: readonly attribute long screenY; michael@0: readonly attribute long clientX; michael@0: readonly attribute long clientY; michael@0: readonly attribute boolean ctrlKey; michael@0: readonly attribute boolean shiftKey; michael@0: readonly attribute boolean altKey; michael@0: readonly attribute boolean metaKey; michael@0: readonly attribute short button; michael@0: readonly attribute unsigned short buttons; michael@0: readonly attribute EventTarget? relatedTarget; michael@0: // Deprecated in DOM Level 3: michael@0: [Throws] michael@0: void initMouseEvent(DOMString typeArg, michael@0: boolean canBubbleArg, michael@0: boolean cancelableArg, michael@0: WindowProxy? viewArg, michael@0: long detailArg, michael@0: long screenXArg, michael@0: long screenYArg, michael@0: long clientXArg, michael@0: long clientYArg, michael@0: boolean ctrlKeyArg, michael@0: boolean altKeyArg, michael@0: boolean shiftKeyArg, michael@0: boolean metaKeyArg, michael@0: short buttonArg, michael@0: EventTarget? relatedTargetArg); michael@0: // Introduced in DOM Level 3: michael@0: boolean getModifierState(DOMString keyArg); michael@0: }; michael@0: michael@0: michael@0: // Event Constructor Syntax: michael@0: [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)] michael@0: partial interface MouseEvent michael@0: { michael@0: }; michael@0: michael@0: // Suggested initMouseEvent replacement initializer: michael@0: dictionary MouseEventInit { michael@0: // Attributes from Event: michael@0: boolean bubbles = false; michael@0: boolean cancelable = false; michael@0: michael@0: // Attributes from UIEvent: michael@0: WindowProxy? view = null; michael@0: long detail = 0; michael@0: michael@0: // Attributes for MouseEvent: michael@0: long screenX = 0; michael@0: long screenY = 0; michael@0: long clientX = 0; michael@0: long clientY = 0; michael@0: boolean ctrlKey = false; michael@0: boolean shiftKey = false; michael@0: boolean altKey = false; michael@0: boolean metaKey = false; michael@0: short button = 0; michael@0: // Note: "buttons" was not previously initializable through initMouseEvent! michael@0: unsigned short buttons = 0; michael@0: EventTarget? relatedTarget = null; michael@0: }; michael@0: michael@0: // Mozilla extensions michael@0: partial interface MouseEvent michael@0: { michael@0: readonly attribute long mozMovementX; michael@0: readonly attribute long mozMovementY; michael@0: michael@0: // Finger or touch pressure event value michael@0: // ranges between 0.0 and 1.0 michael@0: readonly attribute float mozPressure; michael@0: michael@0: const unsigned short MOZ_SOURCE_UNKNOWN = 0; michael@0: const unsigned short MOZ_SOURCE_MOUSE = 1; michael@0: const unsigned short MOZ_SOURCE_PEN = 2; michael@0: const unsigned short MOZ_SOURCE_ERASER = 3; michael@0: const unsigned short MOZ_SOURCE_CURSOR = 4; michael@0: const unsigned short MOZ_SOURCE_TOUCH = 5; michael@0: const unsigned short MOZ_SOURCE_KEYBOARD = 6; michael@0: michael@0: readonly attribute unsigned short mozInputSource; michael@0: michael@0: [Throws] michael@0: void initNSMouseEvent(DOMString typeArg, michael@0: boolean canBubbleArg, michael@0: boolean cancelableArg, michael@0: WindowProxy? viewArg, michael@0: long detailArg, michael@0: long screenXArg, michael@0: long screenYArg, michael@0: long clientXArg, michael@0: long clientYArg, michael@0: boolean ctrlKeyArg, michael@0: boolean altKeyArg, michael@0: boolean shiftKeyArg, michael@0: boolean metaKeyArg, michael@0: short buttonArg, michael@0: EventTarget? relatedTargetArg, michael@0: float pressure, michael@0: unsigned short inputSourceArg); michael@0: michael@0: }; michael@0: