Bumping manifests a=b2g-bump
[gecko.git] / hal / sandbox / PHal.ipdl
bloba52d7e6ef77932b3cefc0c422d5424233f82a042
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";
25 namespace mozilla {
27 namespace hal {
28 struct BatteryInformation {
29   double level;
30   bool   charging;
31   double remainingTime;
34 struct SensorData {
35   SensorType sensor;
36   PRTime timestamp;
37   float[] values;
38   SensorAccuracyType accuracy;
41 struct NetworkInformation {
42   uint32_t type;
43   bool   isWifi;
44   uint32_t dhcpGateway;
47 struct SwitchEvent {
48   SwitchDevice device;
49   SwitchState status;
52 struct WakeLockInformation {
53   nsString topic;
54   uint32_t numLocks;
55   uint32_t numHidden;
56   uint64_t[] lockingProcesses;
59 struct ScreenConfiguration {
60   nsIntRect rect;
61   ScreenOrientation orientation;
62   uint32_t colorDepth;
63   uint32_t pixelDepth;
66 struct FMRadioOperationInformation {
67   FMRadioOperation operation;
68   FMRadioOperationStatus status;
69   uint32_t frequency;
72 struct FMRadioSettings {
73   FMRadioCountry country;
74   uint32_t upperLimit;
75   uint32_t lowerLimit;
76   uint32_t spaceType;
77   uint32_t preEmphasis;
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;
87 } // namespace hal
89 namespace hal_sandbox {
91 sync protocol PHal {
92     manager PContent;
94 child:
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); 
103 parent:
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);
131     sync GetTimezone()
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);
164 child:
165     NotifySensorChange(SensorData aSensorData);
167 parent:
168     EnableSensorNotifications(SensorType aSensor);
169     DisableSensorNotifications(SensorType aSensor);
171     __delete__();
174 } // namespace hal
175 } // namespace mozilla