(WebView) Update and sync all the latest patches related to WebView that have been... 17/322117/2
authordongsug.song <dongsug.song@samsung.com>
Thu, 3 Apr 2025 12:22:56 +0000 (21:22 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 8 Apr 2025 09:00:28 +0000 (18:00 +0900)
- Fix for UserMediaPermissionRequest object to be maintained by user
- Add WebView FeedMouseWheel as hidden api
- Add SetVideoHole() for EFL window
- Add WebView DeviceListGet,SetDefaultAudio
- Add APIs for setting IME position, cursor theme name.

Change-Id: I2670d74b9f04a620119bd4fd38ee7fcca0be650c

dali/devel-api/adaptor-framework/web-engine/web-engine-device-list-get.h [new file with mode: 0755]
dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h
dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h
dali/devel-api/adaptor-framework/web-engine/web-engine.cpp
dali/devel-api/adaptor-framework/web-engine/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

diff --git a/dali/devel-api/adaptor-framework/web-engine/web-engine-device-list-get.h b/dali/devel-api/adaptor-framework/web-engine/web-engine-device-list-get.h
new file mode 100755 (executable)
index 0000000..b78da72
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef DALI_WEB_ENGINE_DEVICE_LIST_GET_H
+#define DALI_WEB_ENGINE_DEVICE_LIST_GET_H
+
+/*
+ * Copyright (c) 2024 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+#include <list>
+
+namespace Dali
+{
+
+/**
+ * @brief A class WebEngineDeviceListGet for getting connection device list of web engine.
+ */
+class WebEngineDeviceListGet
+{
+public:
+  /**
+   * @brief A item structure to be stored in the device_list.
+   */
+  struct DeviceItem
+  {
+    std::string device_id;
+    std::string label;
+    int32_t device_type;
+    bool connected;
+  };
+
+  /**
+   * @brief Constructor.
+   */
+  WebEngineDeviceListGet() = default;
+
+  /**
+   * @brief Destructor.
+   */
+  virtual ~WebEngineDeviceListGet() = default;
+
+  /**
+   * @brief Get size of device_list.
+   * @return Size of device_list.
+   */
+  virtual int GetSize() = 0;
+
+  /**
+   * @brief Reset the device_list.
+   */
+  virtual void Reset() = 0;
+
+  /**
+   * @brief Get items by index.
+   * @return Item corresponding to the index.
+   */
+  virtual void GetTypeAndConnect(int32_t* type, bool* connect, int index) = 0;
+
+  /**
+   * @brief Get device id by index.
+   * @return Device id corresponding to the index.
+   */
+  virtual std::string GetDeviceId(int idx) = 0;
+
+  /**
+   * @brief Get device label by index.
+   * @return Device label corresponding to the index.
+   */
+  virtual std::string GetDeviceLabel(int idx) = 0;
+};
+} // namespace Dali
+
+#endif // DALI_WEB_ENGINE_DEVICE_LIST_GET_H
index a105b64344674e92013e211478fc8605ceb28986..a4691e370216269078988a2bc86e9d0211c68290 100755 (executable)
@@ -48,6 +48,7 @@ class WebEngineSettings;
 class HoverEvent;
 class WheelEvent;
 class WebEngineUserMediaPermissionRequest;
+class WebEngineDeviceListGet;
 
 /**
  * @brief WebEnginePlugin is an abstract interface, used by dali-adaptor to access WebEngine plugin.
@@ -219,7 +220,18 @@ public:
   /**
    * @brief The callback to be called when the web engine received a user media permission reqeust from user application.
    */
-  using WebEngineUserMediaPermissionRequestCallback = std::function<void(std::unique_ptr<Dali::WebEngineUserMediaPermissionRequest>, const std::string&)>;
+  using WebEngineUserMediaPermissionRequestCallback = std::function<void(Dali::WebEngineUserMediaPermissionRequest*, const std::string&)>;
+
+  /**
+   * @brief The callback to be called when the web engine received a device connection changed event.
+   */
+  using WebEngineDeviceConnectionChangedCallback = std::function<void(int32_t)>;
+
+  /**
+   * @brief The callback to be called when the web engine received a device list.
+   */
+  using WebEngineDeviceListGetCallback = std::function<void(Dali::WebEngineDeviceListGet*, int32_t)>;
+
 
   /**
    * @brief Enumeration for the scroll edge.
@@ -669,6 +681,21 @@ public:
    */
   virtual void SetFocus(bool focused) = 0;
 
