[Tizen] Add WebView DeviceListGet,SetDefaultAudio 09/317009/1
authordongsug.song <dongsug.song@samsung.com>
Mon, 23 Dec 2024 05:28:37 +0000 (14:28 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 23 Dec 2024 05:30:15 +0000 (14:30 +0900)
Change-Id: I0ee23a2f46dce52651e3f33b3a7ac1c4132e0da7

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 438540fd4e65fcb7b17cfacfca8fb3b2598b0e53..912f5d426ed63e8e706883137ba541f3f6782ec2 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.
@@ -221,6 +222,17 @@ public:
    */
   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.
    */
@@ -1010,6 +1022,20 @@ 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.
    *
index 1fbbc205c9139afb8740c413a79c6c3593296c73..d6f2703c166dcbb8bdceba27bc0510cbe9dee6c8 100644 (file)
@@ -422,6 +422,14 @@ public:
    *         @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 25fac97a3ce9a6c83553a749965eb64d4402a5fe..f61db4b2b8602281dc3e3ac892607db9c54f46e6 100755 (executable)
@@ -642,6 +642,16 @@ 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);
index 1d451ecb1e90b32748d0eef47de5fff77f7ec1f3..d359aa2adde4e54b5ed01fe2b3495b7dc70845c7 100755 (executable)
@@ -882,6 +882,20 @@ 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.
    *
index fff4c81b98a46a48261203d82f9240114b38a68a..cb8141b62aef01e949e161649c942d1e23b52d5b 100755 (executable)
@@ -159,6 +159,7 @@ SET( devel_api_adaptor_framework_web_engine_header_files
   ${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-device-list-get.h  
 )
 
 
index feb578b329c23ea4318ef3ea2d03253319262e70..16086cc4981aa597a240098de7a943da92cfa936 100644 (file)
@@ -866,6 +866,16 @@ 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);
index e3e14e73cd4a55e046bb2bb14c629c6b0ebc78af..47959c77418da22ba39bf1e6d572b083383a2e4b 100755 (executable)
@@ -622,6 +622,16 @@ 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()
    */