using WebEngineNavigationPolicyDecidedCallback = std::function<void(std::unique_ptr<Dali::WebEnginePolicyDecision>)>;
/**
+ * @brief WebView callback related with a new window would be created.
+ */
+ using WebEngineNewWindowCreatedCallback = std::function<void(Dali::WebEnginePlugin*&)>;
+
+ /**
* @brief Enumeration for the scroll edge.
*/
enum class ScrollEdge
*
* @return Url of string type
*/
- virtual const std::string& GetUrl() = 0;
+ virtual std::string GetUrl() const = 0;
/**
* @brief Loads a given string as web contents.
*
* @return The string value of user agent
*/
- virtual const std::string& GetUserAgent() const = 0;
+ virtual std::string GetUserAgent() const = 0;
/**
* @brief Set user agent string.
virtual void RegisterNavigationPolicyDecidedCallback(WebEngineNavigationPolicyDecidedCallback callback) = 0;
/**
+ * @brief Callback to be called when a new window would be created.
+ *
+ * @param[in] callback
+ */
+ virtual void RegisterNewWindowCreatedCallback(WebEngineNewWindowCreatedCallback callback) = 0;
+
+ /**
* @brief Get a plain text of current web page asynchronously.
*
* @param[in] callback The callback function called asynchronously.
GetImplementation(*this).Destroy();
}
+WebEnginePlugin* WebEngine::GetPlugin() const
+{
+ return GetImplementation(*this).GetPlugin();
+}
+
NativeImageInterfacePtr WebEngine::GetNativeImageSource()
{
return GetImplementation(*this).GetNativeImageSource();
return GetImplementation(*this).GetFavicon();
}
-const std::string& WebEngine::GetUrl()
+std::string WebEngine::GetUrl() const
{
return GetImplementation(*this).GetUrl();
}
return GetImplementation(*this).ClearHistory();
}
-const std::string& WebEngine::GetUserAgent() const
+std::string WebEngine::GetUserAgent() const
{
return GetImplementation(*this).GetUserAgent();
}
GetImplementation(*this).RegisterNavigationPolicyDecidedCallback(callback);
}
+void WebEngine::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+ GetImplementation(*this).RegisterNewWindowCreatedCallback(callback);
+}
+
void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
{
GetImplementation(*this).GetPlainTextAsynchronously(callback);
void Destroy();
/**
+ * @brief Gets web engine plugin.
+ */
+ Dali::WebEnginePlugin* GetPlugin() const;
+
+ /**
* @brief Gets native image source to render.
*/
NativeImageInterfacePtr GetNativeImageSource();
/**
* @brief Gets the url.
*/
- const std::string& GetUrl();
+ std::string GetUrl() const;
/**
* @brief Loads a given string as web contents.
*
* @return The string value of user agent
*/
- const std::string& GetUserAgent() const;
+ std::string GetUserAgent() const;
/**
* @brief Set user agent string.
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 Get a plain text of current web page asynchronously.
*
* @param[in] callback The callback function called asynchronously.
mPlugin->Create(width, height, argc, argv);
}
+Dali::WebEnginePlugin* WebEngine::GetPlugin() const
+{
+ return mPlugin;
+}
+
void WebEngine::Destroy()
{
mPlugin->Destroy();
return mPlugin->GetFavicon();
}
-const std::string& WebEngine::GetUrl()
+std::string WebEngine::GetUrl() const
{
return mPlugin->GetUrl();
}
-const std::string& WebEngine::GetUserAgent() const
+std::string WebEngine::GetUserAgent() const
{
return mPlugin->GetUserAgent();
}
mPlugin->RegisterNavigationPolicyDecidedCallback(callback);
}
+void WebEngine::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+ mPlugin->RegisterNewWindowCreatedCallback(callback);
+}
+
void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
{
mPlugin->GetPlainTextAsynchronously(callback);
void Destroy();
/**
+ * @copydoc Dali::WebEngine::GetPlugin()
+ */
+ Dali::WebEnginePlugin* GetPlugin() const;
+
+ /**
* @copydoc Dali::WebEngine::GetNativeImageSource()
*/
Dali::NativeImageInterfacePtr GetNativeImageSource();
/**
* @copydoc Dali::WebEngine::GetUrl()
*/
- const std::string& GetUrl();
+ std::string GetUrl() const;
/**
* @copydoc Dali::WebEngine::GetUserAgent()
*/
- const std::string& GetUserAgent() const;
+ std::string GetUserAgent() const;
/**
* @copydoc Dali::WebEngine::SetUserAgent()
void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
/**
+ @copydoc Dali::WebEngine::RegisterNewWindowCreatedCallback()
+ */
+ void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback);
+
+ /**
* @copydoc Dali::WebEngine::GetPlainTextAsynchronously()
*/
void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback);