X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fweb-engine%2Fcommon%2Fweb-engine-impl.h;h=a9a9928426bc2547581a9fa106dd18f9c633bdcb;hb=2752db422653b6b949bd7ccf0cb1c5d12325defe;hp=3cb1eb638c27fba75643de7731fd80865ecec6e0;hpb=fadf01debf4e60ce5cd14a60ce08b93c92a66e29;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/web-engine/common/web-engine-impl.h b/dali/internal/web-engine/common/web-engine-impl.h old mode 100644 new mode 100755 index 3cb1eb6..a9a9928 --- a/dali/internal/web-engine/common/web-engine-impl.h +++ b/dali/internal/web-engine/common/web-engine-impl.h @@ -2,7 +2,7 @@ #define DALI_WEB_ENGINE_IMPL_H /* - * 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. @@ -93,6 +93,16 @@ public: void StopLoading(); /** + * @copydoc Dali::WebEngine::Suspend() + */ + void Suspend(); + + /** + * @copydoc Dali::WebEngine::Resume() + */ + void Resume(); + + /** * @copydoc Dali::WebEngine::CanGoForward() */ bool CanGoForward(); @@ -115,17 +125,12 @@ public: /** * @copydoc Dali::WebEngine::EvaluateJavaScript() */ - void EvaluateJavaScript( const std::string& script ); - - /** - * @copydoc Dali::WebEngine::AddJavaScriptInterface() - */ - void AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > cb ); + void EvaluateJavaScript( const std::string& script, std::function< void(const std::string&) > resultHandler ); /** - * @copydoc Dali::WebEngine::RemoveJavascriptInterface() + * @copydoc Dali::WebEngine::AddJavaScriptMessageHandler() */ - void RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName ); + void AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void(const std::string&) > handler ); /** * @copydoc Dali::WebEngine::ClearHistory() @@ -138,6 +143,81 @@ public: void ClearCache(); /** + * @copydoc Dali::WebEngine::ClearCookies() + */ + void ClearCookies(); + + /** + * @copydoc Dali::WebEngine::GetCacheModel() + */ + Dali::WebEnginePlugin::CacheModel GetCacheModel() const; + + /** + * @copydoc Dali::WebEngine::SetCacheModel() + */ + void SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel ); + + /** + * @copydoc Dali::WebEngine::GetCookieAcceptPolicy() + */ + Dali::WebEnginePlugin::CookieAcceptPolicy GetCookieAcceptPolicy() const; + + /** + * @copydoc Dali::WebEngine::SetCookieAcceptPolicy() + */ + void SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy ); + + /** + * @copydoc Dali::WebEngine::GetUserAgent() + */ + const std::string& GetUserAgent() const; + + /** + * @copydoc Dali::WebEngine::SetUserAgent() + */ + void SetUserAgent( const std::string& userAgent ); + + /** + * @copydoc Dali::WebEngine::IsJavaScriptEnabled() + */ + bool IsJavaScriptEnabled() const; + + /** + * @copydoc Dali::WebEngine::EnableJavaScript() + */ + void EnableJavaScript( bool enabled ); + + /** + * @copydoc Dali::WebEngine::AreImagesAutomaticallyLoaded() + */ + bool AreImagesAutomaticallyLoaded() const; + + /** + * @copydoc Dali::WebEngine::LoadImagesAutomatically() + */ + void LoadImagesAutomatically( bool automatic ); + + /** + * @copydoc Dali::WebEngine::GetDefaultTextEncodingName() + */ + const std::string& GetDefaultTextEncodingName() const; + + /** + * @copydoc Dali::WebEngine::SetDefaultTextEncodingName() + */ + void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ); + + /** + * @copydoc Dali::WebEngine::GetDefaultFontSize() + */ + int GetDefaultFontSize() const; + + /** + * @copydoc Dali::WebEngine::SetDefaultFontSize() + */ + void SetDefaultFontSize( int defaultFontSize ); + + /** * @copydoc Dali::WebEngine::SetSize() */ void SetSize( int width, int height ); @@ -145,7 +225,7 @@ public: /** * @copydoc Dali::WebEngine::SendTouchEvent() */ - bool SendTouchEvent( const Dali::TouchData& touch ); + bool SendTouchEvent( const Dali::TouchEvent& touch ); /** * @copydoc Dali::WebEngine::SendKeyEvent() @@ -153,14 +233,24 @@ public: bool SendKeyEvent( const Dali::KeyEvent& event ); /** + * @copydoc Dali::WebEngine::SetFocus() + */ + void SetFocus( bool focused ); + + /** * @copydoc Dali::WebEngine::PageLoadStartedSignal() */ - Dali::WebEnginePlugin::WebEngineSignalType& PageLoadStartedSignal(); + Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal(); /** * @copydoc Dali::WebEngine::PageLoadFinishedSignal() */ - Dali::WebEnginePlugin::WebEngineSignalType& PageLoadFinishedSignal(); + Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal(); + + /** + * @copydoc Dali::WebEngine::PageLoadErrorSignal() + */ + Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal(); private: @@ -187,16 +277,22 @@ private: */ bool Initialize(); -private: + /** + * @brief Initializes library handle by loading web engine plugin. + * + * @return Whether the initialization succeed or not. + */ + bool InitializePluginHandle(); - Dali::WebEnginePlugin* mPlugin; ///< WebEngine plugin handle - void* mHandle; ///< Handle for the loaded library +private: typedef Dali::WebEnginePlugin* (*CreateWebEngineFunction)(); typedef void (*DestroyWebEngineFunction)( Dali::WebEnginePlugin* plugin ); - CreateWebEngineFunction mCreateWebEnginePtr; - DestroyWebEngineFunction mDestroyWebEnginePtr; + Dali::WebEnginePlugin* mPlugin; ///< WebEnginePlugin instance + void* mHandle; ///< Handle for the loaded library + CreateWebEngineFunction mCreateWebEnginePtr; ///< Function to create plugin instance + DestroyWebEngineFunction mDestroyWebEnginePtr; ///< Function to destroy plugin instance }; } // namespace Adaptor