Implement WebView APIs
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-view.cpp
index 0b3698b..20ae948 100644 (file)
@@ -70,11 +70,6 @@ void WebView::LoadUrl( const std::string& url )
   Dali::Toolkit::GetImpl( *this ).LoadUrl( url );
 }
 
-const std::string& WebView::GetUrl()
-{
-  return Dali::Toolkit::GetImpl( *this ).GetUrl();
-}
-
 void WebView::LoadHTMLString( const std::string& htmlString )
 {
   Dali::Toolkit::GetImpl( *this ).LoadHTMLString( htmlString );
@@ -90,6 +85,16 @@ void WebView::StopLoading()
   Dali::Toolkit::GetImpl( *this ).StopLoading();
 }
 
+void WebView::Suspend()
+{
+  Dali::Toolkit::GetImpl( *this ).Suspend();
+}
+
+void WebView::Resume()
+{
+  Dali::Toolkit::GetImpl( *this ).Resume();
+}
+
 bool WebView::CanGoForward()
 {
   return Dali::Toolkit::GetImpl( *this ).CanGoForward();
@@ -110,19 +115,19 @@ void WebView::GoBack()
   Dali::Toolkit::GetImpl( *this ).GoBack();
 }
 
-void WebView::EvaluateJavaScript( const std::string& script )
+void WebView::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
 {
-  Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script );
+  Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script, resultHandler );
 }
 
-void WebView::AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > callback )
+void WebView::EvaluateJavaScript( const std::string& script )
 {
-  Dali::Toolkit::GetImpl( *this ).AddJavaScriptInterface( exposedObjectName, jsFunctionName, callback );
+  Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script, nullptr );
 }
 
-void WebView::RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName )
+void WebView::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
 {
-  Dali::Toolkit::GetImpl( *this ).RemoveJavascriptInterface( exposedObjectName, jsFunctionName );
+  Dali::Toolkit::GetImpl( *this ).AddJavaScriptMessageHandler( exposedObjectName, handler );
 }
 
 void WebView::ClearHistory()
@@ -135,16 +140,26 @@ void WebView::ClearCache()
   Dali::Toolkit::GetImpl( *this ).ClearCache();
 }
 
-WebView::WebViewSignalType& WebView::PageLoadStartedSignal()
+void WebView::ClearCookies()
+{
+  Dali::Toolkit::GetImpl( *this ).ClearCookies();
+}
+
+WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
 {
   return Dali::Toolkit::GetImpl( *this ).PageLoadStartedSignal();
 }
 
-WebView::WebViewSignalType& WebView::PageLoadFinishedSignal()
+WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
 {
   return Dali::Toolkit::GetImpl( *this ).PageLoadFinishedSignal();
 }
 
+WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).PageLoadErrorSignal();
+}
+
 WebView::WebView( Internal::WebView& implementation )
 : Control( implementation )
 {