TouchEvent.idl   [plain text]


/*
 * Copyright (C) 2008, Apple Inc. All rights reserved.
 *
 * No license or rights are granted by Apple expressly or by implication,
 * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade
 * secrets or other rights.
 */

[
    AppleCopyright,
    Conditional=TOUCH_EVENTS
] interface TouchEvent : UIEvent {

    void initTouchEvent([Default=Undefined] optional DOMString type,
                        [Default=Undefined] optional boolean canBubble,
                        [Default=Undefined] optional boolean cancelable,
                        [Default=Undefined] optional DOMWindow view,
                        [Default=Undefined] optional long detail,
                        [Default=Undefined] optional long screenX,
                        [Default=Undefined] optional long screenY,
                        [Default=Undefined] optional long clientX,
                        [Default=Undefined] optional long clientY,
                        [Default=Undefined] optional boolean ctrlKey,
                        [Default=Undefined] optional boolean altKey,
                        [Default=Undefined] optional boolean shiftKey,
                        [Default=Undefined] optional boolean metaKey,
                        [Default=Undefined] optional TouchList touches,
                        [Default=Undefined] optional TouchList targetTouches,
                        [Default=Undefined] optional TouchList changedTouches,
                        [Default=Undefined] optional float scale,
                        [Default=Undefined] optional float rotation);

    readonly attribute TouchList touches;           // all touches
    readonly attribute TouchList targetTouches;     // all touches in this TouchEvent Target
    readonly attribute TouchList changedTouches;    // all touches changed in the current event

    readonly attribute float scale;      // distance (since event start) between fingers as multiplier of initial value. Initially 1.0, zoom out (pinch) < 1.0, zoom in > 1.0.
    readonly attribute float rotation;   // rotation delta (since event start) in degrees (clockwise is positive). Initially 0.0.

    readonly attribute boolean ctrlKey;
    readonly attribute boolean shiftKey;
    readonly attribute boolean altKey;
    readonly attribute boolean metaKey;
};