#define DALI_TOOLKIT_WEB_VIEW_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
-#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h>
namespace Dali
{
+class WebEngineContext;
+class WebEngineCookieManager;
+
namespace Toolkit
{
class ImageView;
class WebBackForwardList;
-class WebContext;
-class WebCookieManager;
class WebSettings;
namespace Internal DALI_INTERNAL
static WebView New(uint32_t argc, char** argv);
/**
+ * @brief Find web view by web engine plugin.
+ */
+ static Toolkit::WebView FindWebView(Dali::WebEnginePlugin* plugin);
+
+ /**
+ * @brief Get context of web engine.
+ */
+ static Dali::WebEngineContext* GetContext();
+
+ /**
+ * @brief Get cookie manager of web engine.
+ */
+ static Dali::WebEngineCookieManager* GetCookieManager();
+
+ /**
* @brief Create an uninitialized WebView.
*/
WebView();
Dali::Toolkit::WebSettings* GetSettings() const;
/**
- * @brief Get WebContext of WebEngine.
- */
- Dali::Toolkit::WebContext* GetContext() const;
-
- /**
- * @brief Get CookieManager of WebEngine.
+ * @brief Get WebBackForwardList of WebEngine.
*/
- Dali::Toolkit::WebCookieManager* GetCookieManager() const;
+ Dali::Toolkit::WebBackForwardList* GetBackForwardList() const;
/**
- * @brief Get WebBackForwardList of WebEngine.
+ * @brief Gets web engine plugin.
*/
- Dali::Toolkit::WebBackForwardList* GetBackForwardList() const;
+ Dali::WebEnginePlugin* GetPlugin() const;
/**
* @brief Get favicon of web page.
*
* @return true if successfully request, false otherwise
*/
- bool LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
+ bool LoadContents(const int8_t* contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
/**
* @brief Reload the Web.
void RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback);
/**
- * @brief Callback to be called when http request need be intercepted.
+ * @brief Callback to be called when console message will be logged.
*
* @param[in] callback
*/
- void RegisterRequestInterceptorCallback(Dali::WebEnginePlugin::WebEngineRequestInterceptorCallback callback);
+ void RegisterConsoleMessageReceivedCallback(Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback callback);
/**
- * @brief Callback to be called when console message will be logged.
+ * @brief Callback to be called when response policy would be decided.
*
* @param[in] callback
*/
- void RegisterConsoleMessageReceivedCallback(Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback callback);
+ void RegisterResponsePolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineResponsePolicyDecidedCallback callback);
/**
- * @brief Callback to be called when response policy would be decided.
+ * @brief Callback to be called when navigation policy would be decided.
*
* @param[in] callback
*/
- void RegisterResponsePolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineResponsePolicyDecidedCallback callback);
+ void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
+
+ /**
+ * @brief Callback to be called when a new window would be created.
+ *
+ * @param[in] callback
+ */
+ void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback);
/**
* @brief Callback to be called when certificate need be confirmed.
*/
void RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback);
+ /**
+ * @brief Get a plain text of current web page asynchronously.
+ *
+ * @param[in] callback The callback function called asynchronously.
+ */
+ void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback);
+
public: // Not intended for application developers
/// @cond internal
/**