X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fweb-engine.cpp;h=76dfec0f38fa91f0f0c440366214a7c3d4a7dfd2;hb=refs%2Fchanges%2F04%2F252304%2F1;hp=04a7368bcb995d13dab4d0b68719532c246903ce;hpb=542418b6881ace443f7223e48fb4408bb54c7d09;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/web-engine.cpp b/dali/devel-api/adaptor-framework/web-engine.cpp old mode 100644 new mode 100755 index 04a7368..76dfec0 --- a/dali/devel-api/adaptor-framework/web-engine.cpp +++ b/dali/devel-api/adaptor-framework/web-engine.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. @@ -19,17 +19,23 @@ #include // INTERNAL INCLUDES +#include +#include +#include +#include #include +// EXTERNAL INCLUDES +#include + namespace Dali { - WebEngine::WebEngine() { } -WebEngine::WebEngine( Internal::Adaptor::WebEngine* internal ) -: BaseHandle( internal ) +WebEngine::WebEngine(Internal::Adaptor::WebEngine* internal) +: BaseHandle(internal) { } @@ -41,222 +47,226 @@ WebEngine WebEngine::New() { Internal::Adaptor::WebEnginePtr engine = Internal::Adaptor::WebEngine::New(); - return WebEngine( engine.Get() ); + return WebEngine(engine.Get()); } -WebEngine::WebEngine( const WebEngine& webEngine ) -: BaseHandle( webEngine ) +WebEngine::WebEngine(const WebEngine& webEngine) +: BaseHandle(webEngine) { } -WebEngine& WebEngine::operator=( const WebEngine& webEngine ) +WebEngine& WebEngine::operator=(const WebEngine& webEngine) { - if( *this != webEngine ) + if(*this != webEngine) { - BaseHandle::operator=( webEngine ); + BaseHandle::operator=(webEngine); } return *this; } -WebEngine WebEngine::DownCast( BaseHandle handle ) +WebEngine WebEngine::DownCast(BaseHandle handle) { - return WebEngine( dynamic_cast< Internal::Adaptor::WebEngine* >( handle.GetObjectPtr() ) ); + return WebEngine(dynamic_cast(handle.GetObjectPtr())); } -void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId ) +void WebEngine::Create(int width, int height, const std::string& locale, const std::string& timezoneId) { - GetImplementation( *this ).Create( width, height, locale, timezoneId ); + GetImplementation(*this).Create(width, height, locale, timezoneId); } -void WebEngine::Destroy() +void WebEngine::Create( int width, int height, int argc, char** argv ) { - GetImplementation( *this ).Destroy(); + GetImplementation( *this ).Create( width, height, argc, argv ); } -NativeImageInterfacePtr WebEngine::GetNativeImageSource() +void WebEngine::Destroy() { - return GetImplementation( *this ).GetNativeImageSource(); + GetImplementation(*this).Destroy(); } -void WebEngine::LoadUrl( const std::string& url ) +NativeImageInterfacePtr WebEngine::GetNativeImageSource() { - return GetImplementation( *this ).LoadUrl( url ); + return GetImplementation(*this).GetNativeImageSource(); } -const std::string& WebEngine::GetUrl() +Dali::WebEngineSettings& WebEngine::GetSettings() const { - return GetImplementation( *this ).GetUrl(); + return GetImplementation( *this ).GetSettings(); } -void WebEngine::LoadHTMLString( const std::string& htmlString ) +Dali::WebEngineContext& WebEngine::GetContext() const { - GetImplementation( *this ).LoadHTMLString( htmlString ); + return GetImplementation( *this ).GetContext(); } -void WebEngine::Reload() +Dali::WebEngineCookieManager& WebEngine::GetCookieManager() const { - GetImplementation( *this ).Reload(); + return GetImplementation( *this ).GetCookieManager(); } -void WebEngine::StopLoading() +Dali::WebEngineBackForwardList& WebEngine::GetBackForwardList() const { - GetImplementation( *this ).StopLoading(); + return GetImplementation( *this ).GetBackForwardList(); } -void WebEngine::Suspend() +void WebEngine::LoadUrl(const std::string& url) { - GetImplementation( *this ).Suspend(); + return GetImplementation(*this).LoadUrl(url); } -void WebEngine::Resume() +std::string WebEngine::GetTitle() const { - GetImplementation( *this ).Resume(); + return GetImplementation( *this ).GetTitle(); } -bool WebEngine::CanGoForward() +Dali::PixelData WebEngine::GetFavicon() const { - return GetImplementation( *this ).CanGoForward(); + return GetImplementation( *this ).GetFavicon(); } -void WebEngine::GoForward() +const std::string& WebEngine::GetUrl() { - GetImplementation( *this ).GoForward(); + return GetImplementation(*this).GetUrl(); } -bool WebEngine::CanGoBack() +void WebEngine::LoadHtmlString(const std::string& htmlString) { - return GetImplementation( *this ).CanGoBack(); + GetImplementation(*this).LoadHtmlString(htmlString); } -void WebEngine::GoBack() +void WebEngine::Reload() { - GetImplementation( *this ).GoBack(); + GetImplementation(*this).Reload(); } -void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler ) +void WebEngine::StopLoading() { - GetImplementation( *this ).EvaluateJavaScript( script, resultHandler ); + GetImplementation(*this).StopLoading(); } -void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler ) +void WebEngine::Suspend() { - GetImplementation( *this ).AddJavaScriptMessageHandler( exposedObjectName, handler ); + GetImplementation(*this).Suspend(); } -void WebEngine::ClearHistory() +void WebEngine::Resume() { - return GetImplementation( *this ).ClearHistory(); + GetImplementation(*this).Resume(); } -void WebEngine::ClearCache() +void WebEngine::ScrollBy( int deltaX, int deltaY ) { - return GetImplementation( *this ).ClearCache(); + GetImplementation( *this ).ScrollBy( deltaX, deltaY ); } -void WebEngine::ClearCookies() +void WebEngine::SetScrollPosition( int x, int y ) { - return GetImplementation( *this ).ClearCookies(); + GetImplementation( *this ).SetScrollPosition( x, y ); } -Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const +void WebEngine::GetScrollPosition( int& x, int& y ) const { - return GetImplementation( *this ).GetCacheModel(); + GetImplementation( *this ).GetScrollPosition( x, y ); } -void WebEngine::SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel ) +void WebEngine::GetScrollSize( int& width, int& height ) const { - GetImplementation( *this ).SetCacheModel( cacheModel ); + GetImplementation( *this ).GetScrollSize( width, height ); } -Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const +void WebEngine::GetContentSize( int& width, int& height ) const { - return GetImplementation( *this ).GetCookieAcceptPolicy(); + GetImplementation( *this ).GetContentSize( width, height ); } -void WebEngine::SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy ) +bool WebEngine::CanGoForward() { - GetImplementation( *this ).SetCookieAcceptPolicy( policy ); + return GetImplementation(*this).CanGoForward(); } -const std::string& WebEngine::GetUserAgent() const +void WebEngine::GoForward() { - return GetImplementation( *this ).GetUserAgent(); + GetImplementation(*this).GoForward(); } -void WebEngine::SetUserAgent( const std::string& userAgent ) +bool WebEngine::CanGoBack() { - GetImplementation( *this ).SetUserAgent( userAgent ); + return GetImplementation(*this).CanGoBack(); } -bool WebEngine::IsJavaScriptEnabled() const +void WebEngine::GoBack() { - return GetImplementation( *this ).IsJavaScriptEnabled(); + GetImplementation(*this).GoBack(); } -void WebEngine::EnableJavaScript( bool enabled ) +void WebEngine::EvaluateJavaScript(const std::string& script, std::function resultHandler) { - GetImplementation( *this ).EnableJavaScript( enabled ); + GetImplementation(*this).EvaluateJavaScript(script, resultHandler); } -bool WebEngine::AreImagesAutomaticallyLoaded() const +void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler) { - return GetImplementation( *this ).AreImagesAutomaticallyLoaded(); + GetImplementation(*this).AddJavaScriptMessageHandler(exposedObjectName, handler); } -void WebEngine::LoadImagesAutomatically( bool automatic ) +void WebEngine::ClearAllTilesResources() { - GetImplementation( *this ).LoadImagesAutomatically( automatic ); + GetImplementation( *this ).ClearAllTilesResources(); } -const std::string& WebEngine::GetDefaultTextEncodingName() const +void WebEngine::ClearHistory() { - return GetImplementation( *this ).GetDefaultTextEncodingName(); + return GetImplementation(*this).ClearHistory(); } -void WebEngine::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ) +const std::string& WebEngine::GetUserAgent() const { - GetImplementation( *this ).SetDefaultTextEncodingName( defaultTextEncodingName ); + return GetImplementation(*this).GetUserAgent(); } -int WebEngine::GetDefaultFontSize() const +void WebEngine::SetUserAgent(const std::string& userAgent) { - return GetImplementation( *this ).GetDefaultFontSize(); + GetImplementation(*this).SetUserAgent(userAgent); } -void WebEngine::SetDefaultFontSize( int defaultFontSize ) +void WebEngine::SetSize(int width, int height) { - GetImplementation( *this ).SetDefaultFontSize( defaultFontSize ); + return GetImplementation(*this).SetSize(width, height); } -void WebEngine::SetSize( int width, int height ) +bool WebEngine::SendTouchEvent(const TouchEvent& touch) { - return GetImplementation( *this ).SetSize( width, height ); + return GetImplementation(*this).SendTouchEvent(touch); } -bool WebEngine::SendTouchEvent( const TouchData& touch ) +bool WebEngine::SendKeyEvent(const KeyEvent& event) { - return GetImplementation( *this ).SendTouchEvent( touch ); + return GetImplementation(*this).SendKeyEvent(event); } -bool WebEngine::SendKeyEvent( const KeyEvent& event ) +void WebEngine::SetFocus( bool focused ) { - return GetImplementation( *this ).SendKeyEvent( event ); + GetImplementation( *this ).SetFocus( focused ); } Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal() { - return GetImplementation( *this ).PageLoadStartedSignal(); + return GetImplementation(*this).PageLoadStartedSignal(); } Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal() { - return GetImplementation( *this ).PageLoadFinishedSignal(); + return GetImplementation(*this).PageLoadFinishedSignal(); } Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal() { - return GetImplementation( *this ).PageLoadErrorSignal(); + return GetImplementation(*this).PageLoadErrorSignal(); } -} // namespace Dali; +Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal() +{ + return GetImplementation( *this ).ScrollEdgeReachedSignal(); +} +} // namespace Dali