+  /**
+   * @brief Set the style of IME.
+   * @param[in] position Position of IME.
+   * @param[in] alignment Alignment of IME.
+   *
+   * @return true if succeeded, false otherwise
+   */
+  virtual bool SetImePositionAndAlignment(Dali::Vector2 position, int alignment) = 0;
+
+  /**
+   * @brief Set the theme name of cursor.
+   * @param[in] themeName The name of theme of cursor.
+   */
+  virtual void SetCursorThemeName(const std::string themeName) = 0;
+
   /**
    * @brief Set zoom factor of the current page.
    * @param[in] zoomFactor a new factor to be set.
@@ -995,6 +1022,36 @@ public:
    */
   virtual void RegisterUserMediaPermissionRequestCallback(WebEngineUserMediaPermissionRequestCallback callback) = 0;
 
+  /**
+   * @brief Callback to be called when device connection changed.
+   *
+   * @param[in] callback
+   */
+  virtual void RegisterDeviceConnectionChangedCallback(WebEngineDeviceConnectionChangedCallback callback) = 0;
+
+  /**
+   * @brief Callback to be called to get device list.
+   *
+   * @param[in] callback
+   */
+  virtual void RegisterDeviceListGetCallback(WebEngineDeviceListGetCallback callback) = 0;
+
+  /**
+   * @brief Feed mouse wheel event forcefully.
+   *
+   * @param[in] yDirection wheel event's y direction.
+   * @param[in] step step of wheel event.
+   * @param[in] x x value of wheel event.
+   * @param[in] y y value of wheel event.
+   */
+  virtual void FeedMouseWheel(bool yDirection, int step, int x, int y) = 0;
+
+  /**
+   * @brief Enable video hole for a specific window type.
+   * @param[in] enabled True if enabled, false othewise.
+   * @param[in] isWaylandWindow True if wayland window, false if EFL window.
+   */
+  virtual void SetVideoHole(bool enabled, bool isWaylandWindow) = 0;
 };
 
 // specialization has to be done in the same namespace
index faee431aa098951087db8f27d3d3762e2f723def..d6f2703c166dcbb8bdceba27bc0510cbe9dee6c8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_WEB_ENGINE_SETTINGS_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -403,6 +403,33 @@ public:
    * @return @c true on enable or @c false on disable
    */
   virtual bool IsExtraFeatureEnabled(const std::string& feature) const = 0;
+
+  /**
+   * @brief Sets the style of IME.
+   *
+   * @param[in] style @c IME_STYLE_FULL       full IME style
+   *                  @c IME_STYLE_FLOATING   floating IME style
+   *                  @c IME_STYLE_DYNAMIC    dynamic IME style
+   *
+   */
+  virtual void SetImeStyle(int style) = 0;
+
+  /**
+   * @brief Gets the style of IME.
+   *
+   * @return @c IME_STYLE_FULL       full IME style
+   *         @c IME_STYLE_FLOATING   floating IME style
+   *         @c IME_STYLE_DYNAMIC    dynamic IME style
+   */
+  virtual int GetImeStyle() const = 0;
+
+  /**
+   * @brief Sets default audio input device
+   *
+   * @param[in] deviceId default device ID
+   */
+  virtual void SetDefaultAudioInputDevice(const std::string& deviceId) const = 0;
+
 };
 
 } // namespace Dali
index c9d4c11827b147e6c2658758f2e67712db4149de..3e315049cac9e4512f752ca36856efce63028772 100755 (executable)
@@ -402,6 +402,16 @@ void WebEngine::SetFocus(bool focused)
   GetImplementation(*this).SetFocus(focused);
 }
 
