8569fbd969b76a2fc7ee0777ce1be7afc3b1e9c4
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / screen_orientation / ScreenOrientation.idl
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 enum OrientationLockType {
6     "any",
7     "natural",
8     "landscape",
9     "portrait",
10     "portrait-primary",
11     "portrait-secondary",
12     "landscape-primary",
13     "landscape-secondary"
14 };
15
16 enum OrientationType {
17     "portrait-primary",
18     "portrait-secondary",
19     "landscape-primary",
20     "landscape-secondary"
21 };
22
23 [
24     GarbageCollected,
25     RuntimeEnabled=ScreenOrientation
26 ] interface ScreenOrientation : EventTarget {
27     [MeasureAs=ScreenOrientationAngle] readonly attribute unsigned short angle;
28     [MeasureAs=ScreenOrientationType] readonly attribute DOMString type;
29
30     [CallWith=ScriptState, MeasureAs=ScreenOrientationLock] Promise lock(OrientationLockType orientation);
31     [MeasureAs=ScreenOrientationUnlock] void unlock();
32
33     attribute EventHandler onchange;
34 };