2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef XWALK_RUNTIME_BROWSER_NATIVE_WINDOW_H_
18 #define XWALK_RUNTIME_BROWSER_NATIVE_WINDOW_H_
20 #include <Elementary.h>
29 enum class ScreenOrientation {
31 PORTRAIT_SECONDARY = 1,
32 LANDSCAPE_PRIMARY = 2,
33 LANDSCAPE_SECONDARY = 3,
41 typedef std::function<void(int)> RotationHandler;
43 virtual ~NativeWindow();
47 bool initialized() const { return initialized_; }
48 Evas_Object* evas_object() const;
49 void SetContent(Evas_Object* content);
50 void SetRotationLock(int degree);
51 void SetRotationLock(ScreenOrientation orientation);
52 void SetAutoRotation();
53 void SetCurrentViewModeFullScreen(bool mode);
54 int AddRotationHandler(RotationHandler handler);
55 void RemoveRotationHandler(int id);
56 int rotation() const { return rotation_; }
57 ScreenOrientation orientation() const;
61 void FullScreen(bool enable);
62 ScreenOrientation natural_orientation() const { return natural_orientation_;}
63 Type type() const { return window_type_;}
64 #ifdef MANUAL_ROTATE_FEATURE_SUPPORT
65 void EnableManualRotation(bool enable);
66 void ManualRotationDone();
67 #endif // MANUAL_ROTATE_FEATURE_SUPPORT
70 virtual Evas_Object* CreateWindowInternal() = 0;
75 static void DidDeleteRequested(void* data, Evas_Object* obj,
77 static void DidProfileChanged(void* data, Evas_Object* obj, void* event_info);
78 void DidRotation(int degree);
79 void DidFocusChanged(bool got);
82 bool currentViewModeFullScreen_;
84 Evas_Object* content_;
87 ScreenOrientation natural_orientation_;
88 std::map<int, RotationHandler> handler_table_;
91 } // namespace runtime
94 #endif // XWALK_RUNTIME_BROWSER_NATIVE_WINDOW_H_