20ae948bc9e392fe26df0eced24bc8142a997c46
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-view.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/web-view/web-view-impl.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 WebView::WebView()
31 {
32 }
33
34 WebView::WebView( const WebView& WebView )
35 : Control( WebView )
36 {
37 }
38
39 WebView& WebView::operator=( const WebView& view )
40 {
41   if( &view != this )
42   {
43     Control::operator=( view );
44   }
45
46   return *this;
47 }
48
49 WebView::~WebView()
50 {
51 }
52
53 WebView WebView::New()
54 {
55   return Internal::WebView::New();
56 }
57
58 WebView WebView::New( const std::string& locale, const std::string& timezoneId )
59 {
60   return Internal::WebView::New( locale, timezoneId );
61 }
62
63 WebView WebView::DownCast( BaseHandle handle )
64 {
65   return Control::DownCast< WebView, Internal::WebView >( handle );
66 }
67
68 void WebView::LoadUrl( const std::string& url )
69 {
70   Dali::Toolkit::GetImpl( *this ).LoadUrl( url );
71 }
72
73 void WebView::LoadHTMLString( const std::string& htmlString )
74 {
75   Dali::Toolkit::GetImpl( *this ).LoadHTMLString( htmlString );
76 }
77
78 void WebView::Reload()
79 {
80   Dali::Toolkit::GetImpl( *this ).Reload();
81 }
82
83 void WebView::StopLoading()
84 {
85   Dali::Toolkit::GetImpl( *this ).StopLoading();
86 }
87
88 void WebView::Suspend()
89 {
90   Dali::Toolkit::GetImpl( *this ).Suspend();
91 }
92
93 void WebView::Resume()
94 {
95   Dali::Toolkit::GetImpl( *this ).Resume();
96 }
97
98 bool WebView::CanGoForward()
99 {
100   return Dali::Toolkit::GetImpl( *this ).CanGoForward();
101 }
102
103 void WebView::GoForward()
104 {
105   Dali::Toolkit::GetImpl( *this ).GoForward();
106 }
107
108 bool WebView::CanGoBack()
109 {
110   return Dali::Toolkit::GetImpl( *this ).CanGoBack();
111 }
112
113 void WebView::GoBack()
114 {
115   Dali::Toolkit::GetImpl( *this ).GoBack();
116 }
117
118 void WebView::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
119 {
120   Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script, resultHandler );
121 }
122
123 void WebView::EvaluateJavaScript( const std::string& script )
124 {
125   Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script, nullptr );
126 }
127
128 void WebView::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
129 {
130   Dali::Toolkit::GetImpl( *this ).AddJavaScriptMessageHandler( exposedObjectName, handler );
131 }
132
133 void WebView::ClearHistory()
134 {
135   Dali::Toolkit::GetImpl( *this ).ClearHistory();
136 }
137
138 void WebView::ClearCache()
139 {
140   Dali::Toolkit::GetImpl( *this ).ClearCache();
141 }
142
143 void WebView::ClearCookies()
144 {
145   Dali::Toolkit::GetImpl( *this ).ClearCookies();
146 }
147
148 WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
149 {
150   return Dali::Toolkit::GetImpl( *this ).PageLoadStartedSignal();
151 }
152
153 WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
154 {
155   return Dali::Toolkit::GetImpl( *this ).PageLoadFinishedSignal();
156 }
157
158 WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
159 {
160   return Dali::Toolkit::GetImpl( *this ).PageLoadErrorSignal();
161 }
162
163 WebView::WebView( Internal::WebView& implementation )
164 : Control( implementation )
165 {
166 }
167
168 WebView::WebView( Dali::Internal::CustomActor* internal )
169 : Control( internal )
170 {
171   VerifyCustomActorPointer< Internal::WebView >( internal );
172 }
173
174 } // namespace Toolkit
175
176 } // namespace Dali