xpcom/system/nsIDeviceSensors.idl
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Thu, 03 Jul 2014 12:45:48 -0700
changeset 228688 bf28e868def9317c9b5e4833a9312ad3778603e1
parent 153624 aab2a2b73b900689ad2b16dcd7f3ba694c4fcf2e
permissions -rw-r--r--
Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-2_0/rev/8536587e8be9 Author: Ryan VanderMeulen <rvandermeulen@mozilla.com> Desc: Merge pull request #21354 from justindarc/bug1031012-v2.0 Bug 1031012 - [B2G][Camera]Self-timer cannot be canceled ======== https://hg.mozilla.org/integration/gaia-2_0/rev/5cd63a65a51e Author: Justin D'Arcangelo <justindarc@gmail.com> Desc: Bug 1031012 - [B2G][Camera]Self-timer cannot be canceled

/* 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/. */

#include "nsISupports.idl"

interface nsIDOMWindow;

[scriptable, uuid(1B406E32-CF42-471E-A470-6FD600BF4C7B)]
interface nsIDeviceSensorData : nsISupports
{
  // 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;
  const unsigned long TYPE_LIGHT = 5;

  readonly attribute unsigned long type;

  readonly attribute double x;
  readonly attribute double y;
  readonly attribute double z;
};

[scriptable, uuid(e46e47c7-55ff-44c4-abce-21b14ba07f86)]
interface nsIDeviceSensors : nsISupports
{
  /**
   * Returns true if the given window has any listeners of the given type
   */
  bool hasWindowListener(in unsigned long aType, in nsIDOMWindow aWindow);

  // Holds pointers, not AddRef objects -- it is up to the caller
  // to call RemoveWindowListener before the window is deleted.

  [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);
};

%{C++

#define NS_DEVICE_SENSORS_CID \
{ 0xecba5203, 0x77da, 0x465a, \
{ 0x86, 0x5e, 0x78, 0xb7, 0xaf, 0x10, 0xd8, 0xf7 } }

#define NS_DEVICE_SENSORS_CONTRACTID "@mozilla.org/devicesensors;1"

%}