+bool WebEngine::SetImePositionAndAlignment(Dali::Vector2 position, int alignment)
+{
+  return GetImplementation(*this).SetImePositionAndAlignment(position, alignment);
+}
+
+void WebEngine::SetCursorThemeName(const std::string themeName)
+{
+  GetImplementation(*this).SetCursorThemeName(themeName);
+}
+
 void WebEngine::SetPageZoomFactor(float zoomFactor)
 {
   GetImplementation(*this).SetPageZoomFactor(zoomFactor);
@@ -632,4 +642,24 @@ void WebEngine::RegisterUserMediaPermissionRequestCallback(Dali::WebEnginePlugin
   GetImplementation(*this).RegisterUserMediaPermissionRequestCallback(callback);
 }
 
+void WebEngine::RegisterDeviceConnectionChangedCallback(Dali::WebEnginePlugin::WebEngineDeviceConnectionChangedCallback callback)
+{
+  GetImplementation(*this).RegisterDeviceConnectionChangedCallback(callback);
+}
+
+void WebEngine::RegisterDeviceListGetCallback(Dali::WebEnginePlugin::WebEngineDeviceListGetCallback callback)
+{
+  GetImplementation(*this).RegisterDeviceListGetCallback(callback);
+}
+
+void WebEngine::FeedMouseWheel(bool yDirection, int step, int x, int y)
+{
+  GetImplementation(*this).FeedMouseWheel(yDirection, step, x, y);
+}
+
+void WebEngine::SetVideoHole(bool enabled, bool isWaylandWindow)
+{
+  GetImplementation(*this).SetVideoHole(enabled, isWaylandWindow);
+}
+
 } // namespace Dali
index 1ec587f30dad1640b0e231db14997ffe52fe1d4a..788e56cbf393937f3191b38dec8fb52413886448 100644 (file)
@@ -525,6 +525,21 @@ public:
    */
   void SetFocus(bool focused);
 
+  /**
+   * @brief Set the style of IME.
+   * @param[in] position Position of IME.
+   * @param[in] alignment Alignment of IME.
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool SetImePositionAndAlignment(Dali::Vector2 position, int alignment);
+
+  /**
+   * @brief Set the theme name of cursor.
+   * @param[in] themeName The name of theme of cursor.
+   */
+  void SetCursorThemeName(const std::string themeName);
+
   /**
    * @brief Enable/disable mouse events. The default is enabled.
    *
@@ -867,6 +882,37 @@ public:
    */
   void RegisterUserMediaPermissionRequestCallback(Dali::WebEnginePlugin::WebEngineUserMediaPermissionRequestCallback callback);
 
