1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
6 #include
"nsISupports.idl"
9 #define POWERMANAGERSERVICE_CONTRACTID
"@mozilla.org/power/powermanagerservice;1"
12 interface nsIDOMMozWakeLockListener
;
13 interface mozIDOMWindow
;
14 interface nsIWakeLock
;
17 * For use with non-content code.
19 [scriptable
, builtinclass
, uuid(ba7ca4c1
-9d92
-4425-a83b
-85dd7fa953f7
)]
20 interface nsIPowerManagerService
: nsISupports
22 void addWakeLockListener
(in nsIDOMMozWakeLockListener aListener
);
23 void removeWakeLockListener
(in nsIDOMMozWakeLockListener aListener
);
24 AString getWakeLockState
(in AString aTopic
);
27 * Return a wake lock (MozWakeLock) object of aTopic associated with aWindow.
28 * A wake lock without associated window, e.g. used in chrome, is
29 * always considered invisible.
31 nsIWakeLock newWakeLock
(in AString aTopic
, [optional] in mozIDOMWindow aWindow
);