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 Dali::Toolkit::WebSettings* WebView::GetSettings() const
68 return Dali::Toolkit::GetImpl( *this ).GetSettings();
71 Dali::Toolkit::WebContext* WebView::GetContext() const
73 return Dali::Toolkit::GetImpl( *this ).GetContext();
76 Dali::Toolkit::WebCookieManager* WebView::GetCookieManager() const
78 return Dali::Toolkit::GetImpl( *this ).GetCookieManager();
81 Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const
83 return Dali::Toolkit::GetImpl( *this ).GetBackForwardList();
86 void WebView::LoadUrl(const std::string& url)
88 Dali::Toolkit::GetImpl(*this).LoadUrl(url);
91 void WebView::LoadHtmlString(const std::string& htmlString)
93 Dali::Toolkit::GetImpl(*this).LoadHtmlString(htmlString);
96 void WebView::Reload()
98 Dali::Toolkit::GetImpl(*this).Reload();
101 void WebView::StopLoading()
103 Dali::Toolkit::GetImpl(*this).StopLoading();
106 void WebView::Suspend()
108 Dali::Toolkit::GetImpl(*this).Suspend();
111 void WebView::Resume()
113 Dali::Toolkit::GetImpl(*this).Resume();
116 void WebView::ScrollBy( int deltaX, int deltaY )
118 Dali::Toolkit::GetImpl( *this ).ScrollBy( deltaX, deltaY );
121 bool WebView::CanGoForward()
123 return Dali::Toolkit::GetImpl(*this).CanGoForward();
126 void WebView::GoForward()
128 Dali::Toolkit::GetImpl(*this).GoForward();
131 bool WebView::CanGoBack()
133 return Dali::Toolkit::GetImpl(*this).CanGoBack();
136 void WebView::GoBack()
138 Dali::Toolkit::GetImpl(*this).GoBack();
141 void WebView::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
143 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, resultHandler);
146 void WebView::EvaluateJavaScript(const std::string& script)
148 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, nullptr);
151 void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
153 Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
156 void WebView::ClearHistory()
158 Dali::Toolkit::GetImpl(*this).ClearHistory();
161 WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
163 return Dali::Toolkit::GetImpl(*this).PageLoadStartedSignal();
166 WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
168 return Dali::Toolkit::GetImpl(*this).PageLoadFinishedSignal();
171 WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
173 return Dali::Toolkit::GetImpl(*this).PageLoadErrorSignal();
176 WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
178 return Dali::Toolkit::GetImpl( *this ).ScrollEdgeReachedSignal();
181 WebView::WebView(Internal::WebView& implementation)
182 : Control(implementation)
186 WebView::WebView(Dali::Internal::CustomActor* internal)
189 VerifyCustomActorPointer<Internal::WebView>(internal);
192 } // namespace Toolkit