From: huayong.xu Date: Fri, 2 Feb 2024 06:54:15 +0000 (+0800) Subject: [Tizen] Add a WebView API for notifying orientation change. X-Git-Tag: accepted/tizen/8.0/unified/20240208.163212~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2f5ae42edfe378ff63a58641ea96dfcd19ca93f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [Tizen] Add a WebView API for notifying orientation change. Change-Id: I74d7f99e28b4a681f918a45a109bc25d7a46371b --- diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.cpp b/dali-toolkit/devel-api/controls/web-view/web-view.cpp index 63d9cca023..76af06ca7e 100755 --- 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) 2023 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. @@ -84,6 +84,11 @@ WebView WebView::DownCast(BaseHandle handle) return Control::DownCast(handle); } +void WebView::ChangeOrientation(int orientation) +{ + return Dali::Toolkit::GetImpl(*this).ChangeOrientation(orientation); +} + Dali::Toolkit::WebSettings* WebView::GetSettings() const { return Dali::Toolkit::GetImpl(*this).GetSettings(); diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.h b/dali-toolkit/devel-api/controls/web-view/web-view.h index 0ee8af7449..274676acf9 100755 --- a/dali-toolkit/devel-api/controls/web-view/web-view.h +++ b/dali-toolkit/devel-api/controls/web-view/web-view.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_WEB_VIEW_H /* - * Copyright (c) 2023 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. @@ -269,6 +269,11 @@ public: */ static WebView DownCast(BaseHandle handle); + /** + * @brief Change orientation. + */ + void ChangeOrientation(int orientation); + /** * @brief Get WebSettings of WebEngine. */ diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp index 696b8e2dd8..ffafdca589 100644 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 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. @@ -316,6 +316,14 @@ void WebView::OnRelayout(const Vector2& size, RelayoutContainer& container) SetDisplayArea(displayArea); } +void WebView::ChangeOrientation(int orientation) +{ + if(mWebEngine) + { + mWebEngine.ChangeOrientation(orientation); + } +} + Dali::Toolkit::WebSettings* WebView::GetSettings() const { return mWebSettings.get(); diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.h b/dali-toolkit/internal/controls/web-view/web-view-impl.h index 5cf24e549b..8e727d6b55 100755 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.h +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_WEB_VIEW_H /* - * Copyright (c) 2023 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. @@ -87,6 +87,11 @@ public: */ static Dali::WebEngineCookieManager* GetCookieManager(); + /** + * @copydoc Dali::Toolkit::WebView::ChangeOrientation() + */ + void ChangeOrientation(int orientation); + /** * @copydoc Dali::Toolkit::WebView::GetSettings() */