--- /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.
/**
* @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.
*/
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.
*/
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
#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.
* @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
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);
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
*/
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.
*
*/
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
${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
)
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);
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
*/
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()
*/
*/
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).