X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fweb-engine.h;h=102ea8c50842b2ecdafd58a19ecf2714618d6a5b;hb=06420ad253d1338ec54947f589c81e6cffcd76ff;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 old mode 100644 new mode 100755 index 12fdf73..102ea8c --- a/dali/devel-api/adaptor-framework/web-engine.h +++ b/dali/devel-api/adaptor-framework/web-engine.h @@ -2,7 +2,7 @@ #define DALI_WEB_ENGINE_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. @@ -27,13 +27,11 @@ namespace Dali { - namespace Internal { - namespace Adaptor { - class WebEngine; +class WebEngine; } // namespace Adaptor } // namespace Internal @@ -47,7 +45,6 @@ namespace Adaptor class DALI_ADAPTOR_API WebEngine : public BaseHandle { public: - /** * @brief Constructor. */ @@ -68,7 +65,7 @@ public: * * @param[in] WebEngine WebEngine to copy. The copied WebEngine will point at the same implementation */ - WebEngine( const WebEngine& WebEngine ); + WebEngine(const WebEngine& WebEngine); /** * @brief Assignment operator. @@ -76,7 +73,7 @@ public: * @param[in] WebEngine The WebEngine to assign from. * @return The updated WebEngine. */ - WebEngine& operator=( const WebEngine& WebEngine ); + WebEngine& operator=(const WebEngine& WebEngine); /** * @brief Downcast a handle to WebEngine handle. @@ -87,7 +84,7 @@ public: * @param[in] handle Handle to an object * @return Handle to a WebEngine or an uninitialized handle */ - static WebEngine DownCast( BaseHandle handle ); + static WebEngine DownCast(BaseHandle handle); /** * @brief Creates WebEngine instance. @@ -97,7 +94,17 @@ public: * @param [in] locale The locale of Web * @param [in] timezoneId The timezoneID of Web */ - void Create( int width, int height, const std::string& locale, const std::string& timezoneId ); + void Create(int width, int height, const std::string& locale, const std::string& timezoneId); + + /** + * @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 + */ + void Create( int width, int height, int argc, char** argv ); /** * @brief Destroys WebEngine instance. @@ -110,11 +117,45 @@ public: NativeImageInterfacePtr GetNativeImageSource(); /** + * @brief Get settings of WebEngine. + */ + Dali::WebEngineSettings& GetSettings() const; + + /** + * @brief Get context of WebEngine. + */ + Dali::WebEngineContext& GetContext() const; + + /** + * @brief Get cookie manager of WebEngine. + */ + Dali::WebEngineCookieManager& GetCookieManager() const; + + /** + * @brief Get back-forward list of WebEngine. + */ + Dali::WebEngineBackForwardList& GetBackForwardList() const; + + /** * @brief Loads a web page based on a given URL. * * @param [in] url The URL of the resource to load */ - void LoadUrl( const std::string& url ); + void LoadUrl(const std::string& url); + + /** + * @brief Returns the title of the Web. + * + * @return The title of web page + */ + std::string GetTitle() const; + + /** + * @brief Returns the Favicon of the Web. + * + * @return FavIcon of Dali::PixelData& type + */ + Dali::PixelData GetFavicon() const; /** * @brief Gets the url. @@ -126,7 +167,7 @@ public: * * @param [in] htmlString The string to use as the contents of the web page */ - void LoadHTMLString( const std::string& htmlString ); + void LoadHtmlString(const std::string& htmlString); /** * @brief Reloads the Web. @@ -139,6 +180,41 @@ 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 Scrolls the webpage of view by deltaX and deltaY. + */ + void ScrollBy( int deltaX, int deltaY ); + + /** + * @brief Sets an absolute scroll of the given view. + */ + void SetScrollPosition( int x, int y ); + + /** + * @brief Gets the current scroll position of the given view. + */ + Dali::Vector2 GetScrollPosition() const; + + /** + * @brief Gets the possible scroll size of the given view. + */ + Dali::Vector2 GetScrollSize() const; + + /** + * @brief Gets the last known content's size. + */ + Dali::Vector2 GetContentSize() const; + + /** * @brief Returns whether forward is possible. * * @return True if forward is possible, false otherwise @@ -163,28 +239,25 @@ public: void GoBack(); /** - * @brief Evaluates JavaScript code represented as a string. - * - * @param[in] script The JavaScript code - */ - void EvaluateJavaScript( const std::string& script ); + * @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 resultHandler); /** - * @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 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 handler); /** - * @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 Clears all tiles resources of Web. + */ + void ClearAllTilesResources(); /** * @brief Clears the history of Web. @@ -192,47 +265,87 @@ public: void ClearHistory(); /** - * @brief Clears the cache of Web. + * @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 ClearCache(); + void SetUserAgent(const std::string& userAgent); /** * @brief Sets the size of Web Pages. */ - void SetSize( int width, int height ); + void SetSize(int width, int height); /** * @brief Sends Touch Events. */ - bool SendTouchEvent( const TouchData& touch ); + bool SendTouchEvent(const TouchEvent& touch); /** * @brief Sends key Events. */ - bool SendKeyEvent( const KeyEvent& event ); + bool SendKeyEvent(const KeyEvent& event); + + /** + * @brief Set focus. + * @param[in] focused True if web view is focused, false otherwise + */ + void SetFocus( bool focused ); + + /** + * @brief Update display area. + * @param[in] displayArea The area to display web page. + */ + void UpdateDisplayArea( Dali::Rect< int > displayArea ); + + /** + * @brief Enable video hole. + * @param[in] enabled True if video hole is enabled, false otherwise + */ + void EnableVideoHole( bool enabled ); /** * @brief Connects to this signal to be notified when page loading is started. * * @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(); -private: // Not intended for application developers + /** + * @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(); + + /** + * @brief Connects to this signal to be notified when scroll edge is reached. + * + * @return A signal object to connect with. + */ + Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal(); +private: // Not intended for application developers /** * @brief Internal constructor */ - explicit DALI_INTERNAL WebEngine( Internal::Adaptor::WebEngine* internal ); + explicit DALI_INTERNAL WebEngine(Internal::Adaptor::WebEngine* internal); }; -} // namespace Dali; +} // namespace Dali #endif // DALI_WEB_ENGINE_H