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.
18 #ifndef WRT_RUNTIME_WEB_VIEW_IMPL_H_
19 #define WRT_RUNTIME_WEB_VIEW_IMPL_H_
22 #include <Elementary.h>
23 #include <efl_assist.h>
27 #include "runtime/web_view.h"
35 WebViewImpl(WebView* view, wrt::NativeWindow* window, Ewk_Context* context);
36 virtual ~WebViewImpl();
38 void LoadUrl(const std::string& url);
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);
49 void SetEventListener(WebView::EventListener* listener);
50 Evas_Object* evas_object() const;
53 void OnKeyEvent(Ea_Callback_Type key_type);
54 void OnRotation(int degree);
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();
74 NativeWindow* window_;
75 Ewk_Context* context_;
76 Evas_Object* ewk_view_;
77 WebView::EventListener* listener_;
78 int rotation_handler_id_;
80 std::map<const std::string, Evas_Smart_Cb> smart_callbacks_;
85 #endif // WRT_RUNTIME_WEB_VIEW_IMPL_H_