PHal.ipdl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. include protocol PContent;
  6. include protocol PBrowser;
  7. include "mozilla/GfxMessageUtils.h";
  8. using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
  9. using mozilla::hal::SensorType from "mozilla/HalSensor.h";
  10. using mozilla::hal::SensorAccuracyType from "mozilla/HalSensor.h";
  11. using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h";
  12. using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
  13. using nsIntRect from "nsRect.h";
  14. using PRTime from "prtime.h";
  15. namespace mozilla {
  16. namespace hal {
  17. struct SensorData {
  18. SensorType sensor;
  19. PRTime timestamp;
  20. float[] values;
  21. SensorAccuracyType accuracy;
  22. };
  23. struct NetworkInformation {
  24. uint32_t type;
  25. bool isWifi;
  26. uint32_t dhcpGateway;
  27. };
  28. struct WakeLockInformation {
  29. nsString topic;
  30. uint32_t numLocks;
  31. uint32_t numHidden;
  32. uint64_t[] lockingProcesses;
  33. };
  34. struct ScreenConfiguration {
  35. nsIntRect rect;
  36. ScreenOrientationInternal orientation;
  37. uint16_t angle;
  38. uint32_t colorDepth;
  39. uint32_t pixelDepth;
  40. };
  41. struct SystemTimezoneChangeInformation {
  42. // These timezone offsets are relative to UTC in minutes and
  43. // have already taken daylight saving time (DST) into account.
  44. int32_t oldTimezoneOffsetMinutes;
  45. int32_t newTimezoneOffsetMinutes;
  46. };
  47. } // namespace hal
  48. namespace hal_sandbox {
  49. nested(upto inside_cpow) sync protocol PHal {
  50. manager PContent;
  51. child:
  52. async NotifyNetworkChange(NetworkInformation aNetworkInfo);
  53. async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
  54. async NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
  55. async NotifySystemClockChange(int64_t aClockDeltaMS);
  56. async NotifySystemTimezoneChange(SystemTimezoneChangeInformation aSystemTimezoneChangeInfo);
  57. parent:
  58. async EnableNetworkNotifications();
  59. async DisableNetworkNotifications();
  60. sync GetCurrentNetworkInformation()
  61. returns (NetworkInformation aNetworkInfo);
  62. sync GetScreenEnabled() returns (bool enabled);
  63. async SetScreenEnabled(bool aEnabled);
  64. sync GetKeyLightEnabled() returns (bool enabled);
  65. async SetKeyLightEnabled(bool aEnabled);
  66. sync GetCpuSleepAllowed() returns (bool allowed);
  67. async SetCpuSleepAllowed(bool aAllowed);
  68. sync GetScreenBrightness() returns (double brightness);
  69. async SetScreenBrightness(double aBrightness);
  70. async AdjustSystemClock(int64_t aDeltaMilliseconds);
  71. async SetTimezone(nsCString aTimezoneSpec);
  72. sync GetTimezone()
  73. returns (nsCString aTimezoneSpec);
  74. sync GetTimezoneOffset()
  75. returns (int32_t aTimezoneOffset);
  76. async EnableSystemClockChangeNotifications();
  77. async DisableSystemClockChangeNotifications();
  78. async EnableSystemTimezoneChangeNotifications();
  79. async DisableSystemTimezoneChangeNotifications();
  80. async ModifyWakeLock(nsString aTopic,
  81. WakeLockControl aLockAdjust,
  82. WakeLockControl aHiddenAdjust,
  83. uint64_t aProcessID);
  84. async EnableWakeLockNotifications();
  85. async DisableWakeLockNotifications();
  86. sync GetWakeLockInfo(nsString aTopic)
  87. returns (WakeLockInformation aWakeLockInfo);
  88. async EnableScreenConfigurationNotifications();
  89. async DisableScreenConfigurationNotifications();
  90. nested(inside_cpow) sync GetCurrentScreenConfiguration()
  91. returns (ScreenConfiguration aScreenConfiguration);
  92. sync LockScreenOrientation(ScreenOrientationInternal aOrientation)
  93. returns (bool allowed);
  94. async UnlockScreenOrientation();
  95. async FactoryReset(nsString aReason);
  96. child:
  97. async NotifySensorChange(SensorData aSensorData);
  98. parent:
  99. async EnableSensorNotifications(SensorType aSensor);
  100. async DisableSensorNotifications(SensorType aSensor);
  101. async __delete__();
  102. };
  103. } // namespace hal
  104. } // namespace mozilla