/*
- * 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.
namespace Dali
{
-
WebEngine::WebEngine()
{
}
-WebEngine::WebEngine( Internal::Adaptor::WebEngine* internal )
-: BaseHandle( internal )
+WebEngine::WebEngine(Internal::Adaptor::WebEngine* internal)
+: BaseHandle(internal)
{
}
{
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<Internal::Adaptor::WebEngine*>(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()
{
- GetImplementation( *this ).Destroy();
+ GetImplementation(*this).Destroy();
}
NativeImageInterfacePtr WebEngine::GetNativeImageSource()
{
- return GetImplementation( *this ).GetNativeImageSource();
+ return GetImplementation(*this).GetNativeImageSource();
}
-void WebEngine::LoadUrl( const std::string& url )
+void WebEngine::LoadUrl(const std::string& url)
{
- return GetImplementation( *this ).LoadUrl( url );
+ return GetImplementation(*this).LoadUrl(url);
}
const std::string& WebEngine::GetUrl()
{
- return GetImplementation( *this ).GetUrl();
+ return GetImplementation(*this).GetUrl();
}
-void WebEngine::LoadHTMLString( const std::string& htmlString )
+void WebEngine::LoadHTMLString(const std::string& htmlString)
{
- GetImplementation( *this ).LoadHTMLString( htmlString );
+ GetImplementation(*this).LoadHTMLString(htmlString);
}
void WebEngine::Reload()
{
- GetImplementation( *this ).Reload();
+ GetImplementation(*this).Reload();
}
void WebEngine::StopLoading()
{
- GetImplementation( *this ).StopLoading();
+ GetImplementation(*this).StopLoading();
+}
+
+void WebEngine::Suspend()
+{
+ GetImplementation(*this).Suspend();
+}
+
+void WebEngine::Resume()
+{
+ GetImplementation(*this).Resume();
}
bool WebEngine::CanGoForward()
{
- return GetImplementation( *this ).CanGoForward();
+ return GetImplementation(*this).CanGoForward();
}
void WebEngine::GoForward()
{
- GetImplementation( *this ).GoForward();
+ GetImplementation(*this).GoForward();
}
bool WebEngine::CanGoBack()
{
- return GetImplementation( *this ).CanGoBack();
+ return GetImplementation(*this).CanGoBack();
}
void WebEngine::GoBack()
{
- GetImplementation( *this ).GoBack();
+ GetImplementation(*this).GoBack();
}
-void WebEngine::EvaluateJavaScript( const std::string& script )
+void WebEngine::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
{
- GetImplementation( *this ).EvaluateJavaScript( script );
+ GetImplementation(*this).EvaluateJavaScript(script, resultHandler);
}
-void WebEngine::AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > cb )
+void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
{
- GetImplementation( *this ).AddJavaScriptInterface( exposedObjectName, jsFunctionName, cb );
+ GetImplementation(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
}
-void WebEngine::RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName )
+void WebEngine::ClearHistory()
{
- GetImplementation( *this ).RemoveJavascriptInterface( exposedObjectName, jsFunctionName );
+ return GetImplementation(*this).ClearHistory();
}
-void WebEngine::ClearHistory()
+void WebEngine::ClearCache()
{
- return GetImplementation( *this ).ClearHistory();
+ return GetImplementation(*this).ClearCache();
}
-void WebEngine::ClearCache()
+void WebEngine::ClearCookies()
+{
+ return GetImplementation(*this).ClearCookies();
+}
+
+Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const
+{
+ return GetImplementation(*this).GetCacheModel();
+}
+
+void WebEngine::SetCacheModel(Dali::WebEnginePlugin::CacheModel cacheModel)
+{
+ GetImplementation(*this).SetCacheModel(cacheModel);
+}
+
+Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const
+{
+ return GetImplementation(*this).GetCookieAcceptPolicy();
+}
+
+void WebEngine::SetCookieAcceptPolicy(Dali::WebEnginePlugin::CookieAcceptPolicy policy)
+{
+ GetImplementation(*this).SetCookieAcceptPolicy(policy);
+}
+
+const std::string& WebEngine::GetUserAgent() const
+{
+ return GetImplementation(*this).GetUserAgent();
+}
+
+void WebEngine::SetUserAgent(const std::string& userAgent)
{
- return GetImplementation( *this ).ClearCache();
+ GetImplementation(*this).SetUserAgent(userAgent);
}
-void WebEngine::SetSize( int width, int height )
+bool WebEngine::IsJavaScriptEnabled() const
{
- return GetImplementation( *this ).SetSize( width, height );
+ return GetImplementation(*this).IsJavaScriptEnabled();
}
-bool WebEngine::SendTouchEvent( const TouchData& touch )
+void WebEngine::EnableJavaScript(bool enabled)
{
- return GetImplementation( *this ).SendTouchEvent( touch );
+ GetImplementation(*this).EnableJavaScript(enabled);
}
-bool WebEngine::SendKeyEvent( const KeyEvent& event )
+bool WebEngine::AreImagesAutomaticallyLoaded() const
{
- return GetImplementation( *this ).SendKeyEvent( event );
+ return GetImplementation(*this).AreImagesAutomaticallyLoaded();
}
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadStartedSignal()
+void WebEngine::LoadImagesAutomatically(bool automatic)
{
- return GetImplementation( *this ).PageLoadStartedSignal();
+ GetImplementation(*this).LoadImagesAutomatically(automatic);
}
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadFinishedSignal()
+const std::string& WebEngine::GetDefaultTextEncodingName() const
{
- return GetImplementation( *this ).PageLoadFinishedSignal();
+ return GetImplementation(*this).GetDefaultTextEncodingName();
}
-} // namespace Dali;
+void WebEngine::SetDefaultTextEncodingName(const std::string& defaultTextEncodingName)
+{
+ GetImplementation(*this).SetDefaultTextEncodingName(defaultTextEncodingName);
+}
+
+int WebEngine::GetDefaultFontSize() const
+{
+ return GetImplementation(*this).GetDefaultFontSize();
+}
+
+void WebEngine::SetDefaultFontSize(int defaultFontSize)
+{
+ GetImplementation(*this).SetDefaultFontSize(defaultFontSize);
+}
+
+void WebEngine::SetSize(int width, int height)
+{
+ return GetImplementation(*this).SetSize(width, height);
+}
+
+bool WebEngine::SendTouchEvent(const TouchEvent& touch)
+{
+ return GetImplementation(*this).SendTouchEvent(touch);
+}
+
+bool WebEngine::SendKeyEvent(const KeyEvent& event)
+{
+ return GetImplementation(*this).SendKeyEvent(event);
+}
+
+void WebEngine::SetFocus( bool focused )
+{
+ GetImplementation( *this ).SetFocus( focused );
+}
+
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
+{
+ return GetImplementation(*this).PageLoadStartedSignal();
+}
+
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
+{
+ return GetImplementation(*this).PageLoadFinishedSignal();
+}
+
+Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
+{
+ return GetImplementation(*this).PageLoadErrorSignal();
+}
+} // namespace Dali