[Tizen] Implement WebEngine::GetPlainTextAsynchronously 27/261927/1
authorJiyun Yang <ji.yang@samsung.com>
Thu, 22 Jul 2021 13:06:09 +0000 (22:06 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Thu, 29 Jul 2021 00:41:52 +0000 (09:41 +0900)
Change-Id: Id85c001698789c9ac9e9f444ebdca3f067df7af6
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
dali/devel-api/adaptor-framework/web-engine-plugin.h
dali/devel-api/adaptor-framework/web-engine.cpp
dali/devel-api/adaptor-framework/web-engine.h
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/web-engine/common/web-engine-impl.h

index 4401491..9f8a16d 100755 (executable)
@@ -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<void(const std::string&)>;
+
+  /**
    * @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
index 3aceceb..bc2c87f 100755 (executable)
@@ -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
index b4333fc..58ec2d9 100755 (executable)
@@ -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
index 8c08ebc..1767791 100755 (executable)
@@ -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;
index 609a153..a27293b 100755 (executable)
@@ -268,6 +268,11 @@ public:
    */
   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
 
+  /**
+   * @copydoc Dali::WebEngine::GetPlainTextAsynchronously()
+   */
+  void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback);
+
 private:
 
   /**