michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [scriptable, uuid(D6F13AF4-8ACA-4A10-8687-3F99C3692AC0)] michael@0: interface nsIScreen : nsISupports michael@0: { michael@0: /** michael@0: * Levels of brightness for the screen, from off to full brightness. michael@0: */ michael@0: const unsigned long BRIGHTNESS_DIM = 0; michael@0: const unsigned long BRIGHTNESS_FULL = 1; michael@0: michael@0: /* The number of different brightness levels */ michael@0: const unsigned long BRIGHTNESS_LEVELS = 2; michael@0: michael@0: /** michael@0: * Allowable screen rotations, when the underlying widget toolkit michael@0: * supports rotating the screen. michael@0: * michael@0: * ROTATION_0_DEG is the default, unrotated configuration. michael@0: */ michael@0: const unsigned long ROTATION_0_DEG = 0; michael@0: const unsigned long ROTATION_90_DEG = 1; michael@0: const unsigned long ROTATION_180_DEG = 2; michael@0: const unsigned long ROTATION_270_DEG = 3; michael@0: michael@0: /** michael@0: * These report screen dimensions in (screen-specific) device pixels michael@0: */ michael@0: void GetRect(out long left, out long top, out long width, out long height); michael@0: void GetAvailRect(out long left, out long top, out long width, out long height); michael@0: michael@0: /** michael@0: * And these report in global display pixels michael@0: */ michael@0: void GetRectDisplayPix(out long left, out long top, out long width, out long height); michael@0: void GetAvailRectDisplayPix(out long left, out long top, out long width, out long height); michael@0: michael@0: /** michael@0: * Locks the minimum brightness of the screen, forcing it to be at michael@0: * least as bright as a certain brightness level. Each call to this michael@0: * function must eventually be followed by a corresponding call to michael@0: * unlockMinimumBrightness, with the same brightness level. michael@0: * michael@0: * @param brightness A brightness level, one of the above constants. michael@0: */ michael@0: void lockMinimumBrightness(in unsigned long brightness); michael@0: michael@0: /** michael@0: * Releases a lock on the screen brightness. This must be called michael@0: * (eventually) after a corresponding call to lockMinimumBrightness. michael@0: * michael@0: * @param brightness A brightness level, one of the above constants. michael@0: */ michael@0: void unlockMinimumBrightness(in unsigned long brightness); michael@0: michael@0: readonly attribute long pixelDepth; michael@0: readonly attribute long colorDepth; michael@0: /** michael@0: * Get/set the screen rotation, on platforms that support changing michael@0: * screen rotation. michael@0: */ michael@0: attribute unsigned long rotation; michael@0: michael@0: /** michael@0: * The number of device pixels per screen point in HiDPI mode. michael@0: * Returns 1.0 if HiDPI mode is disabled or unsupported. michael@0: */ michael@0: readonly attribute double contentsScaleFactor; michael@0: };