2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 * @file AppBoxRenderView.h
18 * @author Yunchan Cho (yunchan.cho@samsung.com)
20 #ifndef APP_BOX_RENDER_VIEW_H
21 #define APP_BOX_RENDER_VIEW_H
28 #include <ewk_context.h>
29 #include <i_runnable_widget_object.h>
30 #include <Core/View/IRenderView.h>
31 #include <Core/View/IPdHelper.h>
33 class AppBoxRenderBuffer;
35 class AppBoxRenderView: public IRenderView {
37 typedef std::shared_ptr<Ewk_Context> EwkContextPtr;
38 static IRenderViewPtr create(
39 std::string boxId, std::string instanceId,
40 Evas_Object* boxWin, EwkContextPtr ewkContext)
42 return IRenderViewPtr(
44 boxId, instanceId, boxWin, ewkContext));
46 virtual void showBox(RenderInfoPtr renderInfo);
47 virtual void hideBox();
48 virtual void pauseBox();
49 virtual void resumeBox();
50 virtual void showPd(Evas_Object* pdWin, RenderInfoPtr renderInfo);
51 virtual void hidePd();
52 virtual ~AppBoxRenderView();
60 typedef std::shared_ptr<WRT::IRunnableWidgetObject> ViewPtr;
64 std::string getAppId(std::string& boxId);
65 std::string getStartUrl(UrlType type, std::string& defaultParams);
66 Evas_Object* getCurrentSnapShot();
68 void addRenderTimer();
69 void deleteRenderTimer();
71 // timer and idler callback
72 static Eina_Bool fireRenderTimerCallback(void* data);
73 static Eina_Bool openPdIdlerCallback(void* data);
75 // user Callbacks of RunnableWidgetObject
76 void startLoadCallback(Evas_Object* webview);
77 void finishLoadCallback(Evas_Object* webview);
78 void createWindowBeforeCallback(Evas** canvas, Evas_Object* parent);
79 void createWindowAfterCallback(Evas_Object* parent, Evas_Object* child);
80 void setBufferCallback(Evas_Object* webview);
81 void unsetBufferCallback(Evas_Object* webview);
84 explicit AppBoxRenderView(
85 std::string boxId, std::string instanceId,
86 Evas_Object* boxWin, EwkContextPtr ewkContext);
91 std::string m_instanceId;
92 Evas_Object* m_boxWin;
93 Evas_Object* m_baseWebView;
94 Evas_Object* m_snapshot;
95 RenderInfoPtr m_renderInfo;
97 std::string m_startUrl;
98 Ecore_Timer* m_fireRenderTimer;
99 IPdHelperPtr m_pdHelper;
100 EwkContextPtr m_ewkContext;
101 AppBoxRenderBuffer* m_renderBuffer;
103 friend class AppBoxRenderBuffer;
106 #endif // APP_BOX_RENDER_VIEW_H