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 bool WebView::CanGoForward()
98 return Dali::Toolkit::GetImpl(*this).CanGoForward();
101 void WebView::GoForward()
103 Dali::Toolkit::GetImpl(*this).GoForward();
106 bool WebView::CanGoBack()
108 return Dali::Toolkit::GetImpl(*this).CanGoBack();
111 void WebView::GoBack()
113 Dali::Toolkit::GetImpl(*this).GoBack();
116 void WebView::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
118 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, resultHandler);
121 void WebView::EvaluateJavaScript(const std::string& script)
123 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, nullptr);
126 void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
128 Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
131 void WebView::ClearHistory()
133 Dali::Toolkit::GetImpl(*this).ClearHistory();
136 void WebView::ClearCache()
138 Dali::Toolkit::GetImpl(*this).ClearCache();
141 void WebView::ClearCookies()
143 Dali::Toolkit::GetImpl(*this).ClearCookies();
146 WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
148 return Dali::Toolkit::GetImpl(*this).PageLoadStartedSignal();
151 WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
153 return Dali::Toolkit::GetImpl(*this).PageLoadFinishedSignal();
156 WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
158 return Dali::Toolkit::GetImpl(*this).PageLoadErrorSignal();
161 WebView::WebView(Internal::WebView& implementation)
162 : Control(implementation)
166 WebView::WebView(Dali::Internal::CustomActor* internal)
169 VerifyCustomActorPointer<Internal::WebView>(internal);
172 } // namespace Toolkit