2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-14 03:10:48 -07:00
|
|
|
#include "nsIDOMEventTarget.idl"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-09-11 03:55:08 -07:00
|
|
|
[scriptable, builtinclass, uuid(01e8587b-35a9-4a59-8349-c7ee93846fb2)]
|
2012-03-14 03:10:48 -07:00
|
|
|
interface nsIDOMScreen : nsIDOMEventTarget
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
readonly attribute long top;
|
|
|
|
readonly attribute long left;
|
|
|
|
readonly attribute long width;
|
|
|
|
readonly attribute long height;
|
|
|
|
readonly attribute long pixelDepth;
|
|
|
|
readonly attribute long colorDepth;
|
|
|
|
readonly attribute long availWidth;
|
|
|
|
readonly attribute long availHeight;
|
|
|
|
readonly attribute long availLeft;
|
|
|
|
readonly attribute long availTop;
|
2011-12-04 09:07:00 -08:00
|
|
|
|
2012-03-14 03:10:48 -07:00
|
|
|
/**
|
|
|
|
* Returns the current screen orientation.
|
|
|
|
* Can be: landscape-primary, landscape-secondary,
|
|
|
|
* portrait-primary or portrait-secondary.
|
|
|
|
*/
|
2012-10-14 00:40:11 -07:00
|
|
|
[binaryname(SlowMozOrientation)]
|
2012-03-14 03:10:48 -07:00
|
|
|
readonly attribute DOMString mozOrientation;
|
|
|
|
|
2012-08-30 20:45:16 -07:00
|
|
|
[implicit_jscontext] attribute jsval onmozorientationchange;
|
2012-03-29 12:43:16 -07:00
|
|
|
|
|
|
|
/**
|
2012-09-11 03:55:08 -07:00
|
|
|
* Lock the screen to the specified orientations(s). This method returns true
|
|
|
|
* if the lock was acquired successfully, and false otherwise.
|
|
|
|
*
|
|
|
|
* The parameter can be a DOMString or an Array of DOMStrings. If you pass a
|
|
|
|
* string, we lock the screen to that one orientation. If you pass an Array,
|
|
|
|
* we ensure that the screen is always in one of the given orientations.
|
|
|
|
*
|
|
|
|
* Valid orientations are "portrait", "portrait-primary",
|
|
|
|
* "portrait-secondary", "landscape", "landscape-primary", and
|
|
|
|
* "landscape-secondary".
|
|
|
|
* These tokens are case-sensitive.
|
|
|
|
*
|
|
|
|
* If you pass a string that's not one of the valid orientations, or if you
|
|
|
|
* pass an array of orientations and any of the orientations in the array is
|
|
|
|
* not valid, we reject the lock and return false.
|
|
|
|
*
|
|
|
|
* The "-primary" orientations correspond to holding the device right-side up,
|
|
|
|
* while the "-secondary" orientations correspond to holding the device
|
|
|
|
* upside-down. Locking the orientation in "portrait" is the same as locking
|
|
|
|
* the orientation in ['portrait-primary', 'portrait-secondary'], and the
|
|
|
|
* "landscape" orientation similarly corresponds to the set
|
|
|
|
* ['landscape-primary', 'landscape-secondary'].
|
2012-03-29 12:43:16 -07:00
|
|
|
*/
|
2012-09-11 03:55:08 -07:00
|
|
|
[implicit_jscontext] boolean mozLockOrientation(in jsval orientation);
|
2012-03-29 12:43:16 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock the screen orientation.
|
|
|
|
*/
|
2012-10-14 00:40:11 -07:00
|
|
|
[binaryname(SlowMozUnlockOrientation)]
|
2012-03-29 12:43:16 -07:00
|
|
|
void mozUnlockOrientation();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|