michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: %{C++ michael@0: #define NS_POWERMANAGERSERVICE_CID { 0x18c2e238, 0x3a0a, 0x4153, {0x89, 0xfc, 0x16, 0x6b, 0x3b, 0x14, 0x65, 0xa1 } } michael@0: #define POWERMANAGERSERVICE_CONTRACTID "@mozilla.org/power/powermanagerservice;1" michael@0: %} michael@0: michael@0: interface nsIDOMMozWakeLockListener; michael@0: interface nsIDOMWindow; michael@0: michael@0: /** michael@0: * For use with non-content code. michael@0: */ michael@0: [scriptable, builtinclass, uuid(a232e826-07bd-11e2-8a8f-236186ff1a14)] michael@0: interface nsIPowerManagerService : nsISupports michael@0: { michael@0: /** michael@0: * This API will power off the machine. michael@0: */ michael@0: void powerOff(); michael@0: michael@0: /** michael@0: * This API will completely shut down and boot the machine. michael@0: */ michael@0: void reboot(); michael@0: michael@0: /** michael@0: * This API will restart the Gecko processes without powering off the machine. michael@0: */ michael@0: void restart(); michael@0: michael@0: void addWakeLockListener(in nsIDOMMozWakeLockListener aListener); michael@0: void removeWakeLockListener(in nsIDOMMozWakeLockListener aListener); michael@0: DOMString getWakeLockState(in DOMString aTopic); michael@0: michael@0: /** michael@0: * Return a wake lock (MozWakeLock) object of aTopic associated with aWindow. michael@0: * A wake lock without associated window, e.g. used in chrome, is michael@0: * always considered invisible. michael@0: */ michael@0: nsISupports newWakeLock(in DOMString aTopic, [optional] in nsIDOMWindow aWindow); michael@0: };