michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ 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 file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIDOMMouseEvent.idl" michael@0: michael@0: [scriptable, builtinclass, uuid(86e2b577-7e61-4ed5-8ddd-c1533bf07137)] michael@0: interface nsIDOMWheelEvent : nsIDOMMouseEvent michael@0: { michael@0: const unsigned long DOM_DELTA_PIXEL = 0x00; michael@0: const unsigned long DOM_DELTA_LINE = 0x01; michael@0: const unsigned long DOM_DELTA_PAGE = 0x02; michael@0: michael@0: // Note that DOM Level 3 Events defines the type of delta values as float. michael@0: // However, we should use double for them. Javascript engine always uses michael@0: // double even if interface attributes are float. If we defined them michael@0: // as float, that would cause error at casting from float to double. michael@0: // E.g., following function may return false if the deltaX is float: michael@0: // michael@0: // function () { michael@0: // var event = new WheelEvent("wheel", { deltaX: 0.1 }); michael@0: // return (event.deltaX == 0.1); michael@0: // } michael@0: michael@0: readonly attribute double deltaX; michael@0: readonly attribute double deltaY; michael@0: readonly attribute double deltaZ; michael@0: readonly attribute unsigned long deltaMode; michael@0: michael@0: [noscript] void initWheelEvent(in DOMString typeArg, michael@0: in boolean canBubbleArg, michael@0: in boolean cancelableArg, michael@0: in nsIDOMWindow viewArg, michael@0: in long detailArg, michael@0: in long screenXArg, michael@0: in long screenYArg, michael@0: in long clientXArg, michael@0: in long clientYArg, michael@0: in unsigned short buttonArg, michael@0: in nsIDOMEventTarget relatedTargetArg, michael@0: in DOMString modifiersListArg, michael@0: in double deltaXArg, michael@0: in double deltaYArg, michael@0: in double deltaZArg, michael@0: in unsigned long deltaMode); michael@0: };