From a817fa28906ba810b84ebbf5bce8a98142e9a9c0 Mon Sep 17 00:00:00 2001 From: "huayong.xu" Date: Fri, 2 Feb 2024 14:54:15 +0800 Subject: [PATCH] [Tizen] Add a WebView API for notifying orientation change. Change-Id: I74d7f99e28b4a681f918a45a109bc25d7a46371b --- dali-toolkit/devel-api/controls/web-view/web-view.cpp | 7 ++++++- dali-toolkit/devel-api/controls/web-view/web-view.h | 7 ++++++- dali-toolkit/internal/controls/web-view/web-view-impl.cpp | 10 +++++++++- dali-toolkit/internal/controls/web-view/web-view-impl.h | 7 ++++++- 4 files changed, 27 insertions(+), 4 deletions(-) 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 3b0f3b6..422acfd 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 42b78bc..7585bab 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. @@ -270,6 +270,11 @@ public: static WebView DownCast(BaseHandle handle); /** + * @brief Change orientation. + */ + void ChangeOrientation(int orientation); + + /** * @brief Get WebSettings of WebEngine. */ Dali::Toolkit::WebSettings* GetSettings() const; 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 dff4083..ecf9afd 100755 --- 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. @@ -261,6 +261,14 @@ DevelControl::ControlAccessible* WebView::CreateAccessibleObject() return new WebViewAccessible(Self(), mWebEngine); } +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 e6c8092..e463669 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. @@ -89,6 +89,11 @@ public: static Dali::WebEngineCookieManager* GetCookieManager(); /** + * @copydoc Dali::Toolkit::WebView::ChangeOrientation() + */ + void ChangeOrientation(int orientation); + + /** * @copydoc Dali::Toolkit::WebView::GetSettings() */ Dali::Toolkit::WebSettings* GetSettings() const; -- 2.7.4