X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Fweb-view%2Fweb-view.cpp;h=ddc04618345ee0f8882dfc8c3dcbdd9044c9c393;hp=7758f7bd433ed5d4d064a672584b09c3fac93dc3;hb=2f810b8a969d39e569b39107a02dfaf35c0c48bc;hpb=1d82abb8a1a514ce0af63004706135fb7883f89b diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.cpp b/dali-toolkit/devel-api/controls/web-view/web-view.cpp old mode 100644 new mode 100755 index 7758f7b..ddc0461 --- a/dali-toolkit/devel-api/controls/web-view/web-view.cpp +++ b/dali-toolkit/devel-api/controls/web-view/web-view.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -20,6 +20,7 @@ // INTERNAL INCLUDES #include +#include namespace Dali { @@ -58,19 +59,64 @@ WebView WebView::New(const std::string& locale, const std::string& timezoneId) return Internal::WebView::New(locale, timezoneId); } +WebView WebView::New(uint32_t argc, char** argv) +{ + return Internal::WebView::New(argc, argv); +} + +Toolkit::WebView WebView::FindWebView(Dali::WebEnginePlugin* plugin) +{ + return Internal::WebView::FindWebView(plugin); +} + +Dali::WebEngineContext* WebView::GetContext() +{ + return Internal::WebView::GetContext(); +} + +Dali::WebEngineCookieManager* WebView::GetCookieManager() +{ + return Internal::WebView::GetCookieManager(); +} + WebView WebView::DownCast(BaseHandle handle) { return Control::DownCast(handle); } +Dali::Toolkit::WebSettings* WebView::GetSettings() const +{ + return Dali::Toolkit::GetImpl(*this).GetSettings(); +} + +Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const +{ + return Dali::Toolkit::GetImpl(*this).GetBackForwardList(); +} + +Dali::Toolkit::ImageView WebView::GetFavicon() const +{ + return Dali::Toolkit::GetImpl(*this).GetFavicon(); +} + void WebView::LoadUrl(const std::string& url) { Dali::Toolkit::GetImpl(*this).LoadUrl(url); } -void WebView::LoadHTMLString(const std::string& htmlString) +void WebView::LoadHtmlString(const std::string& htmlString) +{ + Dali::Toolkit::GetImpl(*this).LoadHtmlString(htmlString); +} + +bool WebView::LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl) { - Dali::Toolkit::GetImpl(*this).LoadHTMLString(htmlString); + return Dali::Toolkit::GetImpl(*this).LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl); +} + +bool WebView::LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri) +{ + return Dali::Toolkit::GetImpl(*this).LoadContents(contents, contentSize, mimeType, encoding, baseUri); } void WebView::Reload() @@ -78,6 +124,11 @@ void WebView::Reload() Dali::Toolkit::GetImpl(*this).Reload(); } +bool WebView::ReloadWithoutCache() +{ + return Dali::Toolkit::GetImpl(*this).ReloadWithoutCache(); +} + void WebView::StopLoading() { Dali::Toolkit::GetImpl(*this).StopLoading(); @@ -93,6 +144,46 @@ void WebView::Resume() Dali::Toolkit::GetImpl(*this).Resume(); } +void WebView::SuspendNetworkLoading() +{ + Dali::Toolkit::GetImpl(*this).SuspendNetworkLoading(); +} + +void WebView::ResumeNetworkLoading() +{ + Dali::Toolkit::GetImpl(*this).ResumeNetworkLoading(); +} + +bool WebView::AddCustomHeader(const std::string& name, const std::string& value) +{ + return Dali::Toolkit::GetImpl(*this).AddCustomHeader(name, value); +} + +bool WebView::RemoveCustomHeader(const std::string& name) +{ + return Dali::Toolkit::GetImpl(*this).RemoveCustomHeader(name); +} + +uint32_t WebView::StartInspectorServer(uint32_t port) +{ + return Dali::Toolkit::GetImpl(*this).StartInspectorServer(port); +} + +bool WebView::StopInspectorServer() +{ + return Dali::Toolkit::GetImpl(*this).StopInspectorServer(); +} + +void WebView::ScrollBy(int32_t deltaX, int32_t deltaY) +{ + Dali::Toolkit::GetImpl(*this).ScrollBy(deltaX, deltaY); +} + +bool WebView::ScrollEdgeBy(int32_t deltaX, int32_t deltaY) +{ + return Dali::Toolkit::GetImpl(*this).ScrollEdgeBy(deltaX, deltaY); +} + bool WebView::CanGoForward() { return Dali::Toolkit::GetImpl(*this).CanGoForward(); @@ -113,7 +204,7 @@ void WebView::GoBack() Dali::Toolkit::GetImpl(*this).GoBack(); } -void WebView::EvaluateJavaScript(const std::string& script, std::function resultHandler) +void WebView::EvaluateJavaScript(const std::string& script, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback resultHandler) { Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, resultHandler); } @@ -123,39 +214,194 @@ void WebView::EvaluateJavaScript(const std::string& script) Dali::Toolkit::GetImpl(*this).EvaluateJavaScript(script, nullptr); } -void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler) +void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback handler) { Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler); } +void WebView::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterJavaScriptAlertCallback(callback); +} + +void WebView::JavaScriptAlertReply() +{ + Dali::Toolkit::GetImpl(*this).JavaScriptAlertReply(); +} + +void WebView::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterJavaScriptConfirmCallback(callback); +} + +void WebView::JavaScriptConfirmReply(bool confirmed) +{ + Dali::Toolkit::GetImpl(*this).JavaScriptConfirmReply(confirmed); +} + +void WebView::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterJavaScriptPromptCallback(callback); +} + +void WebView::JavaScriptPromptReply(const std::string& result) +{ + Dali::Toolkit::GetImpl(*this).JavaScriptPromptReply(result); +} + +std::unique_ptr WebView::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode) +{ + return Dali::Toolkit::GetImpl(*this).CreateHitTest(x, y, mode); +} + +bool WebView::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback) +{ + return Dali::Toolkit::GetImpl(*this).CreateHitTestAsynchronously(x, y, mode, callback); +} + void WebView::ClearHistory() { Dali::Toolkit::GetImpl(*this).ClearHistory(); } -void WebView::ClearCache() +void WebView::ClearAllTilesResources() +{ + Dali::Toolkit::GetImpl(*this).ClearAllTilesResources(); +} + +void WebView::SetScaleFactor(float scaleFactor, Dali::Vector2 point) +{ + Dali::Toolkit::GetImpl(*this).SetScaleFactor(scaleFactor, point); +} + +float WebView::GetScaleFactor() const +{ + return Dali::Toolkit::GetImpl(*this).GetScaleFactor(); +} + +void WebView::ActivateAccessibility(bool activated) +{ + Dali::Toolkit::GetImpl(*this).ActivateAccessibility(activated); +} + +bool WebView::HighlightText(const std::string& text, Dali::WebEnginePlugin::FindOption options, uint32_t maxMatchCount) +{ + return Dali::Toolkit::GetImpl(*this).HighlightText(text, options, maxMatchCount); +} + +void WebView::AddDynamicCertificatePath(const std::string& host, const std::string& certPath) +{ + Dali::Toolkit::GetImpl(*this).AddDynamicCertificatePath(host, certPath); +} + +Dali::Toolkit::ImageView WebView::GetScreenshot(Dali::Rect viewArea, float scaleFactor) +{ + return Dali::Toolkit::GetImpl(*this).GetScreenshot(viewArea, scaleFactor); +} + +bool WebView::GetScreenshotAsynchronously(Dali::Rect viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback) +{ + return Dali::Toolkit::GetImpl(*this).GetScreenshotAsynchronously(viewArea, scaleFactor, callback); +} + +bool WebView::CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback) +{ + return Dali::Toolkit::GetImpl(*this).CheckVideoPlayingAsynchronously(callback); +} + +void WebView::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterGeolocationPermissionCallback(callback); +} + +void WebView::SetTtsFocus(bool focused) +{ + Dali::Toolkit::GetImpl(*this).SetTtsFocus(focused); +} + +void WebView::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterPageLoadStartedCallback(callback); +} + +void WebView::RegisterPageLoadInProgressCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterPageLoadInProgressCallback(callback); +} + +void WebView::RegisterPageLoadFinishedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterPageLoadFinishedCallback(callback); +} + +void WebView::RegisterPageLoadErrorCallback(Dali::WebEnginePlugin::WebEnginePageLoadErrorCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterPageLoadErrorCallback(callback); +} + +void WebView::RegisterScrollEdgeReachedCallback(Dali::WebEnginePlugin::WebEngineScrollEdgeReachedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterScrollEdgeReachedCallback(callback); +} + +void WebView::RegisterUrlChangedCallback(Dali::WebEnginePlugin::WebEngineUrlChangedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterUrlChangedCallback(callback); +} + +void WebView::RegisterFormRepostDecidedCallback(Dali::WebEnginePlugin::WebEngineFormRepostDecidedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterFormRepostDecidedCallback(callback); +} + +void WebView::RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterFrameRenderedCallback(callback); +} + +void WebView::RegisterConsoleMessageReceivedCallback(Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterConsoleMessageReceivedCallback(callback); +} + +void WebView::RegisterResponsePolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineResponsePolicyDecidedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterResponsePolicyDecidedCallback(callback); +} + +void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterNavigationPolicyDecidedCallback(callback); +} + +void WebView::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterCertificateConfirmedCallback(callback); +} + +void WebView::RegisterSslCertificateChangedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback) { - Dali::Toolkit::GetImpl(*this).ClearCache(); + Dali::Toolkit::GetImpl(*this).RegisterSslCertificateChangedCallback(callback); } -void WebView::ClearCookies() +void WebView::RegisterHttpAuthHandlerCallback(Dali::WebEnginePlugin::WebEngineHttpAuthHandlerCallback callback) { - Dali::Toolkit::GetImpl(*this).ClearCookies(); + Dali::Toolkit::GetImpl(*this).RegisterHttpAuthHandlerCallback(callback); } -WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal() +void WebView::RegisterContextMenuShownCallback(Dali::WebEnginePlugin::WebEngineContextMenuShownCallback callback) { - return Dali::Toolkit::GetImpl(*this).PageLoadStartedSignal(); + Dali::Toolkit::GetImpl(*this).RegisterContextMenuShownCallback(callback); } -WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal() +void WebView::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback) { - return Dali::Toolkit::GetImpl(*this).PageLoadFinishedSignal(); + Dali::Toolkit::GetImpl(*this).RegisterContextMenuHiddenCallback(callback); } -WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSignal() +void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback) { - return Dali::Toolkit::GetImpl(*this).PageLoadErrorSignal(); + Dali::Toolkit::GetImpl(*this).GetPlainTextAsynchronously(callback); } WebView::WebView(Internal::WebView& implementation)