Fix invalid licenses
[platform/framework/web/crosswalk-tizen.git] / src / runtime / web_view_impl.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
18 #ifndef WRT_RUNTIME_WEB_VIEW_IMPL_H_
19 #define WRT_RUNTIME_WEB_VIEW_IMPL_H_
20
21
22 #include <Elementary.h>
23 #include <efl_assist.h>
24 #include <string>
25 #include <map>
26
27 #include "runtime/web_view.h"
28
29 class Ewk_Context;
30
31 namespace wrt {
32 class NativeWindow;
33 class WebViewImpl {
34  public:
35   WebViewImpl(WebView* view, wrt::NativeWindow* window, Ewk_Context* context);
36   virtual ~WebViewImpl();
37
38   void LoadUrl(const std::string& url);
39   std::string GetUrl();
40
41   void Suspend();
42   void Resume();
43   void Reload();
44   void SetVisibility(bool show);
45   bool EvalJavascript(const std::string& script);
46   void SetAppInfo(const std::string& app_name, const std::string& version);
47   bool SetUserAgent(const std::string& user_agent);
48
49   void SetEventListener(WebView::EventListener* listener);
50   Evas_Object* evas_object() const;
51
52  private:
53   void OnKeyEvent(Ea_Callback_Type key_type);
54   void OnRotation(int degree);
55   void Initialize();
56   void Deinitialize();
57
58   void InitKeyCallback();
59   void InitLoaderCallback();
60   void InitPolicyDecideCallback();
61   void InitQuotaExceededCallback();
62   void InitIPCMessageCallback();
63   void InitOrientaionLockCallback();
64   void InitConsoleMessageCallback();
65   void InitCustomContextMenuCallback();
66   void InitRotationCallback();
67   void InitWindowCreateCallback();
68   void InitFullscreenCallback();
69   void InitNotificationPermissionCallback();
70   void InitGeolocationPermissionCallback();
71   void InitAuthenticationCallback();
72   void InitCertificateAllowCallback();
73
74   NativeWindow* window_;
75   Ewk_Context* context_;
76   Evas_Object* ewk_view_;
77   WebView::EventListener* listener_;
78   int rotation_handler_id_;
79   WebView* view_;
80   std::map<const std::string, Evas_Smart_Cb> smart_callbacks_;
81   bool fullscreen_;
82 };
83 }  // namespace wrt
84
85 #endif  // WRT_RUNTIME_WEB_VIEW_IMPL_H_