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>
23 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
33 WebView::WebView(const WebView& WebView)
38 WebView& WebView::operator=(const WebView& view)
42 Control::operator=(view);
52 WebView WebView::New()
54 return Internal::WebView::New();
57 WebView WebView::New(const std::string& locale, const std::string& timezoneId)
59 return Internal::WebView::New(locale, timezoneId);
62 WebView WebView::New( int argc, char** argv )
64 return Internal::WebView::New( argc, argv );
67 WebView WebView::DownCast(BaseHandle handle)
69 return Control::DownCast<WebView, Internal::WebView>(handle);
72 Dali::Toolkit::WebSettings* WebView::GetSettings() const
74 return Dali::Toolkit::GetImpl( *this ).GetSettings();
77 Dali::Toolkit::WebContext* WebView::GetContext() const
79 return Dali::Toolkit::GetImpl( *this ).GetContext();
82 Dali::Toolkit::WebCookieManager* WebView::GetCookieManager() const
84 return Dali::Toolkit::GetImpl( *this ).GetCookieManager();
87 Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const
89 return Dali::Toolkit::GetImpl( *this ).GetBackForwardList();
92 Dali::Toolkit::ImageView WebView::GetFavicon() const
94 return Dali::Toolkit::GetImpl( *this ).GetFavicon();
97 void WebView::LoadUrl(const std::string& url)
99 Dali::Toolkit::GetImpl(*this).LoadUrl(url);
102 void WebView::LoadHtmlString(const std::string& htmlString)
104 Dali::Toolkit::GetImpl(*this).LoadHtmlString(htmlString);
107 void WebView::Reload()
109 Dali::Toolkit::GetImpl(*this).Reload();
112 void WebView::StopLoading()
114 Dali::Toolkit::GetImpl(*this).StopLoading();
117 void WebView::Suspend()
119 Dali::Toolkit::GetImpl(*this).Suspend();
122 void WebView::Resume()
124 Dali::Toolkit::GetImpl(*this).Resume();
127 void WebView::ScrollBy( int deltaX, int deltaY )
129 Dali::Toolkit::GetImpl( *this ).ScrollBy( deltaX, deltaY );
132 bool WebView::CanGoForward()
134 return Dali::Toolkit::GetImpl(*this).CanGoForward();
137 void WebView::GoForward()
139 Dali::Toolkit::GetImpl(*this).GoForward();
142 bool WebView::CanGoBack()
144 return Dali::Toolkit::GetImpl(*this).CanGoBack();
147 void WebView::GoBack()
149 Dali::Toolkit::GetImpl(*this).GoBack();
152 void WebView::EvaluateJavaScript(const std::string& script, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback resultHandler)
154 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, resultHandler);
157 void WebView::EvaluateJavaScript(const std::string& script)
159 Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, nullptr);
162 void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback handler)
164 Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
167 void WebView::ClearAllTilesResources()
169 Dali::Toolkit::GetImpl( *this ).ClearAllTilesResources();
172 void WebView::ClearHistory()
174 Dali::Toolkit::GetImpl(*this).ClearHistory();
177 void WebView::SetTtsFocus(bool focused)
179 Dali::Toolkit::GetImpl(*this).SetTtsFocus(focused);
182 void WebView::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
184 Dali::Toolkit::GetImpl(*this).RegisterPageLoadStartedCallback(callback);
187 void WebView::RegisterPageLoadFinishedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
189 Dali::Toolkit::GetImpl(*this).RegisterPageLoadFinishedCallback(callback);
192 void WebView::RegisterPageLoadErrorCallback(Dali::WebEnginePlugin::WebEnginePageLoadErrorCallback callback)
194 Dali::Toolkit::GetImpl(*this).RegisterPageLoadErrorCallback(callback);
197 void WebView::RegisterScrollEdgeReachedCallback(Dali::WebEnginePlugin::WebEngineScrollEdgeReachedCallback callback)
199 Dali::Toolkit::GetImpl(*this).RegisterScrollEdgeReachedCallback(callback);
202 void WebView::RegisterUrlChangedCallback(Dali::WebEnginePlugin::WebEngineUrlChangedCallback callback)
204 Dali::Toolkit::GetImpl(*this).RegisterUrlChangedCallback(callback);
207 void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback)
209 Dali::Toolkit::GetImpl(*this).RegisterNavigationPolicyDecidedCallback(callback);
212 void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
214 Dali::Toolkit::GetImpl(*this).GetPlainTextAsynchronously(callback);
217 WebView::WebView(Internal::WebView& implementation)
218 : Control(implementation)
222 WebView::WebView(Dali::Internal::CustomActor* internal)
225 VerifyCustomActorPointer<Internal::WebView>(internal);
228 } // namespace Toolkit