X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Fweb-view%2Fweb-view.h;h=2bb556e66aa9727727eab6c788465935a12892ca;hp=48e57cecd435d5d3e59911c905a8f6feaf7aad60;hb=3890e8d5e0d6c13b7a20538b0de12125946f6d87;hpb=893ca7b6b58b59ed4671daf867c4a319d8c9a770 diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.h b/dali-toolkit/devel-api/controls/web-view/web-view.h index 48e57ce..2bb556e 100755 --- a/dali-toolkit/devel-api/controls/web-view/web-view.h +++ b/dali-toolkit/devel-api/controls/web-view/web-view.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_WEB_VIEW_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. @@ -22,8 +22,8 @@ #include // INTERNAL INCLUDES -#include #include +#include namespace Dali { @@ -56,7 +56,6 @@ class WebView; class DALI_TOOLKIT_API WebView : public Control { public: - /** * @brief Enumeration for the start and end property ranges for this control. */ @@ -118,6 +117,51 @@ public: * @note The value is read-only. */ VIDEO_HOLE_ENABLED, + + /** + * @brief Whether mouse event is enabled. + * @details name "mouseEventsEnabled", type Property::BOOLEAN. + * @note Default is true. + */ + MOUSE_EVENTS_ENABLED, + + /** + * @brief Whether key event is enabled. + * @details name "keyEventsEnabled", type Property::BOOLEAN. + * @note Default is true. + */ + KEY_EVENTS_ENABLED, + + /** + * @brief The background color of web page. + * @details name "documentBackgroundColor", type Property::VECTOR4. + */ + DOCUMENT_BACKGROUND_COLOR, + + /** + * @brief Whether tiles can be cleared or not when hidden. + * @details name "tilesClearedWhenHidden", type BOOLEAN. + */ + TILES_CLEARED_WHEN_HIDDEN, + + /** + * @brief The multiplier of cover area of tile when rendering web page. + * @details name "tileCoverAreaMultiplier", type FLOAT. + */ + TILE_COVER_AREA_MULTIPLIER, + + /** + * @brief Whether cursor is enabled or not by client. + * @details name "cursorEnabledByClient", type BOOLEAN. + */ + CURSOR_ENABLED_BY_CLIENT, + + /** + * @brief The selected text of web page. + * @details name "selectedText", type Property::STRING. + * @note The value is read-only. + */ + SELECTED_TEXT, }; }; @@ -126,37 +170,42 @@ public: */ enum class LoadErrorCode { - UNKNOWN = 0, ///< Unknown. - CANCELED, ///< User canceled. - CANT_SUPPORT_MIMETYPE, ///< Can't show the page for this MIME type. - FAILED_FILE_IO, ///< File IO error. - CANT_CONNECT, ///< Cannot connect to the network. - CANT_LOOKUP_HOST, ///< Fail to look up host from the DNS. - FAILED_TLS_HANDSHAKE, ///< Fail to SSL/TLS handshake. - INVALID_CERTIFICATE, ///< Received certificate is invalid. - REQUEST_TIMEOUT, ///< Connection timeout. - TOO_MANY_REDIRECTS, ///< Too many redirects. - TOO_MANY_REQUESTS, ///< Too many requests during this load. - BAD_URL, ///< Malformed URL. - UNSUPPORTED_SCHEME, ///< Unsupported scheme. - AUTHENTICATION, ///< User authentication failed on the server. - INTERNAL_SERVER ///< Web server has an internal server error. + UNKNOWN = 0, ///< Unknown. + CANCELED, ///< User canceled. + CANT_SUPPORT_MIMETYPE, ///< Can't show the page for this MIME type. + FAILED_FILE_IO, ///< File IO error. + CANT_CONNECT, ///< Cannot connect to the network. + CANT_LOOKUP_HOST, ///< Fail to look up host from the DNS. + FAILED_TLS_HANDSHAKE, ///< Fail to SSL/TLS handshake. + INVALID_CERTIFICATE, ///< Received certificate is invalid. + REQUEST_TIMEOUT, ///< Connection timeout. + TOO_MANY_REDIRECTS, ///< Too many redirects. + TOO_MANY_REQUESTS, ///< Too many requests during this load. + BAD_URL, ///< Malformed URL. + UNSUPPORTED_SCHEME, ///< Unsupported scheme. + AUTHENTICATION, ///< User authentication failed on the server. + INTERNAL_SERVER ///< Web server has an internal server error. }; /** * @brief WebView signal type related with page loading. */ - using WebViewPageLoadSignalType = Signal< void( WebView, const std::string& ) >; + using WebViewPageLoadSignalType = Signal; /** * @brief WebView signal type related with page loading error. */ - using WebViewPageLoadErrorSignalType = Signal< void( WebView, const std::string&, LoadErrorCode ) >; + using WebViewPageLoadErrorSignalType = Signal; /** * @brief WebView signal type related with scroll edge reached. */ - using WebViewScrollEdgeReachedSignalType = Signal< void( WebView, Dali::WebEnginePlugin::ScrollEdge ) >; + using WebViewScrollEdgeReachedSignalType = Signal; + + /** + * @brief WebView signal type related with url changed. + */ + using WebViewUrlChangedSignalType = Signal; public: /** @@ -181,7 +230,7 @@ public: * @param [in] argc The count of arguments of Applications * @param [in] argv The string array of arguments of Applications */ - static WebView New( int argc, char** argv ); + static WebView New(int argc, char** argv); /** * @brief Creates an uninitialized WebView. @@ -287,7 +336,7 @@ public: * @param[in] deltaX The delta x of scroll * @param[in] deltaY The delta y of scroll */ - void ScrollBy( int deltaX, int deltaY ); + void ScrollBy(int deltaX, int deltaY); /** * @brief Returns whether forward is possible. @@ -355,9 +404,42 @@ public: void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler); /** - * @brief Clears all tiles resources of Web. + * @brief Register alert callback for javascript. + * + * @param[in] callback The callback function to be called by the JavaScript runtime. */ - void ClearAllTilesResources(); + void RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback); + + /** + * @brief Reply for JavaScript alert. + */ + void JavaScriptAlertReply(); + + /** + * @brief Register confirm callback for javascript. + * + * @param[in] callback The callback function to be called by the JavaScript runtime. + */ + void RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback); + + /** + * @brief Reply for JavaScript confirm. + * @param[in] confirmed True if confirmed, false otherwise + */ + void JavaScriptConfirmReply(bool confirmed); + + /** + * @brief Register prompt callback for javascript. + * + * @param[in] callback The callback function to be called by the JavaScript runtime. + */ + void RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback); + + /** + * @brief Reply for JavaScript prompt. + * @param[in] result The result from input-field of prompt popup. + */ + void JavaScriptPromptReply(const std::string& result); /** * @brief Clears the history of Web. @@ -365,6 +447,11 @@ public: void ClearHistory(); /** + * @brief Clears all tiles resources of Web. + */ + void ClearAllTilesResources(); + + /** * @brief Connects to this signal to be notified when page loading is started. * * @return A signal object to connect with @@ -372,6 +459,13 @@ public: WebViewPageLoadSignalType& PageLoadStartedSignal(); /** + * @brief Connects to this signal to be notified when page loading is in progress. + * + * @return A signal object to connect with. + */ + WebViewPageLoadSignalType& PageLoadInProgressSignal(); + + /** * @brief Connects to this signal to be notified when page loading is finished. * * @return A signal object to connect with @@ -392,6 +486,13 @@ public: */ WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal(); + /** + * @brief Connects to this signal to be notified when url is changed. + * + * @return A signal object to connect with. + */ + WebViewUrlChangedSignalType& UrlChangedSignal(); + public: // Not intended for application developers /// @cond internal /**