// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

enum OrientationLockType {
    "any",
    "natural",
    "landscape",
    "portrait",
    "portrait-primary",
    "portrait-secondary",
    "landscape-primary",
    "landscape-secondary"
};

enum OrientationType {
    "portrait-primary",
    "portrait-secondary",
    "landscape-primary",
    "landscape-secondary"
};

[
    GarbageCollected,
    RuntimeEnabled=ScreenOrientation
] interface ScreenOrientation : EventTarget {
    [MeasureAs=ScreenOrientationAngle] readonly attribute unsigned short angle;
    [MeasureAs=ScreenOrientationType] readonly attribute DOMString type;

    [CallWith=ScriptState, MeasureAs=ScreenOrientationLock] Promise lock(OrientationLockType orientation);
    [MeasureAs=ScreenOrientationUnlock] void unlock();

    attribute EventHandler onchange;
};
