2012-01-20 07:23:00 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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/. */
|
2012-01-20 07:23:00 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define NS_POWERMANAGERSERVICE_CID { 0x18c2e238, 0x3a0a, 0x4153, {0x89, 0xfc, 0x16, 0x6b, 0x3b, 0x14, 0x65, 0xa1 } }
|
|
|
|
#define POWERMANAGERSERVICE_CONTRACTID "@mozilla.org/power/powermanagerservice;1"
|
|
|
|
%}
|
|
|
|
|
2012-03-07 15:03:25 +04:00
|
|
|
interface nsIDOMMozWakeLockListener;
|
2016-01-30 20:05:36 +03:00
|
|
|
interface mozIDOMWindow;
|
2018-09-28 08:05:07 +03:00
|
|
|
interface nsIWakeLock;
|
2012-03-07 15:03:25 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* For use with non-content code.
|
|
|
|
*/
|
2016-01-30 20:05:36 +03:00
|
|
|
[scriptable, builtinclass, uuid(ba7ca4c1-9d92-4425-a83b-85dd7fa953f7)]
|
2012-01-20 07:23:00 +04:00
|
|
|
interface nsIPowerManagerService : nsISupports
|
|
|
|
{
|
2012-03-07 15:03:25 +04:00
|
|
|
void addWakeLockListener(in nsIDOMMozWakeLockListener aListener);
|
|
|
|
void removeWakeLockListener(in nsIDOMMozWakeLockListener aListener);
|
2018-09-06 11:02:43 +03:00
|
|
|
AString getWakeLockState(in AString aTopic);
|
2012-03-07 15:03:25 +04:00
|
|
|
|
|
|
|
/**
|
2014-01-07 16:16:07 +04:00
|
|
|
* Return a wake lock (MozWakeLock) object of aTopic associated with aWindow.
|
2012-03-07 15:03:25 +04:00
|
|
|
* A wake lock without associated window, e.g. used in chrome, is
|
|
|
|
* always considered invisible.
|
|
|
|
*/
|
2018-09-28 08:05:07 +03:00
|
|
|
nsIWakeLock newWakeLock(in AString aTopic, [optional] in mozIDOMWindow aWindow);
|
2012-01-20 07:23:00 +04:00
|
|
|
};
|