2011-10-06 02:15:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2011-10-21 01:38:39 +04:00
|
|
|
/* vim: set sw=2 ts=8 et ft=cpp : */
|
2012-05-21 15:12:37 +04: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/. */
|
2011-10-06 02:15:45 +04:00
|
|
|
|
|
|
|
include protocol PContent;
|
2011-09-30 11:00:48 +04:00
|
|
|
include protocol PBrowser;
|
2012-02-05 23:51:06 +04:00
|
|
|
|
2014-05-01 05:52:00 +04:00
|
|
|
include "mozilla/GfxMessageUtils.h";
|
|
|
|
|
2015-08-19 00:55:09 +03:00
|
|
|
using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
|
2013-10-01 23:25:07 +04:00
|
|
|
using mozilla::hal::SensorType from "mozilla/HalSensor.h";
|
|
|
|
using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h";
|
|
|
|
using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
|
2015-04-21 18:04:57 +03:00
|
|
|
using nsIntRect from "nsRect.h";
|
2013-10-01 23:25:07 +04:00
|
|
|
using PRTime from "prtime.h";
|
2011-10-06 02:15:45 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2011-11-02 19:14:01 +04:00
|
|
|
|
|
|
|
namespace hal {
|
2012-05-09 01:36:07 +04:00
|
|
|
struct BatteryInformation {
|
|
|
|
double level;
|
|
|
|
bool charging;
|
|
|
|
double remainingTime;
|
|
|
|
};
|
2012-01-16 17:39:57 +04:00
|
|
|
|
2012-05-09 01:36:07 +04:00
|
|
|
struct SensorData {
|
|
|
|
SensorType sensor;
|
|
|
|
PRTime timestamp;
|
|
|
|
float[] values;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NetworkInformation {
|
2014-03-05 07:54:55 +04:00
|
|
|
uint32_t type;
|
2013-07-11 19:39:36 +04:00
|
|
|
bool isWifi;
|
|
|
|
uint32_t dhcpGateway;
|
2012-05-09 01:36:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct WakeLockInformation {
|
2013-05-10 19:20:52 +04:00
|
|
|
nsString topic;
|
2012-05-09 01:36:07 +04:00
|
|
|
uint32_t numLocks;
|
|
|
|
uint32_t numHidden;
|
2013-02-15 00:41:30 +04:00
|
|
|
uint64_t[] lockingProcesses;
|
2012-05-09 01:36:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ScreenConfiguration {
|
|
|
|
nsIntRect rect;
|
2015-08-19 00:55:09 +03:00
|
|
|
ScreenOrientationInternal orientation;
|
2015-08-19 00:55:15 +03:00
|
|
|
uint16_t angle;
|
2012-05-09 01:36:07 +04:00
|
|
|
uint32_t colorDepth;
|
|
|
|
uint32_t pixelDepth;
|
|
|
|
};
|
2012-08-05 09:09:39 +04:00
|
|
|
|
|
|
|
} // namespace hal
|
2012-03-07 15:03:25 +04:00
|
|
|
|
2011-10-06 02:15:45 +04:00
|
|
|
namespace hal_sandbox {
|
|
|
|
|
2016-10-01 02:20:50 +03:00
|
|
|
nested(upto inside_cpow) sync protocol PHal {
|
2011-10-06 02:15:45 +04:00
|
|
|
manager PContent;
|
|
|
|
|
2011-11-02 19:14:01 +04:00
|
|
|
child:
|
2016-01-27 00:51:53 +03:00
|
|
|
async NotifyBatteryChange(BatteryInformation aBatteryInfo);
|
|
|
|
async NotifyNetworkChange(NetworkInformation aNetworkInfo);
|
|
|
|
async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
|
|
|
|
async NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
|
2011-11-02 19:14:01 +04:00
|
|
|
|
2011-10-06 02:15:45 +04:00
|
|
|
parent:
|
2016-01-27 00:51:53 +03:00
|
|
|
async Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
|
|
|
|
async CancelVibrate(uint64_t[] id, PBrowser browser);
|
2011-10-06 02:15:45 +04:00
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async EnableBatteryNotifications();
|
|
|
|
async DisableBatteryNotifications();
|
2011-11-02 19:14:01 +04:00
|
|
|
sync GetCurrentBatteryInformation()
|
|
|
|
returns (BatteryInformation aBatteryInfo);
|
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async EnableNetworkNotifications();
|
|
|
|
async DisableNetworkNotifications();
|
2012-01-16 17:39:57 +04:00
|
|
|
sync GetCurrentNetworkInformation()
|
|
|
|
returns (NetworkInformation aNetworkInfo);
|
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async ModifyWakeLock(nsString aTopic,
|
|
|
|
WakeLockControl aLockAdjust,
|
|
|
|
WakeLockControl aHiddenAdjust,
|
|
|
|
uint64_t aProcessID);
|
|
|
|
async EnableWakeLockNotifications();
|
|
|
|
async DisableWakeLockNotifications();
|
2012-03-07 15:03:25 +04:00
|
|
|
sync GetWakeLockInfo(nsString aTopic)
|
|
|
|
returns (WakeLockInformation aWakeLockInfo);
|
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async EnableScreenConfigurationNotifications();
|
|
|
|
async DisableScreenConfigurationNotifications();
|
2015-08-19 00:55:09 +03:00
|
|
|
sync LockScreenOrientation(ScreenOrientationInternal aOrientation)
|
2012-03-29 23:43:16 +04:00
|
|
|
returns (bool allowed);
|
2016-01-27 00:51:53 +03:00
|
|
|
async UnlockScreenOrientation();
|
2012-03-13 20:42:46 +04:00
|
|
|
|
2012-02-05 23:51:06 +04:00
|
|
|
child:
|
2016-01-27 00:51:53 +03:00
|
|
|
async NotifySensorChange(SensorData aSensorData);
|
2012-02-05 23:51:06 +04:00
|
|
|
|
2012-09-19 19:17:13 +04:00
|
|
|
parent:
|
2016-01-27 00:51:53 +03:00
|
|
|
async EnableSensorNotifications(SensorType aSensor);
|
|
|
|
async DisableSensorNotifications(SensorType aSensor);
|
2012-02-05 23:51:06 +04:00
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async __delete__();
|
2011-10-06 02:15:45 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace hal
|
|
|
|
} // namespace mozilla
|