X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fweb-engine-plugin.h;h=9f8a16d94c67c13558ad7449b7e08a6bee1ed5bc;hb=505b58aaff135b12d2575e214b02d469913fa624;hp=215ea0d17c0c4d6a92c916f936102c80b23165d6;hpb=62d7f9db00283d971f7e74ae94d32140518a8e31;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/web-engine-plugin.h b/dali/devel-api/adaptor-framework/web-engine-plugin.h old mode 100644 new mode 100755 index 215ea0d..9f8a16d --- a/dali/devel-api/adaptor-framework/web-engine-plugin.h +++ b/dali/devel-api/adaptor-framework/web-engine-plugin.h @@ -2,7 +2,7 @@ #define DALI_WEB_ENGINE_PLUGIN_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. @@ -20,14 +20,19 @@ // EXTERNAL INCLUDES #include +#include #include #include namespace Dali { - class KeyEvent; -class TouchData; +class PixelData; +class TouchEvent; +class WebEngineBackForwardList; +class WebEngineContext; +class WebEngineCookieManager; +class WebEngineSettings; /** * @brief WebEnginePlugin is an abstract interface, used by dali-adaptor to access WebEngine plugin. @@ -36,22 +41,49 @@ class TouchData; class WebEnginePlugin { public: + /** + * @brief WebEngine signal type related with page loading. + */ + typedef Signal WebEnginePageLoadSignalType; - typedef Signal< void( const std::string& ) > WebEngineSignalType; + /** + * @brief WebView signal type related with page loading error. + */ + typedef Signal WebEnginePageLoadErrorSignalType; + + // forward declaration. + enum class ScrollEdge; /** - * @brief Constructor. + * @brief WebView signal type related with scroll edge reached. + */ + typedef Signal< void( const ScrollEdge )> WebEngineScrollEdgeReachedSignalType; + + /** + * @brief The callback to be called when the web engine received a plain text of current web page. + */ + using PlainTextReceivedCallback = std::function; + + /** + * @brief Enumeration for the scroll edge. */ - WebEnginePlugin() + enum class ScrollEdge { - } + LEFT, ///< Left edge reached. + RIGHT, ///< Right edge reached. + TOP, ///< Top edge reached. + BOTTOM, ///< Bottom edge reached. + }; + + /** + * @brief Constructor. + */ + WebEnginePlugin() = default; /** * @brief Destructor. */ - virtual ~WebEnginePlugin() - { - } + virtual ~WebEnginePlugin() = default; /** * @brief Creates WebEngine instance. @@ -61,7 +93,17 @@ public: * @param [in] locale The locale of Web * @param [in] timezoneId The timezoneID of Web */ - virtual void Create( int width, int height, const std::string& locale, const std::string& timezoneId ) = 0; + virtual void Create(int width, int height, const std::string& locale, const std::string& timezoneId) = 0; + + /** + * @brief Creates WebEngine instance. + * + * @param [in] width The width of Web + * @param [in] height The height of Web + * @param [in] argc The count of application arguments + * @param [in] argv The string array of application arguments + */ + virtual void Create( int width, int height, int argc, char** argv ) = 0; /** * @brief Destroys WebEngine instance. @@ -69,11 +111,45 @@ public: virtual void Destroy() = 0; /** + * @brief Get settings of WebEngine. + */ + virtual WebEngineSettings& GetSettings() const = 0; + + /** + * @brief Get context of WebEngine. + */ + virtual WebEngineContext& GetContext() const = 0; + + /** + * @brief Get cookie manager of WebEngine. + */ + virtual WebEngineCookieManager& GetCookieManager() const = 0; + + /** + * @brief Get back-forward list of WebEngine. + */ + virtual WebEngineBackForwardList& GetBackForwardList() const = 0; + + /** * @brief Loads a web page based on a given URL. * * @param [in] url The URL of the resource to load */ - virtual void LoadUrl( const std::string& url ) = 0; + virtual void LoadUrl(const std::string& url) = 0; + + /** + * @brief Returns the title of the Web. + * + * @return The title of web page + */ + virtual std::string GetTitle() const = 0; + + /** + * @brief Returns the Favicon of the Web. + * + * @return Favicon of Dali::PixelData& type + */ + virtual Dali::PixelData GetFavicon() const = 0; /** * @brief Gets image to render. @@ -92,7 +168,7 @@ public: * * @param [in] htmlString The string to use as the contents of the web page */ - virtual void LoadHTMLString( const std::string& htmlString ) = 0; + virtual void LoadHtmlString(const std::string& htmlString) = 0; /** * @brief Reloads the Web. @@ -105,6 +181,41 @@ public: 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 Scrolls the webpage of view by deltaX and deltaY. + */ + virtual void ScrollBy( int deltaX, int deltaY ) = 0; + + /** + * @brief Scroll to the specified position of the given view. + */ + virtual void SetScrollPosition( int x, int y ) = 0; + + /** + * @brief Gets the current scroll position of the given view. + */ + virtual void GetScrollPosition( int& x, int& y ) const = 0; + + /** + * @brief Gets the possible scroll size of the given view. + */ + virtual void GetScrollSize( int& width, int& height ) const = 0; + + /** + * @brief Gets the last known content's size. + */ + virtual void GetContentSize( int& width, int& height ) const = 0; + + /** * @brief Returns whether forward is possible. * * @return True if forward is possible, false otherwise @@ -129,28 +240,25 @@ public: virtual void GoBack() = 0; /** - * @brief Evaluates JavaScript code represented as a string. - * - * @param[in] script The JavaScript code - */ - virtual void EvaluateJavaScript( const std::string& script ) = 0; + * @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, std::function resultHandler) = 0; /** - * @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 - */ - virtual void AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > cb ) = 0; + * @brief Add a message handler into JavaScript. + * + * @param[in] exposedObjectName The name of exposed object + * @param[in] handler The callback function + */ + virtual void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler) = 0; /** - * @brief Removes a JavaScript interface. - * - * @param[in] exposedObjectName The name of exposed object - * @param[in] jsFunctionName The name of JavaScript function - */ - virtual void RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName ) = 0; + * @brief Clears all tiles resources of Web. + */ + virtual void ClearAllTilesResources() = 0; /** * @brief Clears the history of Web. @@ -158,41 +266,87 @@ public: virtual void ClearHistory() = 0; /** - * @brief Clears the cache of Web. + * @brief Get user agent string. + * + * @return The string value of user agent */ - virtual void ClearCache() = 0; + 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 Sets size of Web Page. */ - virtual void SetSize( int width, int height ) = 0; + virtual void SetSize(int width, int height) = 0; /** * @brief Sends Touch Events. */ - virtual bool SendTouchEvent( const TouchData& touch ) = 0; + virtual bool SendTouchEvent(const TouchEvent& touch) = 0; /** * @brief Sends Key Events. */ - virtual bool SendKeyEvent( const KeyEvent& event ) = 0; + virtual bool SendKeyEvent(const KeyEvent& event) = 0; + + /** + * @brief Sets focus. + */ + virtual void SetFocus( bool focused ) = 0; + + /** + * @brief Update display area. + * @param[in] displayArea The display area need be updated. + */ + virtual void UpdateDisplayArea( Dali::Rect< int > displayArea ) = 0; + + /** + * @brief Enable video hole. + * @param[in] enabled True if enabled, false othewise. + */ + virtual void EnableVideoHole( bool enabled ) = 0; /** * @brief Connects to this signal to be notified when page loading is started. * * @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; + + /** + * @brief Connects to this signal to be notified when scroll edge is reached. + * + * @return A signal object to connect with. + */ + virtual WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal() = 0; + /** + * @brief Get a plain text of current web page asynchronously. + * + * @param[in] callback The callback function called asynchronously. + */ + virtual void GetPlainTextAsynchronously(PlainTextReceivedCallback callback) = 0; }; -} // namespace Dali; +} // namespace Dali #endif