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=0380c2670f1c715979ec7b848d586985a7f4333e;hp=83b5ebd92d9c4e4686f3c3958148ea7053693574;hb=9d1d199ec60bf11a03662e1e17b7f772785d11c1;hpb=1d82abb8a1a514ce0af63004706135fb7883f89b diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.h b/dali-toolkit/devel-api/controls/web-view/web-view.h old mode 100644 new mode 100755 index 83b5ebd..0380c26 --- a/dali-toolkit/devel-api/controls/web-view/web-view.h +++ b/dali-toolkit/devel-api/controls/web-view/web-view.h @@ -22,12 +22,19 @@ #include // INTERNAL INCLUDES +#include #include namespace Dali { namespace Toolkit { +class ImageView; +class WebBackForwardList; +class WebContext; +class WebCookieManager; +class WebSettings; + namespace Internal DALI_INTERNAL { class WebView; @@ -49,59 +56,6 @@ class WebView; class DALI_TOOLKIT_API WebView : public Control { public: - /** - * @brief A structure used to contain the cache model enumeration. - */ - struct CacheModel - { - /** - * @brief Enumeration for cache model options. - */ - enum Type - { - /** - * @brief Use the smallest cache capacity. - */ - DOCUMENT_VIEWER, - - /** - * @brief Use the bigger cache capacity than DocumentBrowser. - */ - DOCUMENT_BROWSER, - - /** - * @brief Use the biggest cache capacity. - */ - PRIMARY_WEB_BROWSER - }; - }; - - /** - * @brief A structure used to contain the cookie acceptance policy enumeration. - */ - struct CookieAcceptPolicy - { - /** - * @brief Enumeration for the cookies accept policies. - */ - enum Type - { - /** - * @brief Accepts every cookie sent from any page. - */ - ALWAYS, - - /** - * @brief Rejects all the cookies. - */ - NEVER, - - /** - * @brief Accepts only cookies set by the main document that is loaded. - */ - NO_THIRD_PARTY - }; - }; /** * @brief Enumeration for the start and end property ranges for this control. @@ -126,54 +80,35 @@ public: URL = PROPERTY_START_INDEX, /** - * @brief The cache model. - * @details Name "cacheModel", type WebView::CacheModel::Type (Property::INTEGER) or Property::STRING. - * @note Default is WebView::CacheModel::DOCUMENT_VIEWER. - * @see WebView::CacheModel::Type - */ - CACHE_MODEL, - - /** - * @brief The cookie acceptance policy. - * @details Name "cookieAcceptPolicy", type WebView::CookieAcceptPolicy::Type (Property::INTEGER) or Property::STRING. - * @note Default is WebView::CookieAcceptPolicy::NO_THIRD_PARTY. - * @see WebView::CookieAcceptPolicy::Type - */ - COOKIE_ACCEPT_POLICY, - - /** * @brief The user agent string. * @details Name "userAgent", type Property::STRING. */ USER_AGENT, /** - * @brief Whether JavaScript is enabled. - * @details Name "enableJavaScript", type Property::BOOLEAN. - * @note Default is true. + * @brief The current position of scroll. + * @details Name "scrollPosition", type Property::VECTOR2. */ - ENABLE_JAVASCRIPT, + SCROLL_POSITION, /** - * @brief Whether images can be loaded automatically. - * @details Name "loadImagesAutomatically", type Property::BOOLEAN. - * @note Default is true. + * @brief The current position of scroll. + * @details Name "scrollSize", type Property::VECTOR2. Read-only. */ - LOAD_IMAGES_AUTOMATICALLY, + SCROLL_SIZE, /** - * @brief The default text encoding name. - * @details Name "defaultTextEncodingName", type Property::STRING. - * @note If the value is not set, the web engine detects web page's text encoding. + * @brief The current position of scroll. + * @details Name "contentSize", type Property::VECTOR2. Read-only. */ - DEFAULT_TEXT_ENCODING_NAME, + CONTENT_SIZE, /** - * @brief The default font size in pixel. - * @details Name "defaultFontSize", type Property::INT. - * @note Default is 16. + * @brief The title of web page. + * @details Name "title", type Property::STRING. + * @note The value is read-only. */ - DEFAULT_FONT_SIZE + TITLE, }; }; @@ -261,12 +196,17 @@ public: /** * @brief WebView signal type related with page loading. */ - typedef Signal WebViewPageLoadSignalType; + using WebViewPageLoadSignalType = Signal< void( WebView, const std::string& ) >; /** * @brief WebView signal type related with page loading error. */ - typedef Signal WebViewPageLoadErrorSignalType; + using WebViewPageLoadErrorSignalType = Signal< void( WebView, const std::string&, LoadErrorCode ) >; + + /** + * @brief WebView signal type related with scroll edge reached. + */ + using WebViewScrollEdgeReachedSignalType = Signal< void( WebView, Dali::WebEnginePlugin::ScrollEdge ) >; public: /** @@ -286,6 +226,14 @@ public: static WebView New(const std::string& locale, const std::string& timezoneId); /** + * @brief Creates an initialized WebView. + * + * @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 ); + + /** * @brief Creates an uninitialized WebView. */ WebView(); @@ -324,6 +272,33 @@ public: static WebView DownCast(BaseHandle handle); /** + * @brief Get WebSettings of WebEngine. + */ + Dali::Toolkit::WebSettings* GetSettings() const; + + /** + * @brief Get WebContext of WebEngine. + */ + Dali::Toolkit::WebContext* GetContext() const; + + /** + * @brief Get CookieManager of WebEngine. + */ + Dali::Toolkit::WebCookieManager* GetCookieManager() const; + + /** + * @brief Get WebBackForwardList of WebEngine. + */ + Dali::Toolkit::WebBackForwardList* GetBackForwardList() const; + + /** + * @brief Get Favicon of web page. + * + * @return Handle to a fav icon + */ + Dali::Toolkit::ImageView& GetFavicon(); + + /** * @brief Loads a web page based on a given URL. * * @param [in] url The URL of the resource to load @@ -335,7 +310,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. @@ -358,6 +333,13 @@ public: void Resume(); /** + * @brief Scrolls the webpage of view by deltaX and deltaY. + * @param[in] deltaX The delta x of scroll + * @param[in] deltaY The delta y of scroll + */ + void ScrollBy( int deltaX, int deltaY ); + + /** * @brief Returns whether forward is possible. * * @return True if forward is possible, false otherwise @@ -423,19 +405,14 @@ public: void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler); /** - * @brief Clears the history of Web. + * @brief Clears all tiles resources of Web. */ - void ClearHistory(); + void ClearAllTilesResources(); /** - * @brief Clears the cache of Web. - */ - void ClearCache(); - - /** - * @brief Clears all the cookies of Web. + * @brief Clears the history of Web. */ - void ClearCookies(); + void ClearHistory(); /** * @brief Connects to this signal to be notified when page loading is started. @@ -458,6 +435,13 @@ public: */ WebViewPageLoadErrorSignalType& PageLoadErrorSignal(); + /** + * @brief Connects to this signal to be notified when scroll edge is reached. + * + * @return A signal object to connect with. + */ + WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal(); + public: // Not intended for application developers /// @cond internal /**