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
69 void SignalEmit(const char* emission, const char* source);
70 void UpdateProgress(double value);
74 virtual Evas_Object* CreateWindowInternal() = 0;
79 static void DidDeleteRequested(void* data, Evas_Object* obj,
81 static void DidProfileChanged(void* data, Evas_Object* obj, void* event_info);
82 void DidRotation(int degree);
83 void DidFocusChanged(bool got);
86 bool currentViewModeFullScreen_;
88 Evas_Object* content_;
90 Evas_Object* progressbar_;
91 Evas_Object* top_layout_;
95 ScreenOrientation natural_orientation_;
96 std::map<int, RotationHandler> handler_table_;
99 } // namespace runtime
102 #endif // XWALK_RUNTIME_BROWSER_NATIVE_WINDOW_H_