1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et ft=cpp : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 include protocol PContent;
8 include protocol PBrowser;
10 include "mozilla/GfxMessageUtils.h";
12 using mozilla::dom::ScreenOrientation from "mozilla/dom/ScreenOrientation.h";
13 using mozilla::hal::SensorType from "mozilla/HalSensor.h";
14 using mozilla::hal::SensorAccuracyType from "mozilla/HalSensor.h";
15 using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h";
16 using mozilla::hal::SwitchState from "mozilla/HalTypes.h";
17 using mozilla::hal::SwitchDevice from "mozilla/HalTypes.h";
18 using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
19 using struct nsIntRect from "nsRect.h";
20 using PRTime from "prtime.h";
21 using mozilla::hal::FMRadioCountry from "mozilla/HalTypes.h";
22 using mozilla::hal::FMRadioOperation from "mozilla/HalTypes.h";
23 using mozilla::hal::FMRadioOperationStatus from "mozilla/HalTypes.h";
28 struct BatteryInformation {
38 SensorAccuracyType accuracy;
41 struct NetworkInformation {
52 struct WakeLockInformation {
56 uint64_t[] lockingProcesses;
59 struct ScreenConfiguration {
61 ScreenOrientation orientation;
66 struct FMRadioOperationInformation {
67 FMRadioOperation operation;
68 FMRadioOperationStatus status;
72 struct FMRadioSettings {
73 FMRadioCountry country;
80 struct SystemTimezoneChangeInformation {
81 // These timezone offsets are relative to UTC in minutes and
82 // have already taken daylight saving time (DST) into account.
83 int32_t oldTimezoneOffsetMinutes;
84 int32_t newTimezoneOffsetMinutes;
89 namespace hal_sandbox {
95 NotifyBatteryChange(BatteryInformation aBatteryInfo);
96 NotifyNetworkChange(NetworkInformation aNetworkInfo);
97 NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
98 NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
99 NotifySwitchChange(SwitchEvent aEvent);
100 NotifySystemClockChange(int64_t aClockDeltaMS);
101 NotifySystemTimezoneChange(SystemTimezoneChangeInformation aSystemTimezoneChangeInfo);
104 Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
105 CancelVibrate(uint64_t[] id, PBrowser browser);
107 EnableBatteryNotifications();
108 DisableBatteryNotifications();
109 sync GetCurrentBatteryInformation()
110 returns (BatteryInformation aBatteryInfo);
112 EnableNetworkNotifications();
113 DisableNetworkNotifications();
114 sync GetCurrentNetworkInformation()
115 returns (NetworkInformation aNetworkInfo);
117 sync GetScreenEnabled() returns (bool enabled);
118 SetScreenEnabled(bool aEnabled);
120 sync GetKeyLightEnabled() returns (bool enabled);
121 SetKeyLightEnabled(bool aEnabled);
123 sync GetCpuSleepAllowed() returns (bool allowed);
124 SetCpuSleepAllowed(bool aAllowed);
126 sync GetScreenBrightness() returns (double brightness);
127 SetScreenBrightness(double aBrightness);
129 AdjustSystemClock(int64_t aDeltaMilliseconds);
130 SetTimezone(nsCString aTimezoneSpec);
132 returns (nsCString aTimezoneSpec);
133 sync GetTimezoneOffset()
134 returns (int32_t aTimezoneOffset);
135 EnableSystemClockChangeNotifications();
136 DisableSystemClockChangeNotifications();
137 EnableSystemTimezoneChangeNotifications();
138 DisableSystemTimezoneChangeNotifications();
140 ModifyWakeLock(nsString aTopic,
141 WakeLockControl aLockAdjust,
142 WakeLockControl aHiddenAdjust,
143 uint64_t aProcessID);
144 EnableWakeLockNotifications();
145 DisableWakeLockNotifications();
146 sync GetWakeLockInfo(nsString aTopic)
147 returns (WakeLockInformation aWakeLockInfo);
149 EnableScreenConfigurationNotifications();
150 DisableScreenConfigurationNotifications();
151 sync GetCurrentScreenConfiguration()
152 returns (ScreenConfiguration aScreenConfiguration);
153 sync LockScreenOrientation(ScreenOrientation aOrientation)
154 returns (bool allowed);
155 UnlockScreenOrientation();
157 EnableSwitchNotifications(SwitchDevice aDevice);
158 DisableSwitchNotifications(SwitchDevice aDevice);
159 sync GetCurrentSwitchState(SwitchDevice aDevice)
160 returns (SwitchState aState);
162 FactoryReset(nsString aReason);
165 NotifySensorChange(SensorData aSensorData);
168 EnableSensorNotifications(SensorType aSensor);
169 DisableSensorNotifications(SensorType aSensor);
175 } // namespace mozilla