{
public:
- typedef Signal< void( const std::string& ) > WebEngineSignalType;
+ /**
+ * @brief WebEngine signal type related with page loading.
+ */
+ typedef Signal< void( const std::string& ) > WebEnginePageLoadSignalType;
+
+ /**
+ * @brief WebView signal type related with page loading error.
+ */
+ typedef Signal< void( const std::string&, int ) > WebEnginePageLoadErrorSignalType;
+
+ /**
+ * @brief Enumeration for cache model options.
+ */
+ enum class CacheModel
+ {
+ /**
+ * @brief Use the smallest cache capacity.
+ */
+ DOCUMENT_VIEWER,
+
+ /**
+ * @brief Use the bigger cache capacity than DocumentBrowser.
+ */
+ DOCUMENT_BROWSER,
+
+ /**
+ * @brief Use the biggest cache capacity.
+ */
+ PRIMARY_WEB_BROWSER
+ };
+
+ /**
+ * @brief Enumeration for the cookies accept policies.
+ */
+ enum class CookieAcceptPolicy
+ {
+ /**
+ * @brief Accepts every cookie sent from any page.
+ */
+ ALWAYS,
+
+ /**
+ * @brief Rejects all the cookies.
+ */
+ NEVER,
+
+ /**
+ * @brief Accepts only cookies set by the main document that is loaded.
+ */
+ NO_THIRD_PARTY
+ };
/**
* @brief Constructor.
virtual void StopLoading() = 0;
/**
+ * @brief Suspends the operation associated with the view.
+ */
+ virtual void Suspend() = 0;
+
+ /**
+ * @brief Resumes the operation associated with the view object after calling Suspend().
+ */
+ virtual void Resume() = 0;
+
+ /**
* @brief Returns whether forward is possible.
*
* @return True if forward is possible, false otherwise
* @brief Evaluates JavaScript code represented as a string.
*
* @param[in] script The JavaScript code
+ * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
*/
- virtual void EvaluateJavaScript( const std::string& script ) = 0;
+ virtual void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler ) = 0;
/**
* @brief Add a message handler into JavaScript.
virtual void ClearCache() = 0;
/**
+ * @brief Clears all the cookies of Web.
+ */
+ virtual void ClearCookies() = 0;
+
+ /**
+ * @brief Get cache model option. The default is DOCUMENT_VIEWER.
+ *
+ * @return The cache model option
+ */
+ virtual CacheModel GetCacheModel() const = 0;
+
+ /**
+ * @brief Set cache model option. The default is DOCUMENT_VIEWER.
+ *
+ * @param[in] cacheModel The cache model option
+ */
+ virtual void SetCacheModel( CacheModel cacheModel ) = 0;
+
+ /**
+ * @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+ *
+ * @return The cookie acceptance policy
+ */
+ virtual CookieAcceptPolicy GetCookieAcceptPolicy() const = 0;
+
+ /**
+ * @brief Sets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+ *
+ * @param[in] policy The cookie acceptance policy
+ */
+ virtual void SetCookieAcceptPolicy( CookieAcceptPolicy policy ) = 0;
+
+ /**
+ * @brief Get user agent string.
+ *
+ * @return The string value of user agent
+ */
+ virtual const std::string& GetUserAgent() const = 0;
+
+ /**
+ * @brief Set user agent string.
+ *
+ * @param[in] userAgent The string value of user agent
+ */
+ virtual void SetUserAgent( const std::string& userAgent ) = 0;
+
+ /**
+ * @brief Returns whether JavaScript can be executable. The default is true.
+ *
+ * @return true if JavaScript executing is enabled, false otherwise
+ */
+ virtual bool IsJavaScriptEnabled() const = 0;
+
+ /**
+ * @brief Enables/disables JavaScript executing. The default is enabled.
+ *
+ * @param[in] enabled True if JavaScript executing is enabled, false otherwise
+ */
+ virtual void EnableJavaScript( bool enabled ) = 0;
+
+ /**
+ * @brief Returns whether images can be loaded automatically. The default is true.
+ *
+ * @return true if images are loaded automatically, false otherwise
+ */
+ virtual bool AreImagesAutomaticallyLoaded() const = 0;
+
+ /**
+ * @brief Enables/disables auto loading of images. The default is enabled.
+ *
+ * @param[in] automatic True if images are loaded automatically, false otherwise
+ */
+ virtual void LoadImagesAutomatically( bool automatic ) = 0;
+
+ /**
+ * @brief Gets the default text encoding name (e.g. UTF-8).
+ *
+ * @return The default text encoding name
+ */
+ virtual const std::string& GetDefaultTextEncodingName() const = 0;
+
+ /**
+ * @brief Sets the default text encoding name (e.g. UTF-8).
+ *
+ * @param[in] defaultTextEncodingName The default text encoding name
+ */
+ virtual void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ) = 0;
+
+ /**
+ * @brief Returns the default font size in pixel. The default value is 16.
+ *
+ * @return The default font size
+ */
+ virtual int GetDefaultFontSize() const = 0;
+
+ /**
+ * @brief Sets the default font size in pixel. The default value is 16.
+ *
+ * @param[in] defaultFontSize A new default font size to set
+ */
+ virtual void SetDefaultFontSize( int defaultFontSize ) = 0;
+
+ /**
* @brief Sets size of Web Page.
*/
virtual void SetSize( int width, int height ) = 0;
*
* @return A signal object to connect with.
*/
- virtual WebEngineSignalType& PageLoadStartedSignal() = 0;
+ virtual WebEnginePageLoadSignalType& PageLoadStartedSignal() = 0;
/**
* @brief Connects to this signal to be notified when page loading is finished.
*
* @return A signal object to connect with.
*/
- virtual WebEngineSignalType& PageLoadFinishedSignal() = 0;
+ virtual WebEnginePageLoadSignalType& PageLoadFinishedSignal() = 0;
+
+ /**
+ * @brief Connects to this signal to be notified when an error occurs in page loading.
+ *
+ * @return A signal object to connect with.
+ */
+ virtual WebEnginePageLoadErrorSignalType& PageLoadErrorSignal() = 0;
};
GetImplementation( *this ).StopLoading();
}
+void WebEngine::Suspend()
+{
+ GetImplementation( *this ).Suspend();
+}
+
+void WebEngine::Resume()
+{
+ GetImplementation( *this ).Resume();
+}
+
bool WebEngine::CanGoForward()
{
return GetImplementation( *this ).CanGoForward();
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::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
return GetImplementation( *this ).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 )
+{
+ GetImplementation( *this ).SetUserAgent( userAgent );
+}
+
+bool WebEngine::IsJavaScriptEnabled() const
+{
+ return GetImplementation( *this ).IsJavaScriptEnabled();
+}
+
+void WebEngine::EnableJavaScript( bool enabled )
+{
+ GetImplementation( *this ).EnableJavaScript( enabled );
+}
+
+bool WebEngine::AreImagesAutomaticallyLoaded() const
+{
+ return GetImplementation( *this ).AreImagesAutomaticallyLoaded();
+}
+
+void WebEngine::LoadImagesAutomatically( bool automatic )
+{
+ GetImplementation( *this ).LoadImagesAutomatically( automatic );
+}
+
+const std::string& WebEngine::GetDefaultTextEncodingName() const
+{
+ return GetImplementation( *this ).GetDefaultTextEncodingName();
+}
+
+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 );
return GetImplementation( *this ).SendKeyEvent( event );
}
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadStartedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
{
return GetImplementation( *this ).PageLoadStartedSignal();
}
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadFinishedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
{
return GetImplementation( *this ).PageLoadFinishedSignal();
}
+Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
+{
+ return GetImplementation( *this ).PageLoadErrorSignal();
+}
+
} // namespace Dali;
void StopLoading();
/**
+ * @brief Suspends the operation associated with the view.
+ */
+ void Suspend();
+
+ /**
+ * @brief Resumes the operation associated with the view object after calling Suspend().
+ */
+ void Resume();
+
+ /**
* @brief Returns whether forward is possible.
*
* @return True if forward is possible, false otherwise
* @brief Evaluates JavaScript code represented as a string.
*
* @param[in] script The JavaScript code
+ * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
*/
- void EvaluateJavaScript( const std::string& script );
+ void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler );
/**
* @brief Add a message handler into JavaScript.
void ClearCache();
/**
+ * @brief Clears all the cookies of Web.
+ */
+ void ClearCookies();
+
+ /**
+ * @brief Get cache model option. The default is DOCUMENT_VIEWER.
+ *
+ * @return The cache model option
+ */
+ Dali::WebEnginePlugin::CacheModel GetCacheModel() const;
+
+ /**
+ * @brief Set cache model option. The default is DOCUMENT_VIEWER.
+ *
+ * @param[in] cacheModel The cache model option
+ */
+ void SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel );
+
+ /**
+ * @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+ *
+ * @return The cookie acceptance policy
+ */
+ Dali::WebEnginePlugin::CookieAcceptPolicy GetCookieAcceptPolicy() const;
+
+ /**
+ * @brief Sets the cookie acceptance policy. The default is NO_THIRD_PARTY.
+ *
+ * @param[in] policy The cookie acceptance policy
+ */
+ void SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy );
+
+ /**
+ * @brief Get user agent string.
+ *
+ * @return The string value of user agent
+ */
+ const std::string& GetUserAgent() const;
+
+ /**
+ * @brief Set user agent string.
+ *
+ * @param[in] userAgent The string value of user agent
+ */
+ void SetUserAgent( const std::string& userAgent );
+
+ /**
+ * @brief Returns whether JavaScript can be executable. The default is true.
+ *
+ * @return true if JavaScript executing is enabled, false otherwise
+ */
+ bool IsJavaScriptEnabled() const;
+
+ /**
+ * @brief Enables/disables JavaScript executing. The default is enabled.
+ *
+ * @param[in] enabled True if JavaScript executing is enabled, false otherwise
+ */
+ void EnableJavaScript( bool enabled );
+
+ /**
+ * @brief Returns whether JavaScript can be executable. The default is true.
+ *
+ * @return true if images are loaded automatically, false otherwise
+ */
+ bool AreImagesAutomaticallyLoaded() const;
+
+ /**
+ * @brief Enables/disables auto loading of images. The default is enabled.
+ *
+ * @param[in] automatic True if images are loaded automatically, false otherwise
+ */
+ void LoadImagesAutomatically( bool automatic );
+
+ /**
+ * @brief Gets the default text encoding name.
+ *
+ * @return The default text encoding name
+ */
+ const std::string& GetDefaultTextEncodingName() const;
+
+ /**
+ * @brief Sets the default text encoding name.
+ *
+ * @param[in] defaultTextEncodingName The default text encoding name
+ */
+ void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName );
+
+ /**
+ * @brief Returns the default font size in pixel. The default value is 16.
+ *
+ * @return The default font size
+ */
+ int GetDefaultFontSize() const;
+
+ /**
+ * @brief Sets the default font size in pixel. The default value is 16.
+ *
+ * @param[in] defaultFontSize A new default font size to set
+ */
+ void SetDefaultFontSize( int defaultFontSize );
+
+ /**
* @brief Sets the size of Web Pages.
*/
void SetSize( int width, int height );
*
* @return A signal object to connect with.
*/
- Dali::WebEnginePlugin::WebEngineSignalType& PageLoadStartedSignal();
+ Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal();
/**
* @brief Connects to this signal to be notified when page loading is finished.
*
* @return A signal object to connect with.
*/
- Dali::WebEnginePlugin::WebEngineSignalType& PageLoadFinishedSignal();
+ Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when an error occurs in page loading.
+ *
+ * @return A signal object to connect with.
+ */
+ Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
private: // Not intended for application developers
WebEnginePtr WebEngine::New()
{
- WebEnginePtr ptr;
- WebEngine* engine = new WebEngine();
+ WebEngine* instance = new WebEngine();
- if ( !engine->Initialize() )
+ if( !instance->Initialize() )
{
- delete engine;
- engine = nullptr;
+ delete instance;
+ return nullptr;
}
- ptr = engine;
- return ptr;
+ return instance;
}
WebEngine::WebEngine()
bool WebEngine::InitializePluginHandle()
{
- if ( pluginName.length() == 0 )
+ if( pluginName.length() == 0 )
{
// pluginName is not initialized yet.
const char* name = EnvironmentVariable::GetEnvironmentVariable( DALI_ENV_WEB_ENGINE_NAME );
- if ( name )
+ if( name )
{
pluginName = MakePluginName( name );
mHandle = dlopen( pluginName.c_str(), RTLD_LAZY );
- if ( mHandle )
+ if( mHandle )
{
return true;
}
}
mHandle = dlopen( pluginName.c_str(), RTLD_LAZY );
- if ( !mHandle )
+ if( !mHandle )
{
DALI_LOG_ERROR( "Can't load %s : %s\n", pluginName.c_str(), dlerror() );
return false;
{
char* error = NULL;
- if ( !InitializePluginHandle() )
+ if( !InitializePluginHandle() )
{
return false;
}
return false;
}
- mPlugin = mCreateWebEnginePtr();
+ mDestroyWebEnginePtr = reinterpret_cast< DestroyWebEngineFunction >( dlsym( mHandle, "DestroyWebEnginePlugin" ) );
- if( mPlugin == NULL )
+ if( mDestroyWebEnginePtr == NULL )
{
- DALI_LOG_ERROR( "Can't create the WebEnginePlugin object\n" );
+ DALI_LOG_ERROR( "Can't load symbol DestroyWebEnginePlugin(), error: %s\n", error );
return false;
}
- mDestroyWebEnginePtr = reinterpret_cast< DestroyWebEngineFunction >( dlsym( mHandle, "DestroyWebEnginePlugin" ) );
+ mPlugin = mCreateWebEnginePtr();
- if( mDestroyWebEnginePtr == NULL )
+ if( mPlugin == NULL )
{
-
- DALI_LOG_ERROR( "Can't load symbol DestroyWebEnginePlugin(), error: %s\n", error );
+ DALI_LOG_ERROR( "Can't create the WebEnginePlugin object\n" );
return false;
}
void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId )
{
- if( mPlugin != NULL )
- {
- mPlugin->Create( width, height, locale, timezoneId );
- }
+ mPlugin->Create( width, height, locale, timezoneId );
}
void WebEngine::Destroy()
{
- if( mPlugin != NULL )
- {
- mPlugin->Destroy();
- }
+ mPlugin->Destroy();
}
Dali::NativeImageInterfacePtr WebEngine::GetNativeImageSource()
void WebEngine::LoadUrl( const std::string& url )
{
- if( mPlugin != NULL )
- {
- mPlugin->LoadUrl( url );
- }
+ mPlugin->LoadUrl( url );
}
const std::string& WebEngine::GetUrl()
{
- static std::string emptyUrl;
- return mPlugin ? mPlugin->GetUrl() : emptyUrl;
+ return mPlugin->GetUrl();
}
void WebEngine::LoadHTMLString( const std::string& htmlString )
{
- if( mPlugin != NULL )
- {
- mPlugin->LoadHTMLString( htmlString );
- }
+ mPlugin->LoadHTMLString( htmlString );
}
void WebEngine::Reload()
{
- if( mPlugin != NULL )
- {
- mPlugin->Reload();
- }
+ mPlugin->Reload();
}
void WebEngine::StopLoading()
{
- if( mPlugin != NULL )
- {
- mPlugin->StopLoading();
- }
+ mPlugin->StopLoading();
+}
+
+void WebEngine::Suspend()
+{
+ mPlugin->Suspend();
+}
+
+void WebEngine::Resume()
+{
+ mPlugin->Resume();
}
bool WebEngine::CanGoForward()
{
- return mPlugin ? mPlugin->CanGoForward() : false;
+ return mPlugin->CanGoForward();
}
void WebEngine::GoForward()
{
- if( mPlugin != NULL )
- {
- mPlugin->GoForward();
- }
+ mPlugin->GoForward();
}
bool WebEngine::CanGoBack()
{
- return mPlugin ? mPlugin->CanGoBack() : false;
+ return mPlugin->CanGoBack();
}
void WebEngine::GoBack()
{
- if( mPlugin != NULL )
- {
- mPlugin->GoBack();
- }
+ mPlugin->GoBack();
}
-void WebEngine::EvaluateJavaScript( const std::string& script )
+void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
{
- if( mPlugin != NULL )
- {
- mPlugin->EvaluateJavaScript( script );
- }
+ mPlugin->EvaluateJavaScript( script, resultHandler );
}
void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void(const std::string&) > handler )
{
- if( mPlugin != NULL )
- {
- mPlugin->AddJavaScriptMessageHandler( exposedObjectName, handler );
- }
+ mPlugin->AddJavaScriptMessageHandler( exposedObjectName, handler );
}
void WebEngine::ClearHistory()
{
- if( mPlugin != NULL )
- {
- mPlugin->ClearHistory();
- }
+ mPlugin->ClearHistory();
}
void WebEngine::ClearCache()
{
- if( mPlugin != NULL )
- {
- mPlugin->ClearCache();
- }
+ mPlugin->ClearCache();
+}
+
+void WebEngine::ClearCookies()
+{
+ mPlugin->ClearCookies();
+}
+
+Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const
+{
+ return mPlugin->GetCacheModel();
+}
+
+void WebEngine::SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel )
+{
+ mPlugin->SetCacheModel( cacheModel );
+}
+
+Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const
+{
+ return mPlugin->GetCookieAcceptPolicy();
+}
+
+void WebEngine::SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy )
+{
+ mPlugin->SetCookieAcceptPolicy( policy );
+}
+
+const std::string& WebEngine::GetUserAgent() const
+{
+ return mPlugin->GetUserAgent();
+}
+
+void WebEngine::SetUserAgent( const std::string& userAgent )
+{
+ mPlugin->SetUserAgent( userAgent );
+}
+
+bool WebEngine::IsJavaScriptEnabled() const
+{
+ return mPlugin->IsJavaScriptEnabled();
+}
+
+void WebEngine::EnableJavaScript( bool enabled )
+{
+ mPlugin->EnableJavaScript( enabled );
+}
+
+bool WebEngine::AreImagesAutomaticallyLoaded() const
+{
+ return mPlugin->AreImagesAutomaticallyLoaded();
+}
+
+void WebEngine::LoadImagesAutomatically( bool automatic )
+{
+ mPlugin->LoadImagesAutomatically( automatic );
+}
+
+const std::string& WebEngine::GetDefaultTextEncodingName() const
+{
+ return mPlugin->GetDefaultTextEncodingName();
+}
+
+void WebEngine::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
+{
+ mPlugin->SetDefaultTextEncodingName( defaultTextEncodingName );
+}
+
+int WebEngine::GetDefaultFontSize() const
+{
+ return mPlugin->GetDefaultFontSize();
+}
+
+void WebEngine::SetDefaultFontSize( int defaultFontSize )
+{
+ mPlugin->SetDefaultFontSize( defaultFontSize );
}
void WebEngine::SetSize( int width, int height )
{
- if( mPlugin != NULL )
- {
- mPlugin->SetSize( width, height );
- }
+ mPlugin->SetSize( width, height );
}
bool WebEngine::SendTouchEvent( const Dali::TouchData& touch )
{
- if( mPlugin != NULL )
- {
- return mPlugin->SendTouchEvent( touch );
- }
-
- return false;
+ return mPlugin->SendTouchEvent( touch );
}
bool WebEngine::SendKeyEvent( const Dali::KeyEvent& event )
{
- if( mPlugin != NULL )
- {
- return mPlugin->SendKeyEvent( event );
- }
-
- return false;
+ return mPlugin->SendKeyEvent( event );
}
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadStartedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
{
return mPlugin->PageLoadStartedSignal();
}
-Dali::WebEnginePlugin::WebEngineSignalType& WebEngine::PageLoadFinishedSignal()
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
{
return mPlugin->PageLoadFinishedSignal();
}
+Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
+{
+ return mPlugin->PageLoadErrorSignal();
+}
+
} // namespace Adaptor;
} // namespace Internal;
} // namespace Dali;
void StopLoading();
/**
+ * @copydoc Dali::WebEngine::Suspend()
+ */
+ void Suspend();
+
+ /**
+ * @copydoc Dali::WebEngine::Resume()
+ */
+ void Resume();
+
+ /**
* @copydoc Dali::WebEngine::CanGoForward()
*/
bool CanGoForward();
/**
* @copydoc Dali::WebEngine::EvaluateJavaScript()
*/
- void EvaluateJavaScript( const std::string& script );
+ void EvaluateJavaScript( const std::string& script, std::function< void(const std::string&) > resultHandler );
/**
* @copydoc Dali::WebEngine::AddJavaScriptMessageHandler()
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 );
/**
* @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:
private:
- Dali::WebEnginePlugin* mPlugin; ///< WebEnginePlugin instance
- void* mHandle; ///< Handle for the loaded library
-
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