xpcom/system/nsIDeviceSensors.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsISupports.idl"
     7 interface nsIDOMWindow;
     9 [scriptable, uuid(1B406E32-CF42-471E-A470-6FD600BF4C7B)]
    10 interface nsIDeviceSensorData : nsISupports
    11 {
    12   // Keep in sync with hal/HalSensor.h
    13   const unsigned long TYPE_ORIENTATION = 0;
    14   const unsigned long TYPE_ACCELERATION = 1;
    15   const unsigned long TYPE_PROXIMITY = 2;
    16   const unsigned long TYPE_LINEAR_ACCELERATION = 3;
    17   const unsigned long TYPE_GYROSCOPE = 4;
    18   const unsigned long TYPE_LIGHT = 5;
    20   readonly attribute unsigned long type;
    22   readonly attribute double x;
    23   readonly attribute double y;
    24   readonly attribute double z;
    25 };
    27 [scriptable, uuid(e46e47c7-55ff-44c4-abce-21b14ba07f86)]
    28 interface nsIDeviceSensors : nsISupports
    29 {
    30   /**
    31    * Returns true if the given window has any listeners of the given type
    32    */
    33   bool hasWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
    35   // Holds pointers, not AddRef objects -- it is up to the caller
    36   // to call RemoveWindowListener before the window is deleted.
    38   [noscript] void addWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
    39   [noscript] void removeWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
    40   [noscript] void removeWindowAsListener(in nsIDOMWindow aWindow);
    41 };
    43 %{C++
    45 #define NS_DEVICE_SENSORS_CID \
    46 { 0xecba5203, 0x77da, 0x465a, \
    47 { 0x86, 0x5e, 0x78, 0xb7, 0xaf, 0x10, 0xd8, 0xf7 } }
    49 #define NS_DEVICE_SENSORS_CONTRACTID "@mozilla.org/devicesensors;1"
    51 %}

mercurial