X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fweb-engine.cpp;h=86f67f1273dcd2486138b5ed064ec93471fe29cb;hb=7f9f13e07e11fb8acbe4d0efdd04a5fa24b01348;hp=46130fac9df9eab4d782682a10fb05bf76877dec;hpb=531f08e6553f09e0ffd06f4ec20531a5a23959f2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/web-engine.cpp b/dali/devel-api/adaptor-framework/web-engine.cpp index 46130fa..86f67f1 100755 --- a/dali/devel-api/adaptor-framework/web-engine.cpp +++ b/dali/devel-api/adaptor-framework/web-engine.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. @@ -15,16 +15,27 @@ * */ -// CLASS HEADER +// CLASSHEADER #include // INTERNAL INCLUDES #include +#include +#include +#include +#include #include #include +#include +#include +#include +#include #include #include +// EXTERNAL INCLUDES +#include + namespace Dali { WebEngine::WebEngine() @@ -66,11 +77,16 @@ WebEngine WebEngine::DownCast(BaseHandle handle) return WebEngine(dynamic_cast(handle.GetObjectPtr())); } -void WebEngine::Create(int width, int height, const std::string& locale, const std::string& timezoneId) +void WebEngine::Create(uint32_t width, uint32_t height, const std::string& locale, const std::string& timezoneId) { GetImplementation(*this).Create(width, height, locale, timezoneId); } +void WebEngine::Create(uint32_t width, uint32_t height, uint32_t argc, char** argv) +{ + GetImplementation(*this).Create(width, height, argc, argv); +} + void WebEngine::Destroy() { GetImplementation(*this).Destroy(); @@ -83,22 +99,22 @@ NativeImageInterfacePtr WebEngine::GetNativeImageSource() Dali::WebEngineSettings& WebEngine::GetSettings() const { - return GetImplementation( *this ).GetSettings(); + return GetImplementation(*this).GetSettings(); } Dali::WebEngineContext& WebEngine::GetContext() const { - return GetImplementation( *this ).GetContext(); + return GetImplementation(*this).GetContext(); } Dali::WebEngineCookieManager& WebEngine::GetCookieManager() const { - return GetImplementation( *this ).GetCookieManager(); + return GetImplementation(*this).GetCookieManager(); } Dali::WebEngineBackForwardList& WebEngine::GetBackForwardList() const { - return GetImplementation( *this ).GetBackForwardList(); + return GetImplementation(*this).GetBackForwardList(); } void WebEngine::LoadUrl(const std::string& url) @@ -106,7 +122,17 @@ void WebEngine::LoadUrl(const std::string& url) return GetImplementation(*this).LoadUrl(url); } -const std::string& WebEngine::GetUrl() +std::string WebEngine::GetTitle() const +{ + return GetImplementation(*this).GetTitle(); +} + +Dali::PixelData WebEngine::GetFavicon() const +{ + return GetImplementation(*this).GetFavicon(); +} + +std::string WebEngine::GetUrl() const { return GetImplementation(*this).GetUrl(); } @@ -116,11 +142,26 @@ void WebEngine::LoadHtmlString(const std::string& htmlString) GetImplementation(*this).LoadHtmlString(htmlString); } +bool WebEngine::LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl) +{ + return GetImplementation(*this).LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl); +} + +bool WebEngine::LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri) +{ + return GetImplementation(*this).LoadContents(contents, contentSize, mimeType, encoding, baseUri); +} + void WebEngine::Reload() { GetImplementation(*this).Reload(); } +bool WebEngine::ReloadWithoutCache() +{ + return GetImplementation(*this).ReloadWithoutCache(); +} + void WebEngine::StopLoading() { GetImplementation(*this).StopLoading(); @@ -136,29 +177,64 @@ void WebEngine::Resume() GetImplementation(*this).Resume(); } -void WebEngine::ScrollBy( int deltaX, int deltaY ) +void WebEngine::SuspendNetworkLoading() +{ + GetImplementation(*this).SuspendNetworkLoading(); +} + +void WebEngine::ResumeNetworkLoading() +{ + GetImplementation(*this).ResumeNetworkLoading(); +} + +bool WebEngine::AddCustomHeader(const std::string& name, const std::string& value) +{ + return GetImplementation(*this).AddCustomHeader(name, value); +} + +bool WebEngine::RemoveCustomHeader(const std::string& name) +{ + return GetImplementation(*this).RemoveCustomHeader(name); +} + +uint32_t WebEngine::StartInspectorServer(uint32_t port) +{ + return GetImplementation(*this).StartInspectorServer(port); +} + +bool WebEngine::StopInspectorServer() { - GetImplementation( *this ).ScrollBy( deltaX, deltaY ); + return GetImplementation(*this).StopInspectorServer(); } -void WebEngine::SetScrollPosition( int x, int y ) +void WebEngine::ScrollBy(int32_t deltaX, int32_t deltaY) { - GetImplementation( *this ).SetScrollPosition( x, y ); + GetImplementation(*this).ScrollBy(deltaX, deltaY); } -void WebEngine::GetScrollPosition( int& x, int& y ) const +bool WebEngine::ScrollEdgeBy(int32_t deltaX, int32_t deltaY) { - GetImplementation( *this ).GetScrollPosition( x, y ); + return GetImplementation(*this).ScrollEdgeBy(deltaX, deltaY); } -void WebEngine::GetScrollSize( int& width, int& height ) const +void WebEngine::SetScrollPosition(int32_t x, int32_t y) { - GetImplementation( *this ).GetScrollSize( width, height ); + GetImplementation(*this).SetScrollPosition(x, y); } -void WebEngine::GetContentSize( int& width, int& height ) const +Dali::Vector2 WebEngine::GetScrollPosition() const { - GetImplementation( *this ).GetContentSize( width, height ); + return GetImplementation(*this).GetScrollPosition(); +} + +Dali::Vector2 WebEngine::GetScrollSize() const +{ + return GetImplementation(*this).GetScrollSize(); +} + +Dali::Vector2 WebEngine::GetContentSize() const +{ + return GetImplementation(*this).GetContentSize(); } bool WebEngine::CanGoForward() @@ -181,22 +257,67 @@ void WebEngine::GoBack() GetImplementation(*this).GoBack(); } -void WebEngine::EvaluateJavaScript(const std::string& script, std::function resultHandler) +void WebEngine::EvaluateJavaScript(const std::string& script, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback resultHandler) { GetImplementation(*this).EvaluateJavaScript(script, resultHandler); } -void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function handler) +void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback handler) { GetImplementation(*this).AddJavaScriptMessageHandler(exposedObjectName, handler); } +void WebEngine::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback) +{ + GetImplementation(*this).RegisterJavaScriptAlertCallback(callback); +} + +void WebEngine::JavaScriptAlertReply() +{ + GetImplementation(*this).JavaScriptAlertReply(); +} + +void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback) +{ + GetImplementation(*this).RegisterJavaScriptConfirmCallback(callback); +} + +void WebEngine::JavaScriptConfirmReply(bool confirmed) +{ + GetImplementation(*this).JavaScriptConfirmReply(confirmed); +} + +void WebEngine::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback) +{ + GetImplementation(*this).RegisterJavaScriptPromptCallback(callback); +} + +void WebEngine::JavaScriptPromptReply(const std::string& result) +{ + GetImplementation(*this).JavaScriptPromptReply(result); +} + +std::unique_ptr WebEngine::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode) +{ + return GetImplementation(*this).CreateHitTest(x, y, mode); +} + +bool WebEngine::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback) +{ + return GetImplementation(*this).CreateHitTestAsynchronously(x, y, mode, callback); +} + void WebEngine::ClearHistory() { - return GetImplementation(*this).ClearHistory(); + GetImplementation(*this).ClearHistory(); } -const std::string& WebEngine::GetUserAgent() const +void WebEngine::ClearAllTilesResources() +{ + GetImplementation(*this).ClearAllTilesResources(); +} + +std::string WebEngine::GetUserAgent() const { return GetImplementation(*this).GetUserAgent(); } @@ -206,9 +327,34 @@ void WebEngine::SetUserAgent(const std::string& userAgent) GetImplementation(*this).SetUserAgent(userAgent); } -void WebEngine::SetSize(int width, int height) +void WebEngine::SetSize(uint32_t width, uint32_t height) +{ + GetImplementation(*this).SetSize(width, height); +} + +void WebEngine::SetDocumentBackgroundColor(Dali::Vector4 color) +{ + GetImplementation(*this).SetDocumentBackgroundColor(color); +} + +void WebEngine::ClearTilesWhenHidden(bool cleared) +{ + GetImplementation(*this).ClearTilesWhenHidden(cleared); +} + +void WebEngine::SetTileCoverAreaMultiplier(float multiplier) +{ + GetImplementation(*this).SetTileCoverAreaMultiplier(multiplier); +} + +void WebEngine::EnableCursorByClient(bool enabled) { - return GetImplementation(*this).SetSize(width, height); + GetImplementation(*this).EnableCursorByClient(enabled); +} + +std::string WebEngine::GetSelectedText() const +{ + return GetImplementation(*this).GetSelectedText(); } bool WebEngine::SendTouchEvent(const TouchEvent& touch) @@ -221,29 +367,199 @@ bool WebEngine::SendKeyEvent(const KeyEvent& event) return GetImplementation(*this).SendKeyEvent(event); } -void WebEngine::SetFocus( bool focused ) +bool WebEngine::SendHoverEvent(const HoverEvent& event) +{ + return GetImplementation(*this).SendHoverEvent(event); +} + +bool WebEngine::SendWheelEvent(const WheelEvent& event) +{ + return GetImplementation(*this).SendWheelEvent(event); +} + +void WebEngine::SetFocus(bool focused) +{ + GetImplementation(*this).SetFocus(focused); +} + +void WebEngine::SetPageZoomFactor(float zoomFactor) +{ + GetImplementation(*this).SetPageZoomFactor(zoomFactor); +} + +float WebEngine::GetPageZoomFactor() const +{ + return GetImplementation(*this).GetPageZoomFactor(); +} + +void WebEngine::SetTextZoomFactor(float zoomFactor) +{ + GetImplementation(*this).SetTextZoomFactor(zoomFactor); +} + +float WebEngine::GetTextZoomFactor() const +{ + return GetImplementation(*this).GetTextZoomFactor(); +} + +float WebEngine::GetLoadProgressPercentage() const +{ + return GetImplementation(*this).GetLoadProgressPercentage(); +} + +void WebEngine::SetScaleFactor(float scaleFactor, Dali::Vector2 point) +{ + GetImplementation(*this).SetScaleFactor(scaleFactor, point); +} + +float WebEngine::GetScaleFactor() const +{ + return GetImplementation(*this).GetScaleFactor(); +} + +void WebEngine::ActivateAccessibility(bool activated) +{ + GetImplementation(*this).ActivateAccessibility(activated); +} + +bool WebEngine::SetVisibility(bool visible) +{ + return GetImplementation(*this).SetVisibility(visible); +} + +bool WebEngine::HighlightText(const std::string& text, Dali::WebEnginePlugin::FindOption options, uint32_t maxMatchCount) +{ + return GetImplementation(*this).HighlightText(text, options, maxMatchCount); +} + +void WebEngine::AddDynamicCertificatePath(const std::string& host, const std::string& certPath) +{ + GetImplementation(*this).AddDynamicCertificatePath(host, certPath); +} + +Dali::PixelData WebEngine::GetScreenshot(Dali::Rect viewArea, float scaleFactor) +{ + return GetImplementation(*this).GetScreenshot(viewArea, scaleFactor); +} + +bool WebEngine::GetScreenshotAsynchronously(Dali::Rect viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback) +{ + return GetImplementation(*this).GetScreenshotAsynchronously(viewArea, scaleFactor, callback); +} + +bool WebEngine::CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback) +{ + return GetImplementation(*this).CheckVideoPlayingAsynchronously(callback); +} + +void WebEngine::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback) +{ + GetImplementation(*this).RegisterGeolocationPermissionCallback(callback); +} + +void WebEngine::UpdateDisplayArea(Dali::Rect displayArea) +{ + GetImplementation(*this).UpdateDisplayArea(displayArea); +} + +void WebEngine::EnableMouseEvents(bool enabled) +{ + GetImplementation(*this).EnableMouseEvents(enabled); +} + +void WebEngine::EnableKeyEvents(bool enabled) +{ + GetImplementation(*this).EnableKeyEvents(enabled); +} + +void WebEngine::EnableVideoHole(bool enabled) +{ + GetImplementation(*this).EnableVideoHole(enabled); +} + +Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal() +{ + return GetImplementation(*this).FrameRenderedSignal(); +} + +void WebEngine::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback) +{ + GetImplementation(*this).RegisterPageLoadStartedCallback(callback); +} + +void WebEngine::RegisterPageLoadInProgressCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback) +{ + GetImplementation(*this).RegisterPageLoadInProgressCallback(callback); +} + +void WebEngine::RegisterPageLoadFinishedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback) +{ + GetImplementation(*this).RegisterPageLoadFinishedCallback(callback); +} + +void WebEngine::RegisterPageLoadErrorCallback(Dali::WebEnginePlugin::WebEnginePageLoadErrorCallback callback) +{ + GetImplementation(*this).RegisterPageLoadErrorCallback(callback); +} + +void WebEngine::RegisterScrollEdgeReachedCallback(Dali::WebEnginePlugin::WebEngineScrollEdgeReachedCallback callback) +{ + GetImplementation(*this).RegisterScrollEdgeReachedCallback(callback); +} + +void WebEngine::RegisterUrlChangedCallback(Dali::WebEnginePlugin::WebEngineUrlChangedCallback callback) +{ + GetImplementation(*this).RegisterUrlChangedCallback(callback); +} + +void WebEngine::RegisterFormRepostDecidedCallback(Dali::WebEnginePlugin::WebEngineFormRepostDecidedCallback callback) +{ + GetImplementation(*this).RegisterFormRepostDecidedCallback(callback); +} + +void WebEngine::RegisterRequestInterceptorCallback(Dali::WebEnginePlugin::WebEngineRequestInterceptorCallback callback) +{ + GetImplementation(*this).RegisterRequestInterceptorCallback(callback); +} + +void WebEngine::RegisterConsoleMessageReceivedCallback(Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback callback) +{ + GetImplementation(*this).RegisterConsoleMessageReceivedCallback(callback); +} + +void WebEngine::RegisterResponsePolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineResponsePolicyDecidedCallback callback) +{ + GetImplementation(*this).RegisterResponsePolicyDecidedCallback(callback); +} + +void WebEngine::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback) +{ + GetImplementation(*this).RegisterCertificateConfirmedCallback(callback); +} + +void WebEngine::RegisterSslCertificateChangedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback) { - GetImplementation( *this ).SetFocus( focused ); + GetImplementation(*this).RegisterSslCertificateChangedCallback(callback); } -Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal() +void WebEngine::RegisterHttpAuthHandlerCallback(Dali::WebEnginePlugin::WebEngineHttpAuthHandlerCallback callback) { - return GetImplementation(*this).PageLoadStartedSignal(); + GetImplementation(*this).RegisterHttpAuthHandlerCallback(callback); } -Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal() +void WebEngine::RegisterContextMenuShownCallback(Dali::WebEnginePlugin::WebEngineContextMenuShownCallback callback) { - return GetImplementation(*this).PageLoadFinishedSignal(); + GetImplementation(*this).RegisterContextMenuShownCallback(callback); } -Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal() +void WebEngine::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback) { - return GetImplementation(*this).PageLoadErrorSignal(); + GetImplementation(*this).RegisterContextMenuHiddenCallback(callback); } -Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal() +void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback) { - return GetImplementation( *this ).ScrollEdgeReachedSignal(); + GetImplementation(*this).GetPlainTextAsynchronously(callback); } } // namespace Dali