Bumping manifests a=b2g-bump
[gecko.git] / dom / webidl / MozPowerManager.webidl
blob45543bf1f0d4b2be42a2a6a0e2bdd25207b89433
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 interface MozWakeLockListener;
8 /**
9   * The reason for the factory reset.
10   * "normal" : simple factory reset.
11   * "wipe"   : will also attempt to wipe all user storage areas.
12   */
13 enum FactoryResetReason {
14     "normal",
15     "wipe"
18 /**
19  * This interface implements navigator.mozPower
20  */
21 interface MozPowerManager
23     [Throws]
24     void    powerOff();
25     [Throws]
26     void    reboot();
27     void    factoryReset(optional FactoryResetReason reason = "normal");
29     /**
30      * The listeners are notified when a resource changes its lock state to:
31      *  - unlocked
32      *  - locked but not visible
33      *  - locked and visible
34      */
35     void    addWakeLockListener(MozWakeLockListener aListener);
36     void    removeWakeLockListener(MozWakeLockListener aListener);
38     /**
39      * Query the wake lock state of the topic.
40      *
41      * Possible states are:
42      *
43      *  - "unlocked" - nobody holds the wake lock.
44      *
45      *  - "locked-foreground" - at least one window holds the wake lock,
46      *    and it is visible.
47      *
48      *  - "locked-background" - at least one window holds the wake lock,
49      *    but all of them are hidden.
50      *
51      * @param aTopic The resource name related to the wake lock.
52      */
53     [Throws]
54     DOMString getWakeLockState(DOMString aTopic);
56     /**
57      * Is the device's screen currently enabled?  This attribute controls the
58      * device's screen, so setting it to false will turn off the screen.
59      */
60     attribute boolean screenEnabled;
62     /**
63      * Is the device's keypad/button backlight enabled? Setting it to false will
64      * turn off the device's keypad/button backlight. And the brightness level
65      * is the same as |screenBrightness|.
66      */
67     attribute boolean keyLightEnabled;
69     /**
70      * How bright is the screen's backlight, on a scale from 0 (very dim) to 1
71      * (full brightness)?  Setting this attribute modifies the screen's
72      * brightness.
73      *
74      * You can read and write this attribute even when the screen is disabled,
75      * but the backlight is off while the screen is disabled.
76      *
77      * If you write a value of X into this attribute, the attribute may not have
78      * the same value X when you later read it.  Most screens don't support as
79      * many different brightness levels as there are doubles between 0 and 1, so
80      * we may reduce the value's precision before storing it.
81      *
82      * @throw NS_ERROR_INVALID_ARG if brightness is not in the range [0, 1].
83      */
84     [SetterThrows]
85     attribute double screenBrightness;
87     /**
88      * Is it possible that the device's CPU will sleep after the screen is
89      * disabled?  Setting this attribute to false will prevent the device
90      * entering suspend state.
91      */
92     attribute boolean cpuSleepAllowed;