2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-08-21 07:42:37 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIDOMWindow;
|
|
|
|
|
2011-06-19 22:36:17 -07:00
|
|
|
[scriptable, uuid(1B406E32-CF42-471E-A470-6FD600BF4C7B)]
|
2012-03-24 17:29:57 -07:00
|
|
|
interface nsIDeviceSensorData : nsISupports
|
2009-08-21 07:42:37 -07:00
|
|
|
{
|
2012-03-20 23:36:17 -07:00
|
|
|
// Keep in sync with hal/HalSensor.h
|
|
|
|
const unsigned long TYPE_ORIENTATION = 0;
|
|
|
|
const unsigned long TYPE_ACCELERATION = 1;
|
|
|
|
const unsigned long TYPE_PROXIMITY = 2;
|
|
|
|
const unsigned long TYPE_LINEAR_ACCELERATION = 3;
|
|
|
|
const unsigned long TYPE_GYROSCOPE = 4;
|
2012-05-02 09:43:45 -07:00
|
|
|
const unsigned long TYPE_LIGHT = 5;
|
2011-06-19 22:36:17 -07:00
|
|
|
|
|
|
|
readonly attribute unsigned long type;
|
|
|
|
|
|
|
|
readonly attribute double x;
|
|
|
|
readonly attribute double y;
|
|
|
|
readonly attribute double z;
|
2009-08-21 07:42:37 -07:00
|
|
|
};
|
|
|
|
|
2012-10-20 21:40:56 -07:00
|
|
|
[scriptable, uuid(e46e47c7-55ff-44c4-abce-21b14ba07f86)]
|
2012-03-24 17:29:57 -07:00
|
|
|
interface nsIDeviceSensors : nsISupports
|
2009-08-21 07:42:37 -07:00
|
|
|
{
|
2012-10-20 21:40:56 -07:00
|
|
|
/**
|
|
|
|
* Returns true if the given window has any listeners of the given type
|
|
|
|
*/
|
|
|
|
bool hasWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
|
2012-06-10 16:44:50 -07:00
|
|
|
|
2011-07-06 22:56:32 -07:00
|
|
|
// Holds pointers, not AddRef objects -- it is up to the caller
|
|
|
|
// to call RemoveWindowListener before the window is deleted.
|
2012-06-10 16:44:50 -07:00
|
|
|
|
2012-03-24 17:29:49 -07:00
|
|
|
[noscript] void addWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
|
|
|
|
[noscript] void removeWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);
|
|
|
|
[noscript] void removeWindowAsListener(in nsIDOMWindow aWindow);
|
2009-08-21 07:42:37 -07:00
|
|
|
};
|