From: Jiyun Yang Date: Thu, 22 Jul 2021 13:06:09 +0000 (+0900) Subject: Implement WebEngine::GetPlainTextAsynchronously X-Git-Tag: dali_2.0.37~9 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=7f9f13e07e11fb8acbe4d0efdd04a5fa24b01348 Implement WebEngine::GetPlainTextAsynchronously Change-Id: Id85c001698789c9ac9e9f444ebdca3f067df7af6 Signed-off-by: Jiyun Yang --- diff --git a/dali/devel-api/adaptor-framework/web-engine-plugin.h b/dali/devel-api/adaptor-framework/web-engine-plugin.h index 69027c2..07daee3 100755 --- a/dali/devel-api/adaptor-framework/web-engine-plugin.h +++ b/dali/devel-api/adaptor-framework/web-engine-plugin.h @@ -178,6 +178,11 @@ public: using WebEngineHitTestCreatedCallback = std::function)>; /** + * @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 @@ -868,6 +873,13 @@ public: * @param[in] callback */ virtual void RegisterContextMenuHiddenCallback(WebEngineContextMenuHiddenCallback callback) = 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; }; // specialization has to be done in the same namespace diff --git a/dali/devel-api/adaptor-framework/web-engine.cpp b/dali/devel-api/adaptor-framework/web-engine.cpp index 0161ba6..86f67f1 100755 --- a/dali/devel-api/adaptor-framework/web-engine.cpp +++ b/dali/devel-api/adaptor-framework/web-engine.cpp @@ -557,4 +557,9 @@ void WebEngine::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngi GetImplementation(*this).RegisterContextMenuHiddenCallback(callback); } +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 d3b5017..4ba8cbf 100755 --- a/dali/devel-api/adaptor-framework/web-engine.h +++ b/dali/devel-api/adaptor-framework/web-engine.h @@ -743,6 +743,13 @@ public: */ void RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback); + /** + * @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 1c83af7..f4753f0 100755 --- a/dali/internal/web-engine/common/web-engine-impl.cpp +++ b/dali/internal/web-engine/common/web-engine-impl.cpp @@ -651,6 +651,11 @@ void WebEngine::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngi mPlugin->RegisterContextMenuHiddenCallback(callback); } +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 4f621a6..c3ad4d0 100755 --- a/dali/internal/web-engine/common/web-engine-impl.h +++ b/dali/internal/web-engine/common/web-engine-impl.h @@ -534,6 +534,11 @@ public: */ void RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback); + /** + * @copydoc Dali::WebEngine::GetPlainTextAsynchronously() + */ + void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback); + private: /** * @brief Constructor.