hal/sandbox/PHal.ipdl
author L10n Bumper Bot <release+l10nbumper@mozilla.com>
Wed, 25 Oct 2017 06:20:45 -0700
changeset 432737 ba0d92142134e1549fb502f7407a88b3512eca6e
parent 421907 df3915693fa3bec56bacc17a4f2588f99ab635b4
child 463222 6e032627821402c26a1cacf6043ba48c260b409c
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets DONTBUILD r=release a=l10n-bump ast -> 7eb260478bd8 eo -> ea3dad63bb09 ff -> fe409f986d12 fi -> 07009f0e67b8 fy-NL -> 8334c2341110 gd -> 159cfc811bd1 gu-IN -> dacc7dcb7f4d it -> 94fe6cff2122 ko -> c295a8dd5e98 ms -> a430c95db0ce sl -> 6ea5be344dbb

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp : */
/* 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 protocol PContent;
include protocol PBrowser;

include "mozilla/GfxMessageUtils.h";

using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
using mozilla::hal::SensorType from "mozilla/HalSensor.h";
using mozilla::hal::SensorAccuracyType from "mozilla/HalSensor.h";
using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h";
using mozilla::hal::SwitchState from "mozilla/HalTypes.h";
using mozilla::hal::SwitchDevice from "mozilla/HalTypes.h";
using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
using nsIntRect from "nsRect.h";
using PRTime from "prtime.h";

namespace mozilla {

namespace hal {
struct BatteryInformation {
  double level;
  bool   charging;
  double remainingTime;
};

struct SensorData {
  SensorType sensor;
  PRTime timestamp;
  float[] values;
  SensorAccuracyType accuracy;
};

struct NetworkInformation {
  uint32_t type;
  bool   isWifi;
  uint32_t dhcpGateway;
};

struct SwitchEvent {
  SwitchDevice device;
  SwitchState status;
};

struct WakeLockInformation {
  nsString topic;
  uint32_t numLocks;
  uint32_t numHidden;
  uint64_t[] lockingProcesses;
};

struct ScreenConfiguration {
  nsIntRect rect;
  ScreenOrientationInternal orientation;
  uint16_t angle;
  uint32_t colorDepth;
  uint32_t pixelDepth;
};

struct SystemTimezoneChangeInformation {
  // These timezone offsets are relative to UTC in minutes and
  // have already taken daylight saving time (DST) into account.
  int32_t oldTimezoneOffsetMinutes;
  int32_t newTimezoneOffsetMinutes;
};

} // namespace hal

namespace hal_sandbox {

nested(upto inside_cpow) sync protocol PHal {
    manager PContent;

child:
    async NotifyBatteryChange(BatteryInformation aBatteryInfo);
    async NotifyNetworkChange(NetworkInformation aNetworkInfo);
    async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
    async NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
    async NotifySwitchChange(SwitchEvent aEvent);
    async NotifySystemClockChange(int64_t aClockDeltaMS); 
    async NotifySystemTimezoneChange(SystemTimezoneChangeInformation aSystemTimezoneChangeInfo); 

parent:
    async Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
    async CancelVibrate(uint64_t[] id, PBrowser browser);

    async EnableBatteryNotifications();
    async DisableBatteryNotifications();
    sync GetCurrentBatteryInformation()
      returns (BatteryInformation aBatteryInfo);

    async EnableNetworkNotifications();
    async DisableNetworkNotifications();
    sync GetCurrentNetworkInformation()
      returns (NetworkInformation aNetworkInfo);

    async AdjustSystemClock(int64_t aDeltaMilliseconds);
    async EnableSystemClockChangeNotifications();
    async DisableSystemClockChangeNotifications();
    async EnableSystemTimezoneChangeNotifications();
    async DisableSystemTimezoneChangeNotifications();

    async ModifyWakeLock(nsString aTopic,
                         WakeLockControl aLockAdjust,
                         WakeLockControl aHiddenAdjust,
                         uint64_t aProcessID);
    async EnableWakeLockNotifications();
    async DisableWakeLockNotifications();
    sync GetWakeLockInfo(nsString aTopic)
      returns (WakeLockInformation aWakeLockInfo);

    async EnableScreenConfigurationNotifications();
    async DisableScreenConfigurationNotifications();
    sync LockScreenOrientation(ScreenOrientationInternal aOrientation)
      returns (bool allowed);
    async UnlockScreenOrientation();
 
    async EnableSwitchNotifications(SwitchDevice aDevice);
    async DisableSwitchNotifications(SwitchDevice aDevice);

child:
    async NotifySensorChange(SensorData aSensorData);

parent:
    async EnableSensorNotifications(SensorType aSensor);
    async DisableSensorNotifications(SensorType aSensor);

    async __delete__();
};

} // namespace hal
} // namespace mozilla