--- /dev/null
+#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
class HoverEvent;
class WheelEvent;
class WebEngineUserMediaPermissionRequest;
+class WebEngineDeviceListGet;
/**
* @brief WebEnginePlugin is an abstract interface, used by dali-adaptor to access WebEngine plugin.
*/
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.
*/
*/
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.
*
* @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
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 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.
*
${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
)
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 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()
*/