Use c-style string when webview loads contents.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine / web-engine.cpp
index 4176021..97b70c1 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 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.
@@ -57,20 +57,24 @@ WebEngine WebEngine::New()
   return WebEngine(engine.Get());
 }
 
-WebEngine::WebEngine(const WebEngine& webEngine)
-: BaseHandle(webEngine)
+Dali::WebEngineContext* WebEngine::GetContext()
 {
+  return Internal::Adaptor::WebEngine::GetContext();
 }
 
-WebEngine& WebEngine::operator=(const WebEngine& webEngine)
+Dali::WebEngineCookieManager* WebEngine::GetCookieManager()
 {
-  if(*this != webEngine)
-  {
-    BaseHandle::operator=(webEngine);
-  }
-  return *this;
+  return Internal::Adaptor::WebEngine::GetCookieManager();
 }
 
+WebEngine::WebEngine(const WebEngine& webEngine) = default;
+
+WebEngine& WebEngine::operator=(const WebEngine& webEngine) = default;
+
+WebEngine::WebEngine(WebEngine&& webEngine) = default;
+
+WebEngine& WebEngine::operator=(WebEngine&& webEngine) = default;
+
 WebEngine WebEngine::DownCast(BaseHandle handle)
 {
   return WebEngine(dynamic_cast<Internal::Adaptor::WebEngine*>(handle.GetObjectPtr()));
@@ -91,6 +95,11 @@ void WebEngine::Destroy()
   GetImplementation(*this).Destroy();
 }
 
+Dali::WebEnginePlugin* WebEngine::GetPlugin() const
+{
+  return GetImplementation(*this).GetPlugin();
+}
+
 NativeImageSourcePtr WebEngine::GetNativeImageSource()
 {
   return GetImplementation(*this).GetNativeImageSource();
@@ -101,16 +110,6 @@ Dali::WebEngineSettings& WebEngine::GetSettings() const
   return GetImplementation(*this).GetSettings();
 }
 
-Dali::WebEngineContext& WebEngine::GetContext() const
-{
-  return GetImplementation(*this).GetContext();
-}
-
-Dali::WebEngineCookieManager& WebEngine::GetCookieManager() const
-{
-  return GetImplementation(*this).GetCookieManager();
-}
-
 Dali::WebEngineBackForwardList& WebEngine::GetBackForwardList() const
 {
   return GetImplementation(*this).GetBackForwardList();
@@ -146,7 +145,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);
 }
@@ -481,9 +480,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)
@@ -536,6 +535,11 @@ void WebEngine::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::W
   GetImplementation(*this).RegisterNavigationPolicyDecidedCallback(callback);
 }
 
+void WebEngine::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+  GetImplementation(*this).RegisterNewWindowCreatedCallback(callback);
+}
+
 void WebEngine::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
 {
   GetImplementation(*this).RegisterCertificateConfirmedCallback(callback);