#define DALI_WEB_ENGINE_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * 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.
* @param [in] argc The count of application arguments
* @param [in] argv The string array of application arguments
*/
- void Create( int width, int height, int argc, char** argv );
+ void Create(int width, int height, int argc, char** argv);
/**
* @brief Destroys WebEngine instance.
/**
* @brief Scrolls the webpage of view by deltaX and deltaY.
*/
- void ScrollBy( int deltaX, int deltaY );
+ void ScrollBy(int deltaX, int deltaY);
/**
* @brief Sets an absolute scroll of the given view.
*/
- void SetScrollPosition( int x, int y );
+ void SetScrollPosition(int x, int y);
/**
* @brief Gets the current scroll position of the given view.
void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler);
/**
- * @brief Clears all tiles resources of Web.
+ * @brief Register a callback for JavaScript alert.
+ *
+ * @param[in] callback The callback function
*/
- void ClearAllTilesResources();
+ void RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback);
+
+ /**
+ * @brief Reply for JavaScript alert.
+ */
+ void JavaScriptAlertReply();
+
+ /**
+ * @brief Register a callback for JavaScript confirm.
+ *
+ * @param[in] callback The callback function
+ */
+ void RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback);
+
+ /**
+ * @brief Reply for JavaScript confirm.
+ * @param[in] confirmed True if confirmed, false otherwise.
+ */
+ void JavaScriptConfirmReply(bool confirmed);
+
+ /**
+ * @brief Register a callback for JavaScript prompt.
+ *
+ * @param[in] callback The callback function
+ */
+ void RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback);
+
+ /**
+ * @brief Reply for JavaScript prompt.
+ * @param[in] result The result returned from input-field in prompt popup.
+ */
+ void JavaScriptPromptReply(const std::string& result);
/**
* @brief Clears the history of Web.
void ClearHistory();
/**
+ * @brief Clears all tiles resources of Web.
+ */
+ void ClearAllTilesResources();
+
+ /**
* @brief Get user agent string.
*
* @return The string value of user agent
void SetSize(int width, int height);
/**
+ * @brief Sets background color of web page.
+ *
+ * @param[in] color Background color
+ */
+ void SetDocumentBackgroundColor(Dali::Vector4 color);
+
+ /**
+ * @brief Clears tiles when hidden.
+ *
+ * @param[in] cleared Whether tiles are cleared or not
+ */
+ void ClearTilesWhenHidden(bool cleared);
+
+ /**
+ * @brief Sets multiplier of cover area of tile.
+ *
+ * @param[in] multiplier The multiplier of cover area
+ */
+ void SetTileCoverAreaMultiplier(float multiplier);
+
+ /**
+ * @brief Enables cursor by client.
+ *
+ * @param[in] enabled Whether cursor is enabled or not
+ */
+ void EnableCursorByClient(bool enabled);
+
+ /**
+ * @brief Gets the selected text.
+ *
+ * @return the selected text
+ */
+ std::string GetSelectedText() const;
+
+ /**
* @brief Sends Touch Events.
*/
bool SendTouchEvent(const TouchEvent& touch);
/**
* @brief Set focus.
+ * @param[in] focused True if web view is focused, false otherwise
+ */
+ void SetFocus(bool focused);
+
+ /**
+ * @brief Enables/disables mouse events. The default is enabled.
+ *
+ * @param[in] enabled True if mouse events are enabled, false otherwise
+ */
+ void EnableMouseEvents( bool enabled );
+
+ /**
+ * @brief Enables/disables key events. The default is enabled.
+ *
+ * @param[in] enabled True if key events are enabled, false otherwise
+ */
+ void EnableKeyEvents( bool enabled );
+
+ /**
+ * @brief Update display area.
+ * @param[in] displayArea The area to display web page.
+ */
+ void UpdateDisplayArea(Dali::Rect<int> displayArea);
+
+ /**
+ * @brief Enable video hole.
+ * @param[in] enabled True if video hole is enabled, false otherwise
+ */
+ void EnableVideoHole(bool enabled);
+
+ /**
+ * @brief Sends hover events.
+ * @param[in] event The hover event would be sent.
+ */
+ bool SendHoverEvent( const HoverEvent& event );
+
+ /**
+ * @brief Sends wheel events.
+ * @param[in] event The wheel event would be sent.
*/
- void SetFocus( bool focused );
+ bool SendWheelEvent( const WheelEvent& event );
/**
* @brief Connects to this signal to be notified when page loading is started.
Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal();
/**
+ * @brief Connects to this signal to be notified when page loading is in progress.
+ *
+ * @return A signal object to connect with.
+ */
+ Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadInProgressSignal();
+
+ /**
* @brief Connects to this signal to be notified when page loading is finished.
*
* @return A signal object to connect with.
*/
Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+ /**
+ * @brief Connects to this signal to be notified when url is changed.
+ *
+ * @return A signal object to connect with.
+ */
+ 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