From 505b58aaff135b12d2575e214b02d469913fa624 Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Thu, 22 Jul 2021 22:06:09 +0900 Subject: [PATCH] [Tizen] Implement WebEngine::GetPlainTextAsynchronously Change-Id: Id85c001698789c9ac9e9f444ebdca3f067df7af6 Signed-off-by: Jiyun Yang --- dali/devel-api/adaptor-framework/web-engine-plugin.h | 12 ++++++++++++ dali/devel-api/adaptor-framework/web-engine.cpp | 5 +++++ dali/devel-api/adaptor-framework/web-engine.h | 7 +++++++ dali/internal/web-engine/common/web-engine-impl.cpp | 5 +++++ dali/internal/web-engine/common/web-engine-impl.h | 5 +++++ 5 files changed, 34 insertions(+) diff --git a/dali/devel-api/adaptor-framework/web-engine-plugin.h b/dali/devel-api/adaptor-framework/web-engine-plugin.h index 4401491..9f8a16d 100755 --- a/dali/devel-api/adaptor-framework/web-engine-plugin.h +++ b/dali/devel-api/adaptor-framework/web-engine-plugin.h @@ -60,6 +60,11 @@ public: typedef Signal< void( const ScrollEdge )> WebEngineScrollEdgeReachedSignalType; /** + * @brief The callback to be called when the web engine received a plain text of current web page. + */ + using PlainTextReceivedCallback = std::function; + + /** * @brief Enumeration for the scroll edge. */ enum class ScrollEdge @@ -333,6 +338,13 @@ public: * @return A signal object to connect with. */ virtual WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal() = 0; + + /** + * @brief Get a plain text of current web page asynchronously. + * + * @param[in] callback The callback function called asynchronously. + */ + virtual void GetPlainTextAsynchronously(PlainTextReceivedCallback callback) = 0; }; } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/web-engine.cpp b/dali/devel-api/adaptor-framework/web-engine.cpp index 3aceceb..bc2c87f 100755 --- a/dali/devel-api/adaptor-framework/web-engine.cpp +++ b/dali/devel-api/adaptor-framework/web-engine.cpp @@ -279,4 +279,9 @@ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEd return GetImplementation( *this ).ScrollEdgeReachedSignal(); } +void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback) +{ + GetImplementation(*this).GetPlainTextAsynchronously(callback); +} + } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/web-engine.h b/dali/devel-api/adaptor-framework/web-engine.h index b4333fc..58ec2d9 100755 --- a/dali/devel-api/adaptor-framework/web-engine.h +++ b/dali/devel-api/adaptor-framework/web-engine.h @@ -339,6 +339,13 @@ public: */ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal(); + /** + * @brief Get a plain text of current web page asynchronously. + * + * @param[in] callback The callback function called asynchronously. + */ + void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback); + private: // Not intended for application developers /** * @brief Internal constructor diff --git a/dali/internal/web-engine/common/web-engine-impl.cpp b/dali/internal/web-engine/common/web-engine-impl.cpp index 8c08ebc..1767791 100755 --- a/dali/internal/web-engine/common/web-engine-impl.cpp +++ b/dali/internal/web-engine/common/web-engine-impl.cpp @@ -378,6 +378,11 @@ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEd return mPlugin->ScrollEdgeReachedSignal(); } +void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback) +{ + mPlugin->GetPlainTextAsynchronously(callback); +} + } // namespace Adaptor; } // namespace Internal; } // namespace Dali; diff --git a/dali/internal/web-engine/common/web-engine-impl.h b/dali/internal/web-engine/common/web-engine-impl.h index 609a153..a27293b 100755 --- a/dali/internal/web-engine/common/web-engine-impl.h +++ b/dali/internal/web-engine/common/web-engine-impl.h @@ -268,6 +268,11 @@ public: */ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal(); + /** + * @copydoc Dali::WebEngine::GetPlainTextAsynchronously() + */ + void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback); + private: /** -- 2.7.4