1 // Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WRT_RUNTIME_WEB_VIEW_H_
6 #define WRT_RUNTIME_WEB_VIEW_H_
8 #include <Elementary.h>
9 #include <efl_assist.h>
10 #include <ewk_ipc_message.h>
22 virtual void OnLoadStart(WebView* /*view*/) {}
23 virtual void OnLoadProgress(WebView* /*view*/, double /*persent*/ ) {}
24 virtual void OnLoadFinished(WebView* /*view*/) {}
25 virtual void OnRendered(WebView* /*view*/) {}
26 virtual void OnCreatedNewWebView(WebView* /*view*/,
27 WebView* /*new_view*/) {}
28 virtual void OnClosedWebView(WebView* /*view*/) {}
29 virtual void OnCrashed(WebView* /*view*/) {}
30 virtual bool OnDidOpenWindow(
31 WebView* /*view*/, const std::string& /*url*/) { return true; }
32 virtual bool OnDidNavigation(
33 WebView* /*view*/, const std::string& /*url*/) { return true; }
34 virtual void OnHardwareKey(
35 WebView* /*view*/, const std::string& /*keyname*/) {}
36 virtual void OnReceivedWrtMessage(
37 WebView* /*view*/, const Ewk_IPC_Wrt_Message_Data& /*msg*/) {}
40 WebView(wrt::NativeWindow* window, Ewk_Context* context);
43 void LoadUrl(const std::string& url);
49 void SetVisibility(bool show);
50 bool EvalJavascript(const std::string& script);
52 void SetEventListener(EventListener* listener);
53 Evas_Object* evas_object() const;
56 void OnKeyEvent(Ea_Callback_Type key_type);
57 void OnRotation(int degree);
59 NativeWindow* window_;
60 Ewk_Context* context_;
61 Evas_Object* ewk_view_;
62 EventListener* listener_;
63 int rotation_handler_id_;
68 #endif // WRT_RUNTIME_WEB_VIEW_H_