[Tizen] Add a WebView API for notifying orientation change.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine / web-engine.cpp
index bba76f0..4d8fb89 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -67,19 +67,13 @@ Dali::WebEngineCookieManager* WebEngine::GetCookieManager()
   return Internal::Adaptor::WebEngine::GetCookieManager();
 }
 
-WebEngine::WebEngine(const WebEngine& webEngine)
-: BaseHandle(webEngine)
-{
-}
+WebEngine::WebEngine(const WebEngine& webEngine) = default;
 
-WebEngine& WebEngine::operator=(const WebEngine& webEngine)
-{
-  if(*this != webEngine)
-  {
-    BaseHandle::operator=(webEngine);
-  }
-  return *this;
-}
+WebEngine& WebEngine::operator=(const WebEngine& webEngine) = default;
+
+WebEngine::WebEngine(WebEngine&& webEngine) = default;
+
+WebEngine& WebEngine::operator=(WebEngine&& webEngine) = default;
 
 WebEngine WebEngine::DownCast(BaseHandle handle)
 {
@@ -111,6 +105,11 @@ NativeImageSourcePtr WebEngine::GetNativeImageSource()
   return GetImplementation(*this).GetNativeImageSource();
 }
 
+void WebEngine::ChangeOrientation(int orientation)
+{
+  return GetImplementation(*this).ChangeOrientation(orientation);
+}
+
 Dali::WebEngineSettings& WebEngine::GetSettings() const
 {
   return GetImplementation(*this).GetSettings();
@@ -151,7 +150,7 @@ bool WebEngine::LoadHtmlStringOverrideCurrentEntry(const std::string& html, cons
   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)
+bool WebEngine::LoadContents(const int8_t* 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);
 }
@@ -381,6 +380,11 @@ bool WebEngine::SendWheelEvent(const WheelEvent& event)
   return GetImplementation(*this).SendWheelEvent(event);
 }
 
+void WebEngine::ExitFullscreen()
+{
+  GetImplementation(*this).ExitFullscreen();
+}
+
 void WebEngine::SetFocus(bool focused)
 {
   GetImplementation(*this).SetFocus(focused);
@@ -486,9 +490,9 @@ void WebEngine::EnableVideoHole(bool enabled)
   GetImplementation(*this).EnableVideoHole(enabled);
 }
 
-Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
+void WebEngine::RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback)
 {
-  return GetImplementation(*this).FrameRenderedSignal();
+  GetImplementation(*this).RegisterFrameRenderedCallback(callback);
 }
 
 void WebEngine::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
@@ -541,6 +545,16 @@ void WebEngine::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::W
   GetImplementation(*this).RegisterNavigationPolicyDecidedCallback(callback);
 }
 
+void WebEngine::RegisterNewWindowPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNewWindowPolicyDecidedCallback callback)
+{
+  GetImplementation(*this).RegisterNewWindowPolicyDecidedCallback(callback);
+}
+
+void WebEngine::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+  GetImplementation(*this).RegisterNewWindowCreatedCallback(callback);
+}
+
 void WebEngine::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
 {
   GetImplementation(*this).RegisterCertificateConfirmedCallback(callback);
@@ -566,6 +580,21 @@ void WebEngine::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngi
   GetImplementation(*this).RegisterContextMenuHiddenCallback(callback);
 }
 
+void WebEngine::RegisterFullscreenEnteredCallback(Dali::WebEnginePlugin::WebEngineFullscreenEnteredCallback callback)
+{
+  GetImplementation(*this).RegisterFullscreenEnteredCallback(callback);
+}
+
+void WebEngine::RegisterFullscreenExitedCallback(Dali::WebEnginePlugin::WebEngineFullscreenExitedCallback callback)
+{
+  GetImplementation(*this).RegisterFullscreenExitedCallback(callback);
+}
+
+void WebEngine::RegisterTextFoundCallback(Dali::WebEnginePlugin::WebEngineTextFoundCallback callback)
+{
+  GetImplementation(*this).RegisterTextFoundCallback(callback);
+}
+
 void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
 {
   GetImplementation(*this).GetPlainTextAsynchronously(callback);