8622b012155c296694a1cd51874e192c9163c3ef
[platform/framework/web/wrt.git] / src / view / i_view_module.h
1 /*
2  * Copyright (c) 2011 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  * @file    i_view_module.h
18  * @author  Pawel Sikorski (p.sikorski@samsung.com)
19  * @version 1.0
20  * @brief   Interface for ViewModule
21  */
22
23 #ifndef WRT_SRC_VIEW_I_VIEW_MODULE_H_
24 #define WRT_SRC_VIEW_I_VIEW_MODULE_H_
25
26 #include <memory>
27 #include <string>
28 #include <common/evas_object.h>
29 #include <EWebKit2.h>
30 #include <i_runnable_widget_object.h>
31
32 class WidgetModel; //FORWARD DECLARATION
33 namespace ViewModule {
34
35 /** \brief Interface to ViewModule. Object of IViewModule type is returned from
36  *  ViewModuleMgr factory.
37  */
38 class IViewModule
39 {
40 public:
41     virtual bool createWebView(Ewk_Context* context,
42                                Evas_Object* window) = 0;
43     virtual void destroyWebView() = 0;
44     virtual void initialize() = 0;
45     virtual void terminate() = 0;
46     virtual void prepareView(WidgetModel *, const std::string &) = 0;
47     virtual void showWidget() = 0;
48     virtual void hideWidget() = 0;
49     virtual void suspendWidget()= 0;
50     virtual void resumeWidget() = 0;
51     virtual void resetWidget() = 0;
52     virtual void backward() = 0;
53     virtual void reloadStartPage() = 0;
54     virtual Evas_Object* getCurrentWebview() = 0;
55     virtual void fireJavascriptEvent(int event, void* data) = 0;
56     virtual void setUserCallbacks(const WRT::UserDelegatesPtr& cbs) = 0;
57 };
58
59 typedef std::shared_ptr<IViewModule> IViewModulePtr;
60
61 /**
62  * \brief This is a function for retrieving View object. It returns a pointer
63  * to IViewModule object.
64  */
65 IViewModulePtr createView();
66
67 } //namespace
68
69 #endif /* WRT_SRC_VIEW_I_VIEW_MODULE_H_ */