Add callbacks for form repost decision and frame rendering. 76/254176/8
authorhuayong.xu <huayong.xu@samsung.com>
Wed, 24 Feb 2021 09:40:09 +0000 (17:40 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Mon, 29 Mar 2021 02:48:26 +0000 (10:48 +0800)
This patch is to add callbacks for form repost decision and frame
rendering in web engine.

Change-Id: I13ffe21dbcb87d04775f120e4410340d80c7f61e

dali/devel-api/adaptor-framework/web-engine-cookie-manager.h [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h [new file with mode: 0755]
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/devel-api/file.list
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/web-engine/common/web-engine-impl.h

old mode 100644 (file)
new mode 100755 (executable)
index 8400d35..ac3367f
@@ -24,7 +24,7 @@
 namespace Dali
 {
 /**
- * @brief A class WebEngineCookieManager to wrap ewk cookie manager.
+ * @brief A class WebEngineCookieManager for cookie manager of web engine.
  */
 class WebEngineCookieManager
 {
diff --git a/dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h b/dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h
new file mode 100755 (executable)
index 0000000..68df413
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef DALI_WEB_ENGINE_FORM_REPOST_DECISION_H
+#define DALI_WEB_ENGINE_FORM_REPOST_DECISION_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+/**
+ * @brief A class WebEngineFormRepostDecision for form repost decision.
+ */
+class WebEngineFormRepostDecision
+{
+public:
+  /**
+   * @brief Constructor.
+   */
+  WebEngineFormRepostDecision() = default;
+
+  /**
+   * @brief Destructor.
+   */
+  virtual ~WebEngineFormRepostDecision() = default;
+
+  /**
+   * @brief Reply the result about form repost decision.
+   *
+   * @param[in] allowed Whether allow form repost decision request or not
+   */
+  virtual void Reply(bool allowed) = 0;
+};
+
+} // namespace Dali
+
+#endif // DALI_WEB_ENGINE_FORM_REPOST_DECISION_H
index af1fb35..4adc1fb 100755 (executable)
@@ -23,6 +23,7 @@
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/signals/dali-signal.h>
 #include <functional>
+#include <memory>
 
 namespace Dali
 {
@@ -32,6 +33,7 @@ class TouchEvent;
 class WebEngineBackForwardList;
 class WebEngineContext;
 class WebEngineCookieManager;
+class WebEngineFormRepostDecision;
 class WebEngineSettings;
 class HoverEvent;
 class WheelEvent;
@@ -86,6 +88,16 @@ public:
   using JavaScriptPromptCallback = std::function<bool(const std::string&, const std::string&)>;
 
   /**
+   * @brief WebView signal type related with form repost decision.
+   */
+  using WebEngineFormRepostDecisionSignalType = Signal<void(std::shared_ptr<Dali::WebEngineFormRepostDecision>)>;
+
+  /**
+   * @brief WebView signal type related with frame rendered.
+   */
+  using WebEngineFrameRenderedSignalType = Signal<void(void)>;
+
+  /**
    * @brief Enumeration for the scroll edge.
    */
   enum class ScrollEdge
@@ -469,6 +481,20 @@ public:
    * @return A signal object to connect with.
    */
   virtual WebEngineUrlChangedSignalType& UrlChangedSignal() = 0;
+
+  /**
+   * @brief Connects to this signal to be notified when form repost decision is requested.
+   *
+   * @return A signal object to connect with.
+   */
+  virtual WebEngineFormRepostDecisionSignalType& FormRepostDecisionSignal() = 0;
+
+  /**
+   * @brief Connects to this signal to be notified when frame is rendered.
+   *
+   * @return A signal object to connect with.
+   */
+  virtual WebEngineFrameRenderedSignalType& FrameRenderedSignal() = 0;
 };
 
 } // namespace Dali
index 35eac17..e94bd58 100755 (executable)
@@ -241,7 +241,7 @@ void WebEngine::JavaScriptPromptReply(const std::string& result)
 
 void WebEngine::ClearHistory()
 {
-  return GetImplementation(*this).ClearHistory();
+  GetImplementation(*this).ClearHistory();
 }
 
 void WebEngine::ClearAllTilesResources()
@@ -364,4 +364,14 @@ Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSigna
   return GetImplementation(*this).UrlChangedSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& WebEngine::FormRepostDecisionSignal()
+{
+  return GetImplementation(*this).FormRepostDecisionSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
+{
+  return GetImplementation(*this).FrameRenderedSignal();
+}
+
 } // namespace Dali
index df639c3..ad49b52 100755 (executable)
@@ -275,6 +275,7 @@ public:
 
   /**
    * @brief Reply for JavaScript confirm.
+   * @param[in] confirmed True if confirmed, false otherwise.
    */
   void JavaScriptConfirmReply(bool confirmed);
 
@@ -287,6 +288,7 @@ public:
 
   /**
    * @brief Reply for JavaScript prompt.
+   * @param[in] result The result returned from input-field in prompt popup.
    */
   void JavaScriptPromptReply(const std::string& result);
 
@@ -450,6 +452,20 @@ public:
    */
   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& UrlChangedSignal();
 
+  /**
+   * @brief Connects to this signal to be notified when form repost decision is requested.
+   *
+   * @return A signal object to connect with.
+   */
+  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& FormRepostDecisionSignal();
+
+  /**
+   * @brief Connects to this signal to be notified when frame is rendered.
+   *
+   * @return A signal object to connect with.
+   */
+  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal();
+
 private: // Not intended for application developers
   /**
    * @brief Internal constructor
index cd5f869..4633ed9 100755 (executable)
@@ -87,6 +87,7 @@ SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-cookie-manager.h
+  ${adaptor_devel_api_dir}/adaptor-framework/web-engine-form-repost-decision.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-plugin.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-settings.h
   ${adaptor_devel_api_dir}/adaptor-framework/key-extension-plugin.h
index 2f444bf..257b067 100755 (executable)
@@ -459,6 +459,16 @@ Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSigna
   return mPlugin->UrlChangedSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& WebEngine::FormRepostDecisionSignal()
+{
+  return mPlugin->FormRepostDecisionSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
+{
+  return mPlugin->FrameRenderedSignal();
+}
+
 } // namespace Adaptor
 } // namespace Internal
 } // namespace Dali
index 7b1675d..9e78e72 100644 (file)
@@ -349,6 +349,16 @@ public:
    */
   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& UrlChangedSignal();
 
+  /**
+   * @copydoc Dali::WebEngine::FormRepostDecisionSignal()
+   */
+  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& FormRepostDecisionSignal();
+
+  /**
+   * @copydoc Dali::WebEngine::FrameRenderedSignal()
+   */
+  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal();
+
 private:
   /**
    * @brief Constructor.