X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fweb-engine-plugin.h;h=373b59da7dfb9b2baf92b75ec82bfddb546406b0;hb=72384c0ecf89fb0623ffbc55f49dd6b6b298170b;hp=fbf8d1ce260af5fffbac9c878cba5e977cbd9d3a;hpb=000d9e2ec52d1749d68a11532895db8b3a4544e7;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 100755 new mode 100644 index fbf8d1c..373b59d --- 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) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,12 +20,14 @@ // EXTERNAL INCLUDES #include +#include #include #include namespace Dali { class KeyEvent; +class PixelData; class TouchEvent; class WebEngineBackForwardList; class WebEngineContext; @@ -42,12 +44,12 @@ public: /** * @brief WebEngine signal type related with page loading. */ - typedef Signal WebEnginePageLoadSignalType; + using WebEnginePageLoadSignalType = Signal; /** * @brief WebView signal type related with page loading error. */ - typedef Signal WebEnginePageLoadErrorSignalType; + using WebEnginePageLoadErrorSignalType = Signal; // forward declaration. enum class ScrollEdge; @@ -55,7 +57,31 @@ public: /** * @brief WebView signal type related with scroll edge reached. */ - typedef Signal< void( const ScrollEdge )> WebEngineScrollEdgeReachedSignalType; + using WebEngineScrollEdgeReachedSignalType = Signal; + + /** + * @brief WebView signal type related with page url changed. + */ + using WebEngineUrlChangedSignalType = Signal; + + /** + * @brief Alert callback when JavaScript alert is called with a message. + * It returns true if a pop-up is created successfully, false otherwise. + */ + using JavaScriptAlertCallback = std::function; + + /** + * @brief Confirm callback when JavaScript confirm is called with a message. + * It returns true if a pop-up is created successfully, false otherwise. + */ + using JavaScriptConfirmCallback = std::function; + + /** + * @brief Prompt callback when JavaScript prompt is called with a message + * and an optional value that is the default value for the input field. + * It returns true if a pop-up is created successfully, false otherwise. + */ + using JavaScriptPromptCallback = std::function; /** * @brief Enumeration for the scroll edge. @@ -89,6 +115,16 @@ public: 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. */ virtual void Destroy() = 0; @@ -121,6 +157,20 @@ public: 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. */ virtual NativeImageInterfacePtr GetNativeImageSource() = 0; @@ -162,27 +212,27 @@ public: /** * @brief Scrolls the webpage of view by deltaX and deltaY. */ - virtual void ScrollBy( int deltaX, int deltaY ) = 0; + 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; + 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; + virtual Dali::Vector2 GetScrollPosition() const = 0; /** * @brief Gets the possible scroll size of the given view. */ - virtual void GetScrollSize( int& width, int& height ) const = 0; + virtual Dali::Vector2 GetScrollSize() const = 0; /** * @brief Gets the last known content's size. */ - virtual void GetContentSize( int& width, int& height ) const = 0; + virtual Dali::Vector2 GetContentSize() const = 0; /** * @brief Returns whether forward is possible. @@ -225,11 +275,52 @@ public: virtual void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler) = 0; /** + * @brief Register a callback for JavaScript alert. + * + * @param[in] callback The callback function + */ + virtual void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback) = 0; + + /** + * @brief Reply for JavaScript alert. + */ + virtual void JavaScriptAlertReply() = 0; + + /** + * @brief Register a callback for JavaScript confirm. + * + * @param[in] callback The callback function + */ + virtual void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback) = 0; + + /** + * @brief Reply for JavaScript confirm. + */ + virtual void JavaScriptConfirmReply( bool confirmed ) = 0; + + /** + * @brief Register a callback for JavaScript prompt. + * + * @param[in] callback The callback function + */ + virtual void RegisterJavaScriptPromptCallback( JavaScriptPromptCallback callback ) = 0; + + /** + * @brief Reply for JavaScript prompt. + */ + virtual void JavaScriptPromptReply( const std::string& result ) = 0; + + /** * @brief Clears the history of Web. */ virtual void ClearHistory() = 0; /** + * @brief Clears all tiles resources of Web. + */ + virtual void ClearAllTilesResources() = 0; + + /** * @brief Get user agent string. * * @return The string value of user agent @@ -261,7 +352,19 @@ public: /** * @brief Sets focus. */ - virtual void SetFocus( bool focused ) = 0; + virtual void SetFocus(bool focused) = 0; + + /** + * @brief Update display area. + * @param[in] displayArea The display area need be updated. + */ + virtual void UpdateDisplayArea(Dali::Rect 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. @@ -271,6 +374,13 @@ public: virtual WebEnginePageLoadSignalType& PageLoadStartedSignal() = 0; /** + * @brief Connects to this signal to be notified when page loading is in progress. + * + * @return A signal object to connect with. + */ + virtual WebEnginePageLoadSignalType& PageLoadInProgressSignal() = 0; + + /** * @brief Connects to this signal to be notified when page loading is finished. * * @return A signal object to connect with. @@ -290,6 +400,14 @@ public: * @return A signal object to connect with. */ virtual WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal() = 0; + + /** + * @brief Connects to this signal to be notified when url is changed. + * + * @return A signal object to connect with. + */ + virtual WebEngineUrlChangedSignalType& UrlChangedSignal() = 0; + }; } // namespace Dali