[Tizen] Implement WebEngine::GetPlainTextAsynchronously
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine.cpp
old mode 100644 (file)
new mode 100755 (executable)
index b0bb39b..bc2c87f
 #include <dali/devel-api/adaptor-framework/web-engine.h>
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/internal/web-engine/common/web-engine-impl.h>
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/images/pixel-data.h>
+
 namespace Dali
 {
-
 WebEngine::WebEngine()
 {
 }
 
-WebEngine::WebEngine( Internal::Adaptor::WebEngine* internal )
-: BaseHandle( internal )
+WebEngine::WebEngine(Internal::Adaptor::WebEngine* internal)
+: BaseHandle(internal)
 {
 }
 
@@ -41,222 +47,241 @@ 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()));
+}
+
+void WebEngine::Create(int width, int height, const std::string& locale, const std::string& timezoneId)
 {
-  return WebEngine( dynamic_cast< Internal::Adaptor::WebEngine* >( handle.GetObjectPtr() ) );
+  GetImplementation(*this).Create(width, height, locale, timezoneId);
 }
 
-void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId )
+void WebEngine::Create( int width, int height, int argc, char** argv )
 {
-  GetImplementation( *this ).Create( width, height, locale, timezoneId );
+  GetImplementation( *this ).Create( width, height, argc, argv );
 }
 
 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 )
+Dali::WebEngineSettings& WebEngine::GetSettings() const
 {
-  return GetImplementation( *this ).LoadUrl( url );
+  return GetImplementation( *this ).GetSettings();
 }
 
-const std::string& WebEngine::GetUrl()
+Dali::WebEngineContext& WebEngine::GetContext() const
 {
-  return GetImplementation( *this ).GetUrl();
+  return GetImplementation( *this ).GetContext();
 }
 
-void WebEngine::LoadHTMLString( const std::string& htmlString )
+Dali::WebEngineCookieManager& WebEngine::GetCookieManager() const
 {
-  GetImplementation( *this ).LoadHTMLString( htmlString );
+  return GetImplementation( *this ).GetCookieManager();
 }
 
-void WebEngine::Reload()
+Dali::WebEngineBackForwardList& WebEngine::GetBackForwardList() const
 {
-  GetImplementation( *this ).Reload();
+  return GetImplementation( *this ).GetBackForwardList();
 }
 
-void WebEngine::StopLoading()
+void WebEngine::LoadUrl(const std::string& url)
 {
-  GetImplementation( *this ).StopLoading();
+  return GetImplementation(*this).LoadUrl(url);
 }
 
-void WebEngine::Suspend()
+std::string WebEngine::GetTitle() const
 {
-  GetImplementation( *this ).Suspend();
+  return GetImplementation( *this ).GetTitle();
 }
 
-void WebEngine::Resume()
+Dali::PixelData WebEngine::GetFavicon() const
 {
-  GetImplementation( *this ).Resume();
+  return GetImplementation( *this ).GetFavicon();
 }
 
-bool WebEngine::CanGoForward()
+const std::string& WebEngine::GetUrl()
 {
-  return GetImplementation( *this ).CanGoForward();
+  return GetImplementation(*this).GetUrl();
 }
 
-void WebEngine::GoForward()
+void WebEngine::LoadHtmlString(const std::string& htmlString)
 {
-  GetImplementation( *this ).GoForward();
+  GetImplementation(*this).LoadHtmlString(htmlString);
 }
 
-bool WebEngine::CanGoBack()
+void WebEngine::Reload()
 {
-  return GetImplementation( *this ).CanGoBack();
+  GetImplementation(*this).Reload();
 }
 
-void WebEngine::GoBack()
+void WebEngine::StopLoading()
 {
-  GetImplementation( *this ).GoBack();
+  GetImplementation(*this).StopLoading();
 }
 
-void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
+void WebEngine::Suspend()
 {
-  GetImplementation( *this ).EvaluateJavaScript( script, resultHandler );
+  GetImplementation(*this).Suspend();
 }
 
-void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
+void WebEngine::Resume()
 {
-  GetImplementation( *this ).AddJavaScriptMessageHandler( exposedObjectName, handler );
+  GetImplementation(*this).Resume();
 }
 
-void WebEngine::ClearHistory()
+void WebEngine::ScrollBy( int deltaX, int deltaY )
 {
-  return GetImplementation( *this ).ClearHistory();
+  GetImplementation( *this ).ScrollBy( deltaX, deltaY );
 }
 
-void WebEngine::ClearCache()
+void WebEngine::SetScrollPosition( int x, int y )
 {
-  return GetImplementation( *this ).ClearCache();
+  GetImplementation( *this ).SetScrollPosition( x, y );
 }
 
-void WebEngine::ClearCookies()
+void WebEngine::GetScrollPosition( int& x, int& y ) const
 {
-  return GetImplementation( *this ).ClearCookies();
+  GetImplementation( *this ).GetScrollPosition( x, y );
 }
 
-Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const
+void WebEngine::GetScrollSize( int& width, int& height ) const
 {
-  return GetImplementation( *this ).GetCacheModel();
+  GetImplementation( *this ).GetScrollSize( width, height );
 }
 
-void WebEngine::SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel )
+void WebEngine::GetContentSize( int& width, int& height ) const
 {
-  GetImplementation( *this ).SetCacheModel( cacheModel );
+  GetImplementation( *this ).GetContentSize( width, height );
 }
 
-Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const
+bool WebEngine::CanGoForward()
 {
-  return GetImplementation( *this ).GetCookieAcceptPolicy();
+  return GetImplementation(*this).CanGoForward();
 }
 
-void WebEngine::SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy )
+void WebEngine::GoForward()
 {
-  GetImplementation( *this ).SetCookieAcceptPolicy( policy );
+  GetImplementation(*this).GoForward();
 }
 
-const std::string& WebEngine::GetUserAgent() const
+bool WebEngine::CanGoBack()
 {
-  return GetImplementation( *this ).GetUserAgent();
+  return GetImplementation(*this).CanGoBack();
 }
 
-void WebEngine::SetUserAgent( const std::string& userAgent )
+void WebEngine::GoBack()
 {
-  GetImplementation( *this ).SetUserAgent( userAgent );
+  GetImplementation(*this).GoBack();
 }
 
-bool WebEngine::IsJavaScriptEnabled() const
+void WebEngine::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
 {
-  return GetImplementation( *this ).IsJavaScriptEnabled();
+  GetImplementation(*this).EvaluateJavaScript(script, resultHandler);
 }
 
-void WebEngine::EnableJavaScript( bool enabled )
+void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
 {
-  GetImplementation( *this ).EnableJavaScript( enabled );
+  GetImplementation(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
 }
 
-bool WebEngine::AreImagesAutomaticallyLoaded() const
+void WebEngine::ClearAllTilesResources()
 {
-  return GetImplementation( *this ).AreImagesAutomaticallyLoaded();
+  GetImplementation( *this ).ClearAllTilesResources();
 }
 
-void WebEngine::LoadImagesAutomatically( bool automatic )
+void WebEngine::ClearHistory()
 {
-  GetImplementation( *this ).LoadImagesAutomatically( automatic );
+  return GetImplementation(*this).ClearHistory();
 }
 
-const std::string& WebEngine::GetDefaultTextEncodingName() const
+const std::string& WebEngine::GetUserAgent() const
 {
-  return GetImplementation( *this ).GetDefaultTextEncodingName();
+  return GetImplementation(*this).GetUserAgent();
 }
 
-void WebEngine::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
+void WebEngine::SetUserAgent(const std::string& userAgent)
 {
-  GetImplementation( *this ).SetDefaultTextEncodingName( defaultTextEncodingName );
+  GetImplementation(*this).SetUserAgent(userAgent);
 }
 
-int WebEngine::GetDefaultFontSize() const
+void WebEngine::SetSize(int width, int height)
 {
-  return GetImplementation( *this ).GetDefaultFontSize();
+  return GetImplementation(*this).SetSize(width, height);
 }
 
-void WebEngine::SetDefaultFontSize( int defaultFontSize )
+bool WebEngine::SendTouchEvent(const TouchEvent& touch)
 {
-  GetImplementation( *this ).SetDefaultFontSize( defaultFontSize );
+  return GetImplementation(*this).SendTouchEvent(touch);
 }
 
-void WebEngine::SetSize( int width, int height )
+bool WebEngine::SendKeyEvent(const KeyEvent& event)
 {
-  return GetImplementation( *this ).SetSize( width, height );
+  return GetImplementation(*this).SendKeyEvent(event);
 }
 
-bool WebEngine::SendTouchEvent( const TouchEvent& touch )
+void WebEngine::SetFocus( bool focused )
 {
-  return GetImplementation( *this ).SendTouchEvent( touch );
+  GetImplementation( *this ).SetFocus( focused );
 }
 
-bool WebEngine::SendKeyEvent( const KeyEvent& event )
+void WebEngine::UpdateDisplayArea( Dali::Rect< int > displayArea )
 {
-  return GetImplementation( *this ).SendKeyEvent( event );
+  GetImplementation( *this ).UpdateDisplayArea( displayArea );
+}
+
+void WebEngine::EnableVideoHole( bool enabled )
+{
+  GetImplementation( *this ).EnableVideoHole( enabled );
 }
 
 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();
+}
+
+Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal()
+{
+  return GetImplementation( *this ).ScrollEdgeReachedSignal();
 }
 
-} // namespace Dali;
+void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
+{
+  GetImplementation(*this).GetPlainTextAsynchronously(callback);
+}
 
+} // namespace Dali