Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / screen_orientation / ScreenOrientation.h
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 #ifndef ScreenOrientation_h
6 #define ScreenOrientation_h
7
8 #include "core/events/EventTarget.h"
9 #include "core/frame/DOMWindowProperty.h"
10 #include "platform/Supplementable.h"
11 #include "wtf/Vector.h"
12 #include "wtf/text/AtomicString.h"
13 #include "wtf/text/WTFString.h"
14
15 namespace WebCore {
16
17 class Screen;
18
19 class ScreenOrientation FINAL : public Supplement<Screen>, DOMWindowProperty {
20 public:
21     static ScreenOrientation* from(Screen*);
22     virtual ~ScreenOrientation();
23
24     DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange);
25
26     static const AtomicString& orientation(Screen*);
27     static bool lockOrientation(Screen*, const Vector<String>& orientations);
28     static bool lockOrientation(Screen*, const AtomicString& orientation);
29     static void unlockOrientation(Screen*);
30
31 private:
32     explicit ScreenOrientation(Screen*);
33     static const char* supplementName();
34     Screen* screen() const;
35 };
36
37 } // namespace WebCore
38
39 #endif // ScreenOrientation_h