1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/power/nsIPowerManagerService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +%{C++ 1.12 +#define NS_POWERMANAGERSERVICE_CID { 0x18c2e238, 0x3a0a, 0x4153, {0x89, 0xfc, 0x16, 0x6b, 0x3b, 0x14, 0x65, 0xa1 } } 1.13 +#define POWERMANAGERSERVICE_CONTRACTID "@mozilla.org/power/powermanagerservice;1" 1.14 +%} 1.15 + 1.16 +interface nsIDOMMozWakeLockListener; 1.17 +interface nsIDOMWindow; 1.18 + 1.19 +/** 1.20 + * For use with non-content code. 1.21 + */ 1.22 +[scriptable, builtinclass, uuid(a232e826-07bd-11e2-8a8f-236186ff1a14)] 1.23 +interface nsIPowerManagerService : nsISupports 1.24 +{ 1.25 + /** 1.26 + * This API will power off the machine. 1.27 + */ 1.28 + void powerOff(); 1.29 + 1.30 + /** 1.31 + * This API will completely shut down and boot the machine. 1.32 + */ 1.33 + void reboot(); 1.34 + 1.35 + /** 1.36 + * This API will restart the Gecko processes without powering off the machine. 1.37 + */ 1.38 + void restart(); 1.39 + 1.40 + void addWakeLockListener(in nsIDOMMozWakeLockListener aListener); 1.41 + void removeWakeLockListener(in nsIDOMMozWakeLockListener aListener); 1.42 + DOMString getWakeLockState(in DOMString aTopic); 1.43 + 1.44 + /** 1.45 + * Return a wake lock (MozWakeLock) object of aTopic associated with aWindow. 1.46 + * A wake lock without associated window, e.g. used in chrome, is 1.47 + * always considered invisible. 1.48 + */ 1.49 + nsISupports newWakeLock(in DOMString aTopic, [optional] in nsIDOMWindow aWindow); 1.50 +};