X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fweb-engine.h;h=e9b604e6acd6d0f34df02d980728df9f317e9297;hb=97beeb72a4a0fe144dc88839a288140679902b2c;hp=12fdf73c033b94bb193a9d2f443a3601b32bc2db;hpb=fadf01debf4e60ce5cd14a60ce08b93c92a66e29;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/web-engine.h b/dali/devel-api/adaptor-framework/web-engine.h index 12fdf73..e9b604e 100644 --- a/dali/devel-api/adaptor-framework/web-engine.h +++ b/dali/devel-api/adaptor-framework/web-engine.h @@ -139,6 +139,16 @@ public: 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 @@ -163,28 +173,20 @@ public: void GoBack(); /** - * @brief Evaluates JavaScript code represented as a string. - * - * @param[in] script The JavaScript code - */ - void EvaluateJavaScript( const std::string& script ); - - /** - * @brief Adds a JavaScript interface. - * - * @param[in] exposedObjectName The name of exposed object - * @param[in] jsFunctionName The name of JavaScript function - * @param[in] cb The callback function - */ - void AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > cb ); + * @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, std::function< void( const std::string& ) > resultHandler ); /** - * @brief Removes a JavaScript interface. - * - * @param[in] exposedObjectName The name of exposed object - * @param[in] jsFunctionName The name of JavaScript function - */ - void RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName ); + * @brief Add a message handler into JavaScript. + * + * @param[in] exposedObjectName The name of exposed object + * @param[in] handler The callback function + */ + void AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler ); /** * @brief Clears the history of Web. @@ -197,6 +199,109 @@ public: 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 ); @@ -216,14 +321,21 @@ public: * * @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