X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Fweb-view%2Fweb-view.cpp;h=a0672ae10fd80c75cb00169ab46ef7bb27667b2a;hb=41c8e6862c377913d579544ee6103a6c8aa482d1;hp=0b3698b345a52110729ef6b467d878068e88f71b;hpb=fbda0e1b3488d481e2e577ae1bef54db7604b68a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.cpp b/dali-toolkit/devel-api/controls/web-view/web-view.cpp old mode 100644 new mode 100755 index 0b3698b..a0672ae --- a/dali-toolkit/devel-api/controls/web-view/web-view.cpp +++ b/dali-toolkit/devel-api/controls/web-view/web-view.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,27 +20,26 @@ // INTERNAL INCLUDES #include +#include namespace Dali { - namespace Toolkit { - WebView::WebView() { } -WebView::WebView( const WebView& WebView ) -: Control( WebView ) +WebView::WebView(const WebView& WebView) +: Control(WebView) { } -WebView& WebView::operator=( const WebView& view ) +WebView& WebView::operator=(const WebView& view) { - if( &view != this ) + if(&view != this) { - Control::operator=( view ); + Control::operator=(view); } return *this; @@ -55,105 +54,155 @@ WebView WebView::New() return Internal::WebView::New(); } -WebView WebView::New( const std::string& locale, const std::string& timezoneId ) +WebView WebView::New(const std::string& locale, const std::string& timezoneId) +{ + return Internal::WebView::New(locale, timezoneId); +} + +WebView WebView::New( int argc, char** argv ) +{ + return Internal::WebView::New( argc, argv ); +} + +WebView WebView::DownCast(BaseHandle handle) +{ + return Control::DownCast(handle); +} + +Dali::Toolkit::WebSettings* WebView::GetSettings() const +{ + return Dali::Toolkit::GetImpl( *this ).GetSettings(); +} + +Dali::Toolkit::WebContext* WebView::GetContext() const +{ + return Dali::Toolkit::GetImpl( *this ).GetContext(); +} + +Dali::Toolkit::WebCookieManager* WebView::GetCookieManager() const { - return Internal::WebView::New( locale, timezoneId ); + return Dali::Toolkit::GetImpl( *this ).GetCookieManager(); } -WebView WebView::DownCast( BaseHandle handle ) +Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const { - return Control::DownCast< WebView, Internal::WebView >( handle ); + return Dali::Toolkit::GetImpl( *this ).GetBackForwardList(); } -void WebView::LoadUrl( const std::string& url ) +Dali::Toolkit::ImageView& WebView::GetFavicon() { - Dali::Toolkit::GetImpl( *this ).LoadUrl( url ); + return Dali::Toolkit::GetImpl( *this ).GetFavicon(); } -const std::string& WebView::GetUrl() +void WebView::LoadUrl(const std::string& url) { - return Dali::Toolkit::GetImpl( *this ).GetUrl(); + Dali::Toolkit::GetImpl(*this).LoadUrl(url); } -void WebView::LoadHTMLString( const std::string& htmlString ) +void WebView::LoadHtmlString(const std::string& htmlString) { - Dali::Toolkit::GetImpl( *this ).LoadHTMLString( htmlString ); + Dali::Toolkit::GetImpl(*this).LoadHtmlString(htmlString); } void WebView::Reload() { - Dali::Toolkit::GetImpl( *this ).Reload(); + Dali::Toolkit::GetImpl(*this).Reload(); } void WebView::StopLoading() { - Dali::Toolkit::GetImpl( *this ).StopLoading(); + Dali::Toolkit::GetImpl(*this).StopLoading(); +} + +void WebView::Suspend() +{ + Dali::Toolkit::GetImpl(*this).Suspend(); +} + +void WebView::Resume() +{ + Dali::Toolkit::GetImpl(*this).Resume(); +} + +void WebView::ScrollBy( int deltaX, int deltaY ) +{ + Dali::Toolkit::GetImpl( *this ).ScrollBy( deltaX, deltaY ); } bool WebView::CanGoForward() { - return Dali::Toolkit::GetImpl( *this ).CanGoForward(); + return Dali::Toolkit::GetImpl(*this).CanGoForward(); } void WebView::GoForward() { - Dali::Toolkit::GetImpl( *this ).GoForward(); + Dali::Toolkit::GetImpl(*this).GoForward(); } bool WebView::CanGoBack() { - return Dali::Toolkit::GetImpl( *this ).CanGoBack(); + return Dali::Toolkit::GetImpl(*this).CanGoBack(); } void WebView::GoBack() { - Dali::Toolkit::GetImpl( *this ).GoBack(); + Dali::Toolkit::GetImpl(*this).GoBack(); +} + +void WebView::EvaluateJavaScript(const std::string& script, std::function resultHandler) +{ + Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, resultHandler); } -void WebView::EvaluateJavaScript( const std::string& script ) +void WebView::EvaluateJavaScript(const std::string& script) { - Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script ); + Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, nullptr); } -void WebView::AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > callback ) +void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler) { - Dali::Toolkit::GetImpl( *this ).AddJavaScriptInterface( exposedObjectName, jsFunctionName, callback ); + Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler); } -void WebView::RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName ) +void WebView::ClearAllTilesResources() { - Dali::Toolkit::GetImpl( *this ).RemoveJavascriptInterface( exposedObjectName, jsFunctionName ); + Dali::Toolkit::GetImpl( *this ).ClearAllTilesResources(); } void WebView::ClearHistory() { - Dali::Toolkit::GetImpl( *this ).ClearHistory(); + Dali::Toolkit::GetImpl(*this).ClearHistory(); +} + +WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal() +{ + return Dali::Toolkit::GetImpl(*this).PageLoadStartedSignal(); } -void WebView::ClearCache() +WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal() { - Dali::Toolkit::GetImpl( *this ).ClearCache(); + return Dali::Toolkit::GetImpl(*this).PageLoadFinishedSignal(); } -WebView::WebViewSignalType& WebView::PageLoadStartedSignal() +WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal() { - return Dali::Toolkit::GetImpl( *this ).PageLoadStartedSignal(); + return Dali::Toolkit::GetImpl(*this).PageLoadErrorSignal(); } -WebView::WebViewSignalType& WebView::PageLoadFinishedSignal() +WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal() { - return Dali::Toolkit::GetImpl( *this ).PageLoadFinishedSignal(); + return Dali::Toolkit::GetImpl( *this ).ScrollEdgeReachedSignal(); } -WebView::WebView( Internal::WebView& implementation ) -: Control( implementation ) +WebView::WebView(Internal::WebView& implementation) +: Control(implementation) { } -WebView::WebView( Dali::Internal::CustomActor* internal ) -: Control( internal ) +WebView::WebView(Dali::Internal::CustomActor* internal) +: Control(internal) { - VerifyCustomActorPointer< Internal::WebView >( internal ); + VerifyCustomActorPointer(internal); } } // namespace Toolkit