+  /**
+   * @brief Register DeviceConnectionChanged callback.
+   *
+   * @param[in] callback The callback to be called for device connection changed event.
+   */
+  void RegisterDeviceConnectionChangedCallback(Dali::WebEnginePlugin::WebEngineDeviceConnectionChangedCallback callback);
+
+  /**
+   * @brief Register DeviceListGet callback.
+   *
+   * @param[in] callback The callback to be called for getting device list.
+   */
+  void RegisterDeviceListGetCallback(Dali::WebEnginePlugin::WebEngineDeviceListGetCallback callback);
+
+  /**
+   * @brief Feed mouse wheel event forcefully.
+   *
+   * @param[in] yDirection wheel event's y direction.
+   * @param[in] step step of wheel event.
+   * @param[in] x x value of wheel event.
+   * @param[in] y y value of wheel event.
+   */
+  void FeedMouseWheel(bool yDirection, int step, int x, int y);
+
+  /**
+   * @brief Enable video hole for a specific window type.
+   * @param[in] enabled True if enabled, false othewise.
+   * @param[in] isWaylandWindow True if wayland window, false if EFL window.
+   */
+  void SetVideoHole(bool enabled, bool isWaylandWindow);
+
 private: // Not intended for application developers
   /**
    * @brief Internal constructor
index 0549a09b647413f4d8249b2da2dd976cc42cb511..df109d979055b2fba0a4d0c910a51de6a2f29578 100755 (executable)
@@ -155,7 +155,8 @@ SET( devel_api_adaptor_framework_web_engine_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-request-interceptor.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-security-origin.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-settings.h
-  ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-user-media-permission-request.h  
+  ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-user-media-permission-request.h
+  ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-device-list-get.h
 )
 
 
index 9bc6533f5d3e5d6d3b90d50832ca526c2d104e37..fe7aa635c123a2583a2dd871b4552af57a465b77 100644 (file)
@@ -596,6 +596,16 @@ void WebEngine::SetFocus(bool focused)
   mPlugin->SetFocus(focused);
 }
 
+bool WebEngine::SetImePositionAndAlignment(Dali::Vector2 position, int alignment)
+{
+  return mPlugin->SetImePositionAndAlignment(position, alignment);
+}
+
+void WebEngine::SetCursorThemeName(const std::string themeName)
+{
+  mPlugin->SetCursorThemeName(themeName);
+}
+
 void WebEngine::SetDocumentBackgroundColor(Dali::Vector4 color)
 {
   mPlugin->SetDocumentBackgroundColor(color);
@@ -856,6 +866,25 @@ void WebEngine::RegisterUserMediaPermissionRequestCallback(Dali::WebEnginePlugin
   mPlugin->RegisterUserMediaPermissionRequestCallback(callback);
 }
 
+void WebEngine::RegisterDeviceConnectionChangedCallback(Dali::WebEnginePlugin::WebEngineDeviceConnectionChangedCallback callback)
+{
+  mPlugin->RegisterDeviceConnectionChangedCallback(callback);
+}
+
+void WebEngine::RegisterDeviceListGetCallback(Dali::WebEnginePlugin::WebEngineDeviceListGetCallback callback)
+{
+  mPlugin->RegisterDeviceListGetCallback(callback);
+}
+
+void WebEngine::FeedMouseWheel(bool yDirection, int step, int x, int y)
+{
+  mPlugin->FeedMouseWheel(yDirection, step, x, y);
+}
+
+void WebEngine::SetVideoHole(bool enabled, bool isWaylandWindow)
+{
+  mPlugin->SetVideoHole(enabled, isWaylandWindow);
+}
 
 } // namespace Adaptor
 } // namespace Internal
index e557e69cbab4260749343458430fffa6929688e8..ffd0f58a286bfc83cb450094347fef540862efc0 100755 (executable)
@@ -377,6 +377,16 @@ public:
    */
   void SetFocus(bool focused);
 
+  /**
+   * @copydoc Dali::WebEngine::SetImePositionAndAlignment()
+   */
+  bool SetImePositionAndAlignment(Dali::Vector2 position, int alignment);
+
+  /**
+   * @copydoc Dali::WebEngine::SetCursorThemeName()
+   */
+  void SetCursorThemeName(const std::string themeName);
+
   /**
    * @copydoc Dali::WebEngine::SetPageZoomFactor()
    */
@@ -612,6 +622,26 @@ public:
    */
   void RegisterUserMediaPermissionRequestCallback(Dali::WebEnginePlugin::WebEngineUserMediaPermissionRequestCallback callback);
 
+  /**
+   * @copydoc Dali::WebEngine::RegisterDeviceConnectionChangedCallback()
+   */
+  void RegisterDeviceConnectionChangedCallback(Dali::WebEnginePlugin::WebEngineDeviceConnectionChangedCallback callback);
+
+  /**
+   * @copydoc Dali::WebEngine::RegisterDeviceListGetCallback()
+   */
+  void RegisterDeviceListGetCallback(Dali::WebEnginePlugin::WebEngineDeviceListGetCallback callback);
+
+  /**
+   * @copydoc Dali::WebEngine::FeedMouseWheel()
+   */
+  void FeedMouseWheel(bool yDirection, int step, int x, int y);
+
+  /**
+   * @copydoc Dali::WebEngine::SetVideoHole()
+   */
+  void SetVideoHole(bool enabled, bool isWaylandWindow);
+
 private:
   /**
    * @brief Constructor with WebEngine type (0: Chromium, 1: LWE, otherwise: depend on system environment).