Fix invalid licenses
[platform/framework/web/crosswalk-tizen.git] / src / runtime / native_window.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef WRT_RUNTIME_NATIVE_WINDOW_H_
18 #define WRT_RUNTIME_NATIVE_WINDOW_H_
19 #include <functional>
20 #include <map>
21
22 #include <Elementary.h>
23
24 namespace wrt {
25
26 class NativeWindow {
27  public:
28   typedef std::function<void(int)> RotationHandler;
29   NativeWindow();
30   virtual ~NativeWindow();
31
32   void Initialize();
33
34   bool initialized() const { return initialized_; }
35   Evas_Object* evas_object() const;
36   void SetContent(Evas_Object* content);
37   void SetRotationLock(int degree);
38   void SetAutoRotation();
39   int AddRotationHandler(RotationHandler handler);
40   void RemoveRotationHandler(int id);
41   int rotation() const { return rotation_; }
42   void Show();
43   void Active();
44   void InActive();
45   void FullScreen(bool enable);
46
47  protected:
48   virtual Evas_Object* CreateWindowInternal() = 0;
49
50  private:
51   static void DidDeleteRequested(void* data, Evas_Object* obj,
52                                  void* event_info);
53   static void DidProfileChanged(void* data, Evas_Object* obj, void* event_info);
54   void DidRotation(int degree);
55   void DidFocusChanged(bool got);
56
57
58   bool initialized_;
59   Evas_Object* window_;
60   Evas_Object* focus_;
61   Evas_Object* content_;
62   int rotation_;
63   int handler_id_;
64   std::map<int, RotationHandler> handler_table_;
65 };
66
67 }  // namespace wrt
68
69
70 #endif  // WRT_RUNTIME_NATIVE_WINDOW_H_