2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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.
19 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
22 #include <dali-toolkit/internal/controls/web-view/web-view-impl.h>
32 WebView::WebView(const WebView& WebView)
37 WebView& WebView::operator=(const WebView& view)
41 Control::operator=(view);
51 WebView WebView::New()
53 return Internal::WebView::New();
56 WebView WebView::New(const std::string& locale, const std::string& timezoneId)
58 return Internal::WebView::New(locale, timezoneId);
61 WebView WebView::DownCast(BaseHandle handle)
63 return Control::DownCast<WebView, Internal::WebView>(handle);
66 void WebView::LoadUrl(const std::string& url)
68 Dali::Toolkit::GetImpl(*this).LoadUrl(url);
71 void WebView::LoadHTMLString(const std::string& htmlString)
73 Dali::Toolkit::GetImpl(*this).LoadHTMLString(htmlString);
76 void WebView::Reload()
78 Dali::Toolkit::GetImpl(*this).Reload();
81 void WebView::StopLoading()
83 Dali::Toolkit::GetImpl(*this).StopLoading();
86 void WebView::Suspend()
88 Dali::Toolkit::GetImpl(*this).Suspend();
91 void WebView::Resume()
93 Dali::Toolkit::GetImpl(*this).Resume();
96 void WebView::ScrollBy( int deltaX, int deltaY )
98 Dali::Toolkit::GetImpl( *this ).ScrollBy( deltaX, deltaY );
101 bool WebView::CanGoForward()
103 return Dali::Toolkit::GetImpl(*this).CanGoForward();
106 void WebView::GoForward()
108 Dali::Toolkit::GetImpl(*this).GoForward();
111 bool WebView::CanGoBack()
113 return Dali::Toolkit::GetImpl(*this).CanGoBack();
116 void WebView::GoBack()
118 Dali::Toolkit::GetImpl(*this).GoBack();
121 void WebView::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
123 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, resultHandler);
126 void WebView::EvaluateJavaScript(const std::string& script)
128 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, nullptr);
131 void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
133 Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
136 void WebView::ClearHistory()
138 Dali::Toolkit::GetImpl(*this).ClearHistory();
141 void WebView::ClearCache()
143 Dali::Toolkit::GetImpl(*this).ClearCache();
146 void WebView::ClearCookies()
148 Dali::Toolkit::GetImpl(*this).ClearCookies();
151 WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
153 return Dali::Toolkit::GetImpl(*this).PageLoadStartedSignal();
156 WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
158 return Dali::Toolkit::GetImpl(*this).PageLoadFinishedSignal();
161 WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
163 return Dali::Toolkit::GetImpl(*this).PageLoadErrorSignal();
166 WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
168 return Dali::Toolkit::GetImpl( *this ).ScrollEdgeReachedSignal();
171 WebView::WebView(Internal::WebView& implementation)
172 : Control(implementation)
176 WebView::WebView(Dali::Internal::CustomActor* internal)
179 VerifyCustomActorPointer<Internal::WebView>(internal);
182 } // namespace Toolkit