X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fweb-view%2Fweb-view-impl.h;h=b5aa5d99079472afd987cdb476788ece3a1f7213;hb=eb6dfea26e1d92fadd5e3708b0c7dfadabb136da;hp=ccf07e9779e1b3d546006b6594eba85c2e855c73;hpb=844a31b065de934756df18f175481d7703dc0b07;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.h b/dali-toolkit/internal/controls/web-view/web-view-impl.h old mode 100644 new mode 100755 index ccf07e9..b5aa5d9 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.h +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.h @@ -97,6 +97,11 @@ public: static Toolkit::WebView New( int argc, char** argv ); /** + * @copydoc Dali::Toolkit::WebView::GetPlugin() + */ + Dali::WebEnginePlugin* GetPlugin() const; + + /** * @brief Get favicon of web page. * * @return Handle to a favicon @@ -161,12 +166,12 @@ public: /** * @copydoc Dali::Toolkit::WebView::EvaluateJavaScript() */ - void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler ); + void EvaluateJavaScript( const std::string& script, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback resultHandler ); /** * @copydoc Dali::Toolkit::WebView::AddJavaScriptMessageHandler() */ - void AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler ); + void AddJavaScriptMessageHandler( const std::string& exposedObjectName, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback handler ); /** * @brief Clears all tiles resources of Web. @@ -184,24 +189,44 @@ public: void SetTtsFocus(bool focused); /** - * @copydoc Dali::Toolkit::WebView::PageLoadStartedSignal() + * @copydoc Dali::Toolkit::WebView::RegisterPageLoadStartedCallback() + */ + void RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback); + + /** + * @copydoc Dali::Toolkit::WebView::RegisterPageLoadFinishedCallback() + */ + void RegisterPageLoadFinishedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback); + + /** + * @copydoc Dali::Toolkit::WebView::RegisterPageLoadErrorCallback() */ - Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadStartedSignal(); + void RegisterPageLoadErrorCallback(Dali::WebEnginePlugin::WebEnginePageLoadErrorCallback callback); /** - * @copydoc Dali::Toolkit::WebView::PageLoadFinishedSignal() + * @copydoc Dali::Toolkit::WebView::RegisterScrollEdgeReachedCallback() */ - Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadFinishedSignal(); + void RegisterScrollEdgeReachedCallback(Dali::WebEnginePlugin::WebEngineScrollEdgeReachedCallback callback); /** - * @copydoc Dali::Toolkit::WebView::PageLoadErrorSignal() + * @copydoc Dali::Toolkit::WebView::RegisterUrlChangedCallback() */ - Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& PageLoadErrorSignal(); + void RegisterUrlChangedCallback(Dali::WebEnginePlugin::WebEngineUrlChangedCallback callback); /** - * @copydoc Dali::Toolkit::WebView::ScrollEdgeReachedSignal() + * @copydoc Dali::Toolkit::WebView::RegisterNavigationPolicyDecidedCallback() */ - Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal(); + void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback); + + /** + * @copydoc Dali::Toolkit::WebView::RegisterNewWindowCreatedCallback() + */ + void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback); + + /** + * @copydoc Dali::Toolkit::WebView::GetPlainTextAsynchronously() + */ + void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback); public: // Properties @@ -223,17 +248,6 @@ public: // Properties */ static Dali::Property::Value GetProperty( Dali::BaseObject* object, Dali::Property::Index propertyIndex ); - /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the c - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - private: // From Control /** @@ -310,6 +324,12 @@ private: void GetContentSize( int& width, int& height ) const; /** + * @brief Get current url. + * @return The string value of current url + */ + std::string GetUrl() const; + + /** * @brief Returns the title of the Web. * * @return The title of web page @@ -320,7 +340,7 @@ private: * @brief Get user agent string. * @return The string value of user agent */ - const std::string& GetUserAgent() const; + std::string GetUserAgent() const; /** * @brief Set user agent string. @@ -346,53 +366,22 @@ private: */ void EnableBlendMode( bool blendEnabled ); - /** - * @brief Callback function to be called when page load started. - * @param[in] url The url currently being loaded - */ - void OnPageLoadStarted( const std::string& url ); - - /** - * @brief Callback function to be called when page load finished. - * @param[in] url The url currently being loaded - */ - void OnPageLoadFinished( const std::string& url ); - - /** - * @brief Callback function to be called when there is an error in page loading. - * @param[in] url The url currently being loaded - * @param[in] errorCode The error code - */ - void OnPageLoadError( const std::string& url, int errorCode ); +private: - /** - * @brief Callback function to be called when scroll edge is reached. - * @param[in] e The scroll edge reached. - */ - void OnScrollEdgeReached( Dali::WebEnginePlugin::ScrollEdge edge ); + Dali::Toolkit::Visual::Base mVisual; + Dali::Size mWebViewSize; + Dali::WebEngine mWebEngine; -private: + std::unique_ptr mWebContext; + std::unique_ptr mWebCookieManager; + std::unique_ptr mWebSettings; + std::unique_ptr mWebBackForwardList; - std::string mUrl; - Dali::Toolkit::Visual::Base mVisual; - Dali::Size mWebViewSize; - Dali::WebEngine mWebEngine; - - Dali::Toolkit::WebView::WebViewPageLoadSignalType mPageLoadStartedSignal; - Dali::Toolkit::WebView::WebViewPageLoadSignalType mPageLoadFinishedSignal; - Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType mPageLoadErrorSignal; - Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType mScrollEdgeReachedSignal; - - std::unique_ptr mWebContext; - std::unique_ptr mWebCookieManager; - std::unique_ptr mWebSettings; - std::unique_ptr mWebBackForwardList; - - Dali::PropertyNotification mPositionUpdateNotification; - Dali::PropertyNotification mSizeUpdateNotification; - Dali::PropertyNotification mScaleUpdateNotification; - bool mVideoHoleEnabled; - Dali::Rect< int > mWebViewArea; + Dali::PropertyNotification mPositionUpdateNotification; + Dali::PropertyNotification mSizeUpdateNotification; + Dali::PropertyNotification mScaleUpdateNotification; + bool mVideoHoleEnabled; + Dali::Rect< int > mWebViewArea; }; } // namespace Internal