1 /* 2 * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_OVERLAY_OVERLAY_MANAGER_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_OVERLAY_OVERLAY_MANAGER_H 18 19 #include <cstdint> 20 #include <functional> 21 #include <stack> 22 #include <unordered_map> 23 #include <utility> 24 25 #include "base/memory/ace_type.h" 26 #include "base/memory/referenced.h" 27 #include "base/utils/noncopyable.h" 28 #include "base/want/want_wrap.h" 29 #include "base/utils/utils.h" 30 #include "core/components/common/properties/placement.h" 31 #include "core/components/dialog/dialog_properties.h" 32 #include "core/components/picker/picker_data.h" 33 #include "core/components_ng/animation/geometry_transition.h" 34 #include "core/components_ng/base/frame_node.h" 35 #include "core/components_ng/base/ui_node.h" 36 #include "core/components_ng/pattern/calendar_picker/calendar_type_define.h" 37 #include "core/components_ng/pattern/overlay/content_cover_param.h" 38 #include "core/components_ng/pattern/overlay/modal_presentation_pattern.h" 39 #include "core/components_ng/pattern/overlay/modal_style.h" 40 #include "core/components_ng/pattern/overlay/sheet_style.h" 41 #include "core/components_ng/pattern/overlay/group_manager.h" 42 #include "core/components_ng/pattern/picker/datepicker_event_hub.h" 43 #include "core/components_ng/pattern/picker/picker_type_define.h" 44 #include "core/components_ng/pattern/text_picker/textpicker_event_hub.h" 45 #include "core/components_ng/pattern/toast/toast_layout_property.h" 46 #include "core/components_ng/pattern/toast/toast_view.h" 47 #include "core/pipeline_ng/ui_task_scheduler.h" 48 #include "interfaces/inner_api/ace/modal_ui_extension_config.h" 49 50 namespace OHOS::Ace::NG { 51 52 struct PopupInfo { 53 int32_t popupId = -1; 54 WeakPtr<FrameNode> target; 55 RefPtr<FrameNode> popupNode; 56 bool markNeedUpdate = false; 57 bool isCurrentOnShow = false; 58 bool isBlockEvent = true; 59 SizeF targetSize; 60 OffsetF targetOffset; 61 bool focusable = false; 62 bool isAvoidKeyboard = false; 63 }; 64 65 struct GatherNodeChildInfo { 66 WeakPtr<FrameNode> imageNode; 67 OffsetF offset; 68 float width = 0.0f; 69 float height = 0.0f; 70 float halfWidth = 0.0f; 71 float halfHeight = 0.0f; 72 }; 73 74 struct DismissTarget { DismissTargetDismissTarget75 DismissTarget() {} DismissTargetDismissTarget76 explicit DismissTarget(int32_t inputTargetId) : targetIdOfModal(inputTargetId) {} DismissTargetDismissTarget77 explicit DismissTarget(const SheetKey& index) : sheetKey(index) 78 { 79 targetIsSheet = true; 80 } 81 GetTargetIdDismissTarget82 int32_t GetTargetId() 83 { 84 return targetIsSheet ? sheetKey.targetId : targetIdOfModal; 85 } 86 87 int32_t targetIdOfModal = -1; 88 SheetKey sheetKey; 89 bool targetIsSheet = false; 90 }; 91 92 struct CustomKeyboardOffsetInfo { 93 float finalOffset = 0.0f; 94 float inAniStartOffset = 0.0f; 95 float outAniEndOffset = 0.0f; 96 }; 97 struct OverlayManagerInfo { 98 bool renderRootOverlay = true; 99 }; 100 101 // StageManager is the base class for root render node to perform page switch. 102 class ACE_FORCE_EXPORT OverlayManager : public virtual AceType { 103 DECLARE_ACE_TYPE(OverlayManager, AceType); 104 105 public: OverlayManager(const RefPtr<FrameNode> & rootNode)106 explicit OverlayManager(const RefPtr<FrameNode>& rootNode) : rootNodeWeak_(rootNode) {} 107 ~OverlayManager() override; 108 void ShowIndexerPopup(int32_t targetId, RefPtr<FrameNode>& customNode); 109 void RemoveIndexerPopupById(int32_t targetId); 110 void RemoveIndexerPopup(); 111 void HidePopup(int32_t targetId, const PopupInfo& popupInfo); 112 RefPtr<FrameNode> HidePopupWithoutAnimation(int32_t targetId, const PopupInfo& popupInfo); 113 void ShowPopup(int32_t targetId, const PopupInfo& popupInfo, 114 const std::function<void(int32_t)>&& onWillDismiss = nullptr, bool interactiveDismiss = true); 115 void ErasePopup(int32_t targetId); 116 void HideAllPopups(); 117 void HideCustomPopups(); 118 void SetPopupHotAreas(RefPtr<FrameNode> popupNode); 119 void ShowPopupAnimation(const RefPtr<FrameNode>& popupNode); 120 void ShowPopupAnimationNG(const RefPtr<FrameNode>& popupNode); 121 void HidePopupAnimation(const RefPtr<FrameNode>& popupNode, const std::function<void()>& finish); 122 GetPopupInfo(int32_t targetId)123 PopupInfo GetPopupInfo(int32_t targetId) const 124 { 125 auto it = popupMap_.find(targetId); 126 if (it == popupMap_.end()) { 127 return {}; 128 } 129 return it->second; 130 } 131 HasPopupInfo(int32_t targetId)132 bool HasPopupInfo(int32_t targetId) const 133 { 134 return popupMap_.find(targetId) != popupMap_.end(); 135 } 136 ErasePopupInfo(int32_t targetId)137 void ErasePopupInfo(int32_t targetId) 138 { 139 if (popupMap_.find(targetId) != popupMap_.end()) { 140 popupMap_.erase(targetId); 141 } 142 } 143 SetDismissDialogId(int32_t id)144 void SetDismissDialogId(int32_t id) 145 { 146 dismissDialogId_ = id; 147 } 148 GetDismissDialogId()149 int32_t GetDismissDialogId() const 150 { 151 return dismissDialogId_; 152 } 153 154 void ShowMenu(int32_t targetId, const NG::OffsetF& offset, RefPtr<FrameNode> menu = nullptr); 155 void HideMenu(const RefPtr<FrameNode>& menu, int32_t targetId, bool isMenuOnTouch = false); 156 void DeleteMenu(int32_t targetId); 157 void ShowMenuInSubWindow(int32_t targetId, const NG::OffsetF& offset, RefPtr<FrameNode> menu = nullptr); 158 void HideMenuInSubWindow(const RefPtr<FrameNode>& menu, int32_t targetId); 159 RefPtr<FrameNode> GetMenuNode(int32_t targetId); 160 void HideMenuInSubWindow(bool showPreviewAnimation = true, bool startDrag = false); 161 void CleanMenuInSubWindow(int32_t targetId); 162 void CleanPreviewInSubWindow(); 163 void CleanHoverImagePreviewInSubWindow(const RefPtr<FrameNode>& flexNode); 164 void CleanPopupInSubWindow(); 165 void CleanMenuInSubWindowWithAnimation(); 166 void HideAllMenus(); 167 168 void ClearToastInSubwindow(); 169 void ClearToast(); 170 void ShowToast(const NG::ToastInfo& toastInfo); 171 172 void FireAutoSave(const RefPtr<FrameNode>& ContainerNode); 173 GetDialogMap()174 std::unordered_map<int32_t, RefPtr<FrameNode>> GetDialogMap() 175 { 176 return dialogMap_; 177 }; 178 RefPtr<FrameNode> GetDialog(int32_t dialogId); 179 RefPtr<FrameNode> SetDialogMask(const DialogProperties& dialogProps); 180 // customNode only used by customDialog, pass in nullptr if not customDialog 181 RefPtr<FrameNode> ShowDialog( 182 const DialogProperties& dialogProps, std::function<void()>&& buildFunc, bool isRightToLeft = false); 183 RefPtr<FrameNode> ShowDialogWithNode( 184 const DialogProperties& dialogProps, const RefPtr<NG::UINode>& customNode, bool isRightToLeft = false); 185 void ShowCustomDialog(const RefPtr<FrameNode>& customNode); 186 void ShowDateDialog(const DialogProperties& dialogProps, const DatePickerSettingData& settingData, 187 std::map<std::string, NG::DialogEvent> dialogEvent, 188 std::map<std::string, NG::DialogGestureEvent> dialogCancelEvent, 189 std::map<std::string, NG::DialogCancelEvent> dialogLifeCycleEvent = {}, 190 const std::vector<ButtonInfo>& buttonInfos = std::vector<ButtonInfo>({})); 191 void ShowTimeDialog(const DialogProperties& dialogProps, const TimePickerSettingData& settingData, 192 std::map<std::string, PickerTime> timePickerProperty, std::map<std::string, NG::DialogEvent> dialogEvent, 193 std::map<std::string, NG::DialogGestureEvent> dialogCancelEvent, 194 std::map<std::string, NG::DialogCancelEvent> dialogLifeCycleEvent = {}, 195 const std::vector<ButtonInfo>& buttonInfos = std::vector<ButtonInfo>({})); 196 void ShowTextDialog(const DialogProperties& dialogProps, const TextPickerSettingData& settingData, 197 std::map<std::string, NG::DialogTextEvent> dialogEvent, 198 std::map<std::string, NG::DialogGestureEvent> dialogCancelEvent, 199 std::map<std::string, NG::DialogCancelEvent> dialogLifeCycleEvent = {}, 200 const std::vector<ButtonInfo>& buttonInfos = std::vector<ButtonInfo>({})); 201 void ShowCalendarDialog(const DialogProperties& dialogProps, const CalendarSettingData& settingData, 202 std::map<std::string, NG::DialogEvent> dialogEvent, 203 std::map<std::string, NG::DialogGestureEvent> dialogCancelEvent, 204 std::map<std::string, NG::DialogCancelEvent> dialogLifeCycleEvent = {}, 205 const std::vector<ButtonInfo>& buttonInfos = std::vector<ButtonInfo>({})); 206 void PopModalDialog(int32_t maskId); 207 208 void CloseDialog(const RefPtr<FrameNode>& dialogNode); 209 void DeleteDialogHotAreas(const RefPtr<FrameNode>& dialogNode); 210 211 void OpenCustomDialog(const DialogProperties& dialogProps, std::function<void(int32_t)> &&callback); 212 void CloseCustomDialog(const int32_t dialogId); 213 void CloseCustomDialog(const WeakPtr<NG::UINode>& node, std::function<void(int32_t)> &&callback); 214 void UpdateCustomDialog(const WeakPtr<NG::UINode>& node, const DialogProperties& dialogProps, 215 std::function<void(int32_t)> &&callback); 216 SetSubWindowId(int32_t subWindowId)217 void SetSubWindowId(int32_t subWindowId) 218 { 219 subWindowId_ = subWindowId; 220 } GetSubwindowId()221 int32_t GetSubwindowId() 222 { 223 return subWindowId_; 224 } SetMaskNodeId(int32_t dialogId,int32_t maskId)225 void SetMaskNodeId(int32_t dialogId, int32_t maskId) 226 { 227 maskNodeIdMap_[dialogId] = maskId; 228 } 229 bool isMaskNode(int32_t maskId); 230 int32_t GetMaskNodeIdWithDialogId(int32_t dialogId); 231 232 /** pop overlays (if any) on back press 233 * 234 * @return true if popup was removed, false if no overlay exists 235 */ 236 bool RemoveOverlay(bool isBackPressed, bool isPageRouter = false); 237 bool RemoveDialog(const RefPtr<FrameNode>& overlay, bool isBackPressed, bool isPageRouter = false); 238 bool RemoveBubble(const RefPtr<FrameNode>& overlay); 239 bool RemoveMenu(const RefPtr<FrameNode>& overlay); 240 bool RemoveDragPreview(const RefPtr<FrameNode>& overlay); 241 bool RemoveModalInOverlay(); 242 bool RemoveAllModalInOverlay(bool isRouterTransition = true); 243 bool RemoveAllModalInOverlayByStack(); 244 bool RemoveAllModalInOverlayByList(); 245 bool OnRemoveAllModalInOverlayByList(); 246 void AfterRemoveAllModalInOverlayByList(); 247 bool IsModalUiextensionNode(const RefPtr<FrameNode>& topModalNode); 248 bool IsProhibitedRemoveByRouter(const RefPtr<FrameNode>& topModalNode); 249 bool IsProhibitedRemoveByNavigation(const RefPtr<FrameNode>& topModalNode); 250 bool RemoveOverlayInSubwindow(); 251 RegisterOnHideDialog(std::function<void ()> callback)252 void RegisterOnHideDialog(std::function<void()> callback) 253 { 254 onHideDialogCallback_ = callback; 255 } 256 CallOnHideDialogCallback()257 void CallOnHideDialogCallback() 258 { 259 if (onHideDialogCallback_) { 260 onHideDialogCallback_(); 261 } 262 } 263 SetBackPressEvent(std::function<bool ()> event)264 void SetBackPressEvent(std::function<bool()> event) 265 { 266 backPressEvent_ = event; 267 } 268 FireBackPressEvent()269 bool FireBackPressEvent() const 270 { 271 if (backPressEvent_) { 272 return backPressEvent_(); 273 } 274 return false; 275 } 276 GetHasPixelMap()277 bool GetHasPixelMap() 278 { 279 return hasPixelMap_; 280 } 281 SetHasPixelMap(bool hasPixelMap)282 void SetHasPixelMap(bool hasPixelMap) 283 { 284 hasPixelMap_ = hasPixelMap; 285 } 286 GetHasDragPixelMap()287 bool GetHasDragPixelMap() const 288 { 289 return hasDragPixelMap_; 290 } 291 SetHasDragPixelMap(bool hasDragPixelMap)292 void SetHasDragPixelMap(bool hasDragPixelMap) 293 { 294 hasDragPixelMap_ = hasDragPixelMap; 295 } 296 GetHasGatherNode()297 bool GetHasGatherNode() 298 { 299 return hasGatherNode_; 300 } 301 GetPixelMapNode()302 RefPtr<FrameNode> GetPixelMapNode() 303 { 304 return pixmapColumnNodeWeak_.Upgrade(); 305 } 306 307 RefPtr<FrameNode> GetPixelMapContentNode(bool isSubwindowOverlay = false) const; 308 309 RefPtr<FrameNode> GetPixelMapContentNodeForSubwindow() const; 310 311 RefPtr<FrameNode> GetDragPixelMapContentNode() const; 312 313 RefPtr<FrameNode> GetPixelMapBadgeNode() const; 314 315 RefPtr<FrameNode> GetDragPixelMapBadgeNode() const; 316 GetHasFilter()317 bool GetHasFilter() 318 { 319 return hasFilter_; 320 } 321 SetHasFilter(bool hasFilter)322 void SetHasFilter(bool hasFilter) 323 { 324 hasFilter_ = hasFilter; 325 } 326 GetHasEvent()327 bool GetHasEvent() 328 { 329 return hasEvent_; 330 } 331 SetHasEvent(bool hasEvent)332 void SetHasEvent(bool hasEvent) 333 { 334 hasEvent_ = hasEvent; 335 } 336 GetIsOnAnimation()337 bool GetIsOnAnimation() 338 { 339 return isOnAnimation_; 340 } 341 SetIsOnAnimation(bool isOnAnimation)342 void SetIsOnAnimation(bool isOnAnimation) 343 { 344 isOnAnimation_ = isOnAnimation; 345 } 346 SetFilterColumnNode(const RefPtr<FrameNode> & columnNode)347 void SetFilterColumnNode(const RefPtr<FrameNode>& columnNode) 348 { 349 filterColumnNodeWeak_ = columnNode; 350 } 351 void MountFilterToWindowScene(const RefPtr<FrameNode>& columnNode, const RefPtr<UINode>& windowScene); 352 void MountPixelMapToWindowScene( 353 const RefPtr<FrameNode>& columnNode, const RefPtr<UINode>& windowScene, bool isDragPixelMap = false); 354 void MountEventToWindowScene(const RefPtr<FrameNode>& columnNode, const RefPtr<UINode>& windowScene); 355 void MountPixelMapToRootNode(const RefPtr<FrameNode>& columnNode, bool isDragPixelMap = false); 356 void MountEventToRootNode(const RefPtr<FrameNode>& columnNode); 357 void RemovePixelMap(); 358 void RemovePixelMapAnimation(bool startDrag, double x, double y, bool isSubwindowOverlay = false); 359 void RemoveDragPixelMap(); 360 void UpdatePixelMapScale(float& scale); 361 void RemoveFilter(); 362 void RemoveFilterAnimation(); 363 void RemoveEventColumn(); 364 void UpdatePixelMapPosition(bool isSubwindowOverlay = false); 365 void UpdateContextMenuDisappearPosition(const NG::OffsetF& offset, float menuScale = 1.0f, 366 bool isRedragStart = false, int32_t menuWrapperId = -1); 367 void ContextMenuSwitchDragPreviewAnimation(const RefPtr<NG::FrameNode>& dragPreviewNode, 368 const NG::OffsetF& offset); 369 bool GetMenuPreviewCenter(NG::OffsetF& offset); 370 ResetContextMenuDragHideFinished()371 void ResetContextMenuDragHideFinished() 372 { 373 isContextMenuDragHideFinished_ = false; 374 dragMoveVector_ = OffsetF(0.0f, 0.0f); 375 lastDragMoveVector_ = OffsetF(0.0f, 0.0f); 376 } 377 ResetContextMenuRestartDragVector()378 void ResetContextMenuRestartDragVector() 379 { 380 dragMoveVector_ = OffsetF(0.0f, 0.0f); 381 lastDragMoveVector_ = OffsetF(0.0f, 0.0f); 382 } 383 SetContextMenuDragHideFinished(bool isContextMenuDragHideFinished)384 void SetContextMenuDragHideFinished(bool isContextMenuDragHideFinished) 385 { 386 isContextMenuDragHideFinished_ = isContextMenuDragHideFinished; 387 } 388 IsContextMenuDragHideFinished()389 bool IsContextMenuDragHideFinished() const 390 { 391 return isContextMenuDragHideFinished_ == true; 392 } 393 IsOriginDragMoveVector()394 bool IsOriginDragMoveVector() const 395 { 396 return dragMoveVector_.NonOffset() && lastDragMoveVector_.NonOffset(); 397 } 398 IsUpdateDragMoveVector()399 bool IsUpdateDragMoveVector() const 400 { 401 return !GetUpdateDragMoveVector().NonOffset() && !lastDragMoveVector_.NonOffset(); 402 } 403 UpdateDragMoveVector(const NG::OffsetF & offset)404 void UpdateDragMoveVector(const NG::OffsetF& offset) 405 { 406 lastDragMoveVector_ = dragMoveVector_; 407 dragMoveVector_ = offset; 408 } 409 GetUpdateDragMoveVector()410 OffsetF GetUpdateDragMoveVector() const 411 { 412 return dragMoveVector_ - lastDragMoveVector_; 413 } 414 415 void BindContentCover(bool isShow, std::function<void(const std::string&)>&& callback, 416 std::function<RefPtr<UINode>()>&& buildNodeFunc, NG::ModalStyle& modalStyle, std::function<void()>&& onAppear, 417 std::function<void()>&& onDisappear, std::function<void()>&& onWillAppear, 418 std::function<void()>&& onWillDisappear, const NG::ContentCoverParam& contentCoverParam, 419 const RefPtr<FrameNode>& targetNode, int32_t sessionId = 0); 420 void OnBindContentCover(bool isShow, std::function<void(const std::string&)>&& callback, 421 std::function<RefPtr<UINode>()>&& buildNodeFunc, NG::ModalStyle& modalStyle, std::function<void()>&& onAppear, 422 std::function<void()>&& onDisappear, std::function<void()>&& onWillAppear, 423 std::function<void()>&& onWillDisappear, const NG::ContentCoverParam& contentCoverParam, 424 const RefPtr<FrameNode>& targetNode, int32_t sessionId = 0); 425 void BindSheet(bool isShow, std::function<void(const std::string&)>&& callback, 426 std::function<RefPtr<UINode>()>&& buildNodeFunc, std::function<RefPtr<UINode>()>&& buildTitleNodeFunc, 427 NG::SheetStyle& sheetStyle, std::function<void()>&& onAppear, std::function<void()>&& onDisappear, 428 std::function<void()>&& shouldDismiss, std::function<void(const int32_t info)>&& onWillDismiss, 429 std::function<void()>&& onWillAppear, std::function<void()>&& onWillDisappear, 430 std::function<void(const float)>&& onHeightDidChange, 431 std::function<void(const float)>&& onDetentsDidChange, 432 std::function<void(const float)>&& onWidthDidChange, 433 std::function<void(const float)>&& onTypeDidChange, 434 std::function<void()>&& sheetSpringBack, const RefPtr<FrameNode>& targetNode); 435 void OnBindSheet(bool isShow, std::function<void(const std::string&)>&& callback, 436 std::function<RefPtr<UINode>()>&& buildNodeFunc, std::function<RefPtr<UINode>()>&& buildtitleNodeFunc, 437 NG::SheetStyle& sheetStyle, std::function<void()>&& onAppear, std::function<void()>&& onDisappear, 438 std::function<void()>&& shouldDismiss, std::function<void(const int32_t info)>&& onWillDismiss, 439 std::function<void()>&& onWillAppear, std::function<void()>&& onWillDisappear, 440 std::function<void(const float)>&& onHeightDidChange, 441 std::function<void(const float)>&& onDetentsDidChange, 442 std::function<void(const float)>&& onWidthDidChange, 443 std::function<void(const float)>&& onTypeDidChange, 444 std::function<void()>&& sheetSpringBack, const RefPtr<FrameNode>& targetNode); 445 void CloseSheet(const SheetKey& sheetKey); 446 void PlaySheetTransitionWhenClose(const RefPtr<FrameNode>& sheetNode); 447 void InitSheetMask( 448 const RefPtr<FrameNode>& maskNode, const RefPtr<FrameNode>& sheetNode, const SheetStyle& sheetStyle); IsModalEmpty()449 bool IsModalEmpty() const 450 { 451 return modalStack_.empty(); 452 } 453 bool HasModalPage(); 454 void DismissSheet(); 455 void DismissContentCover(); 456 void SheetSpringBack(); 457 458 void OpenBindSheetByUIContext( 459 const RefPtr<FrameNode>& sheetContentNode, std::function<RefPtr<UINode>()>&& buildtitleNodeFunc, 460 NG::SheetStyle& sheetStyle, std::function<void()>&& onAppear, std::function<void()>&& onDisappear, 461 std::function<void()>&& shouldDismiss, std::function<void(const int32_t)>&& onWillDismiss, 462 std::function<void()>&& onWillAppear, std::function<void()>&& onWillDisappear, 463 std::function<void(const float)>&& onHeightDidChange, 464 std::function<void(const float)>&& onDetentsDidChange, 465 std::function<void(const float)>&& onWidthDidChange, 466 std::function<void(const float)>&& onTypeDidChange, 467 std::function<void()>&& sheetSpringBack, 468 std::function<void(const int32_t, const int32_t)> cleanViewContextMapCallback, 469 const RefPtr<FrameNode>& targetNode); 470 void UpdateBindSheetByUIContext(const RefPtr<NG::FrameNode>& sheetContentNode, 471 NG::SheetStyle& sheetStyle, int32_t targetId, bool isPartialUpdate); 472 void CloseBindSheetByUIContext(const RefPtr<NG::FrameNode>& sheetContentNode, int32_t targetId); SetDismissTarget(const DismissTarget & dismissTarget)473 void SetDismissTarget(const DismissTarget& dismissTarget) 474 { 475 dismissTarget_ = dismissTarget; 476 } SetDismissSheet(int32_t sheetId)477 void SetDismissSheet(int32_t sheetId) 478 { 479 dismissSheetId_ = sheetId; 480 } GetDismissSheet()481 int32_t GetDismissSheet() const 482 { 483 return dismissSheetId_; 484 } 485 void RemoveSheetNode(const RefPtr<FrameNode>& sheetNode); 486 487 void DestroySheet(const RefPtr<FrameNode>& sheetNode, const SheetKey& sheetKey); 488 void CleanSheet(const RefPtr<FrameNode>& sheetNode, const SheetKey& sheetKey); 489 490 RefPtr<FrameNode> GetSheetMask(const RefPtr<FrameNode>& sheetNode); 491 492 RefPtr<FrameNode> GetModal(int32_t targetId); 493 void RemoveModal(int32_t targetId); 494 void DeleteModal(int32_t targetId, bool needOnWillDisappear = true); 495 void PopTopModalNode(); 496 497 void DeleteModalNode(int32_t targetId, RefPtr<FrameNode>& modalNode, bool isModal, bool needOnWillDisappear); 498 499 void BindKeyboard(const std::function<void()>& keyboardBuilder, int32_t targetId); 500 void BindKeyboardWithNode(const RefPtr<UINode>& keyboard, int32_t targetId); 501 void CloseKeyboard(int32_t targetId); 502 void UpdateCustomKeyboardPosition(); 503 504 RefPtr<UINode> FindWindowScene(RefPtr<FrameNode> targetNode); 505 506 // ui extension 507 bool HandleUIExtNodeSize(const AAFwk::Want& want, RefPtr<FrameNode> uiExtNode); 508 bool HandleUIExtNodeAngle(int32_t uiExtNodeAngle, RefPtr<FrameNode> uiExtNode); 509 bool HandleUIExtNodeTransform(const AAFwk::Want& want, RefPtr<FrameNode> uiExtNode); 510 bool UIExtNodeAngleValid(int32_t uiExtNodeAngle); 511 int32_t CreateModalUIExtension(const RefPtr<WantWrap>& want, const ModalUIExtensionCallbacks& callbacks, 512 const ModalUIExtensionConfig& config); 513 int32_t CreateModalUIExtension(const AAFwk::Want& want, const ModalUIExtensionCallbacks& callbacks, 514 const ModalUIExtensionConfig& config); 515 void CloseModalUIExtension(int32_t sessionId); 516 void UpdateModalUIExtensionConfig( 517 int32_t sessionId, const ModalUIExtensionAllowedUpdateConfig& config); 518 static ModalStyle SetUIExtensionModalStyleAndGet(bool prohibitedRemoveByRouter, bool prohibitedRemoveByNavigation); 519 520 RefPtr<FrameNode> BuildAIEntityMenu(const std::vector<std::pair<std::string, std::function<void()>>>& menuOptions); 521 RefPtr<FrameNode> CreateAIEntityMenu(const std::vector<std::pair<std::string, std::function<void()>>>& menuOptions, 522 const RefPtr<FrameNode>& targetNode); 523 bool ShowAIEntityMenu(const std::vector<std::pair<std::string, std::function<void()>>>& menuOptions, 524 const RectF& aiRect, const RefPtr<FrameNode>& targetNode); 525 void CloseAIEntityMenu(int32_t targetId); 526 527 void MarkDirty(PropertyChangeFlag flag); 528 void MarkDirtyOverlay(); 529 float GetRootHeight() const; 530 float GetRootWidth() const; 531 532 void PlaySheetMaskTransition(RefPtr<FrameNode> maskNode, bool isTransitionIn); 533 534 void PlaySheetTransition(RefPtr<FrameNode> sheetNode, bool isTransitionIn, bool isFirstTransition = true); 535 536 void ComputeSheetOffset(NG::SheetStyle& sheetStyle, RefPtr<FrameNode> sheetNode); 537 538 void ComputeSingleGearSheetOffset(NG::SheetStyle& sheetStyle, RefPtr<FrameNode> sheetNode); 539 540 void ComputeDetentsSheetOffset(NG::SheetStyle& sheetStyle, RefPtr<FrameNode> sheetNode); 541 542 void CheckDeviceInLandscape(NG::SheetStyle& sheetStyle, RefPtr<FrameNode> sheetNode, float& sheetTopSafeArea); 543 SetSheetHeight(float height)544 void SetSheetHeight(float height) 545 { 546 sheetHeight_ = height; 547 } 548 549 const WeakPtr<UINode>& GetRootNode() const; 550 const RefPtr<GroupManager>& GetGroupManager() const; 551 552 void ModalPageLostFocus(const RefPtr<FrameNode>& node); 553 554 void SetCustomKeyboardOption(bool supportAvoidance); 555 SetFilterActive(bool actived)556 void SetFilterActive(bool actived) 557 { 558 hasFilterActived = actived; 559 } 560 SetDismissPopupId(int32_t targetId)561 void SetDismissPopupId(int32_t targetId) 562 { 563 dismissPopupId_ = targetId; 564 } 565 566 void DismissPopup(); 567 bool CheckPageNeedAvoidKeyboard() const; 568 void AvoidCustomKeyboard(int32_t targetId, float safeHeight); 569 570 void CreateOverlayNode(); 571 void AddFrameNodeToOverlay(const RefPtr<NG::FrameNode>& node, std::optional<int32_t> index = std::nullopt); 572 void RemoveFrameNodeOnOverlay(const RefPtr<NG::FrameNode>& node); 573 void ShowNodeOnOverlay(const RefPtr<NG::FrameNode>& node); 574 void HideNodeOnOverlay(const RefPtr<NG::FrameNode>& node); 575 void ShowAllNodesOnOverlay(); 576 void HideAllNodesOnOverlay(); GetOverlayNode()577 RefPtr<FrameNode> GetOverlayNode() 578 { 579 return overlayNode_; 580 } 581 582 void MountGatherNodeToRootNode(const RefPtr<FrameNode>& frameNode, 583 const std::vector<GatherNodeChildInfo>& gatherNodeChildrenInfo); 584 void MountGatherNodeToWindowScene(const RefPtr<FrameNode>& frameNode, 585 const std::vector<GatherNodeChildInfo>& gatherNodeChildrenInfo, 586 const RefPtr<UINode>& windowScene); 587 void RemoveGatherNode(); 588 void RemoveGatherNodeWithAnimation(); 589 void UpdateGatherNodeToTop(); GetGatherNode()590 RefPtr<FrameNode> GetGatherNode() const 591 { 592 return gatherNodeWeak_.Upgrade(); 593 } GetGatherNodeChildrenInfo()594 const std::vector<GatherNodeChildInfo>& GetGatherNodeChildrenInfo() 595 { 596 return gatherNodeChildrenInfo_; 597 } IsGatherWithMenu()598 bool IsGatherWithMenu() const 599 { 600 return isGatherWithMenu_; 601 } SetIsGatherWithMenu(bool isGatherWithMenu)602 void SetIsGatherWithMenu(bool isGatherWithMenu) 603 { 604 isGatherWithMenu_ = isGatherWithMenu; 605 } 606 void RemoveMenuBadgeNode(const RefPtr<FrameNode>& menuWrapperNode); 607 void RemovePreviewBadgeNode(); EraseMenuInfo(int32_t targetId)608 void EraseMenuInfo(int32_t targetId) 609 { 610 if (menuMap_.find(targetId) != menuMap_.end()) { 611 menuMap_.erase(targetId); 612 } 613 } 614 615 bool IsRootExpansive() const; 616 void DumpOverlayInfo() const; 617 618 void ShowFilterAnimation(const RefPtr<FrameNode>& columnNode); 619 620 void ReloadBuilderNodeConfig(); 621 IsMenuShow()622 bool IsMenuShow() const 623 { 624 return isMenuShow_; 625 } 626 SetIsMenuShow(bool isMenuShow)627 void SetIsMenuShow(bool isMenuShow) 628 { 629 isMenuShow_ = isMenuShow; 630 } 631 SetIsAttachToCustomNode(bool isAttachToCustomNode)632 void SetIsAttachToCustomNode(bool isAttachToCustomNode) 633 { 634 isAttachToCustomNode_ = isAttachToCustomNode; 635 } 636 637 void SetIsAllowedBeCovered(bool isAllowedBeCovered = true); 638 void ClearUIExtensionNode(); 639 void DeleteUIExtensionNode(int32_t sessionId); 640 bool AddCurSessionId(int32_t curSessionId); 641 void ResetRootNode(int32_t sessionId); 642 void OnUIExtensionWindowSizeChange(); SetOverlayManagerOptions(const OverlayManagerInfo & overlayInfo)643 bool SetOverlayManagerOptions(const OverlayManagerInfo& overlayInfo) 644 { 645 if (overlayInfo_.has_value()) { 646 return false; 647 } 648 overlayInfo_ = overlayInfo; 649 return true; 650 } GetOverlayManagerOptions()651 std::optional<OverlayManagerInfo> GetOverlayManagerOptions() 652 { 653 return overlayInfo_; 654 } 655 656 RefPtr<FrameNode> GetDialogNodeWithExistContent(const RefPtr<UINode>& node); 657 OffsetF CalculateMenuPosition(const RefPtr<FrameNode>& menuWrapperNode, const OffsetF& offset); 658 659 RefPtr<FrameNode> GetLastChildNotRemoving(const RefPtr<UINode>& rootNode); 660 bool isCurrentNodeProcessRemoveOverlay(const RefPtr<FrameNode>& currentNode, bool skipModal); 661 662 private: 663 void OnBindSheetInner(std::function<void(const std::string&)>&& callback, 664 const RefPtr<UINode>& sheetContentNode, std::function<RefPtr<UINode>()>&& buildtitleNodeFunc, 665 NG::SheetStyle& sheetStyle, std::function<void()>&& onAppear, std::function<void()>&& onDisappear, 666 std::function<void()>&& shouldDismiss, std::function<void(const int32_t)>&& onWillDismiss, 667 std::function<void()>&& onWillAppear, std::function<void()>&& onWillDisappear, 668 std::function<void(const float)>&& onHeightDidChange, std::function<void(const float)>&& onDetentsDidChange, 669 std::function<void(const float)>&& onWidthDidChange, 670 std::function<void(const float)>&& onTypeDidChange, 671 std::function<void()>&& sheetSpringBack, const RefPtr<FrameNode>& targetNode, bool isStartByUIContext = false); 672 void SetSheetProperty( 673 const RefPtr<FrameNode>& sheetPageNode, 674 NG::SheetStyle& sheetStyle, std::function<void()>&& onAppear, std::function<void()>&& onDisappear, 675 std::function<void()>&& shouldDismiss, std::function<void(const int32_t)>&& onWillDismiss, 676 std::function<void()>&& onWillAppear, std::function<void()>&& onWillDisappear, 677 std::function<void(const float)>&& onHeightDidChange, std::function<void(const float)>&& onDetentsDidChange, 678 std::function<void(const float)>&& onWidthDidChange, 679 std::function<void(const float)>&& onTypeDidChange, 680 std::function<void()>&& sheetSpringBack); 681 void SaveSheePageNode( 682 const RefPtr<FrameNode>& sheetPageNode, const RefPtr<UINode>& sheetContentNode, 683 const RefPtr<FrameNode>& targetNode, bool isStartByUIContext); 684 bool CheckTargetIdIsValid(int32_t targetId); 685 RefPtr<FrameNode> CreateSheetMask(const RefPtr<FrameNode>& sheetPageNode, 686 const RefPtr<FrameNode>& targetNode, NG::SheetStyle& sheetStyle); 687 void UpdateSheetRender(const RefPtr<FrameNode>& sheetPageNode, NG::SheetStyle& sheetStyle, bool isPartialUpdate); 688 void UpdateSheetPage(const RefPtr<FrameNode>& sheetNode, NG::SheetStyle& sheetStyle, 689 int32_t targetId, bool isStartByUIContext = false, bool isPartialUpdate = false, 690 std::function<void()>&& onAppear = nullptr, std::function<void()>&& onDisappear = nullptr, 691 std::function<void()>&& shouldDismiss = nullptr, std::function<void(const int32_t)>&& onWillDismiss = nullptr, 692 std::function<void()>&& onWillDisappear = nullptr, 693 std::function<void(const float)>&& onHeightDidChange = nullptr, 694 std::function<void(const float)>&& onDetentsDidChange = nullptr, 695 std::function<void(const float)>&& onWidthDidChange = nullptr, 696 std::function<void(const float)>&& onTypeDidChange = nullptr, 697 std::function<void()>&& sheetSpringBack = nullptr); 698 SheetStyle UpdateSheetStyle( 699 const RefPtr<FrameNode>& sheetNode, const SheetStyle& sheetStyle, bool isPartialUpdate); 700 void UpdateSheetProperty(const RefPtr<FrameNode>& sheetNode, NG::SheetStyle& currentStyle, bool isPartialUpdate); 701 void UpdateSheetMaskBackgroundColor(const RefPtr<FrameNode>& maskNode, 702 const RefPtr<RenderContext>& maskRenderContext, const SheetStyle& sheetStyle); 703 void UpdateSheetMask(const RefPtr<FrameNode>& maskNode, 704 const RefPtr<FrameNode>& sheetNode, const SheetStyle& sheetStyle, bool isPartialUpdate = false); CleanViewContextMap(int32_t instanceId,int32_t sheetContentId)705 void CleanViewContextMap(int32_t instanceId, int32_t sheetContentId) 706 { 707 if (cleanViewContextMapCallback_) { 708 cleanViewContextMapCallback_(instanceId, sheetContentId); 709 } 710 } 711 void CleanInvalidModalNode(const WeakPtr<FrameNode>& invalidNode); 712 void PopToast(int32_t targetId); 713 714 // toast should contain id to avoid multiple delete. 715 std::unordered_map<int32_t, WeakPtr<FrameNode>> toastMap_; 716 717 /** find/register menu node and update menu's display position 718 * 719 * @return true if process is successful 720 */ 721 bool ShowMenuHelper(RefPtr<FrameNode>& menu, int32_t targetId, const NG::OffsetF& offset); 722 723 // The focus logic of overlay node (menu and dialog): 724 // 1. before start show animation: lower level node set unfocusabel and lost focus; 725 // 2. end show animation: overlay node get focus; 726 // 3. before start hide animation: lower level node set focusable; 727 // 4. end hide animation: overlay node lost focus, lower level node get focus. 728 void FocusOverlayNode(const RefPtr<FrameNode>& overlayNode, bool isInSubWindow = false); 729 void BlurOverlayNode(const RefPtr<FrameNode>& currentOverlay, bool isInSubWindow = false); 730 void BlurLowerNode(const RefPtr<FrameNode>& currentOverlay); 731 void ResetLowerNodeFocusable(const RefPtr<FrameNode>& currentOverlay); 732 void PostDialogFinishEvent(const WeakPtr<FrameNode>& nodeWk); 733 void OnDialogCloseEvent(const RefPtr<FrameNode>& node); 734 735 void CloseDialogInner(const RefPtr<FrameNode>& dialogNode); 736 737 void ShowMenuAnimation(const RefPtr<FrameNode>& menu); 738 void SetPatternFirstShow(const RefPtr<FrameNode>& menu); 739 void PopMenuAnimation(const RefPtr<FrameNode>& menu, bool showPreviewAnimation = true, bool startDrag = false); 740 void ClearMenuAnimation(const RefPtr<FrameNode>& menu, bool showPreviewAnimation = true, bool startDrag = false); 741 void ShowMenuClearAnimation(const RefPtr<FrameNode>& menuWrapper, AnimationOption& option, 742 bool showPreviewAnimation, bool startDrag); 743 bool IsContextMenuBindedOnOrigNode(); 744 void OpenDialogAnimation(const RefPtr<FrameNode>& node); 745 void CloseDialogAnimation(const RefPtr<FrameNode>& node); 746 void SetDialogTransitionEffect(const RefPtr<FrameNode>& node); 747 void CloseDialogMatchTransition(const RefPtr<FrameNode>& node); 748 void SetContainerButtonEnable(bool isEnabled); 749 750 void SaveLastModalNode(); 751 void PlayTransitionEffectIn(const RefPtr<FrameNode>& topModalNode); 752 void PlayTransitionEffectOut(const RefPtr<FrameNode>& topModalNode); 753 void PlayDefaultModalTransition(const RefPtr<FrameNode>& modalNode, bool isTransitionIn); 754 void DefaultModalTransition(bool isTransitionIn); 755 void PlayAlphaModalTransition(const RefPtr<FrameNode>& modalNode, bool isTransitionIn); 756 void FireModalPageShow(); 757 void FireModalPageHide(); 758 759 void SetSheetBackgroundBlurStyle(const RefPtr<FrameNode>& sheetNode, const BlurStyleOption& bgBlurStyle); 760 void SetSheetBackgroundColor(const RefPtr<FrameNode>& sheetNode, const RefPtr<SheetTheme>& sheetTheme, 761 const NG::SheetStyle& sheetStyle, bool isPartialUpdate = false); 762 763 bool ModalExitProcess(const RefPtr<FrameNode>& topModalNode); 764 bool ModalPageExitProcess(const RefPtr<FrameNode>& topModalNode); 765 bool SheetPageExitProcess(const RefPtr<FrameNode>& topModalNode); 766 767 void BeforeShowDialog(const RefPtr<FrameNode>& dialogNode); 768 void RemoveDialogFromMap(const RefPtr<FrameNode>& node); 769 void RemoveMaskFromMap(const RefPtr<FrameNode>& dialogNode); 770 bool DialogInMapHoldingFocus(); 771 void PlayKeyboardTransition(const RefPtr<FrameNode>& customKeyboard, bool isTransitionIn); 772 void FireNavigationStateChange(bool show, const RefPtr<UINode>& node = nullptr); 773 RefPtr<FrameNode> GetModalNodeInStack(std::stack<WeakPtr<FrameNode>>& stack); 774 void PlayBubbleStyleSheetTransition(RefPtr<FrameNode> sheetNode, bool isTransitionIn); 775 void CheckReturnFocus(RefPtr<FrameNode> node); 776 void MountPopup(int32_t targetId, const PopupInfo& popupInfo, 777 const std::function<void(int32_t)>&& onWillDismiss = nullptr, bool interactiveDismiss = true); 778 779 int32_t GetPopupIdByNode(const RefPtr<FrameNode>& overlay); 780 bool PopupInteractiveDismiss(const RefPtr<FrameNode>& overlay); 781 bool PopupCallBackOnWillDismiss(const RefPtr<FrameNode>& overlay); 782 bool RemovePopupInSubwindow(const RefPtr<Pattern>& pattern, const RefPtr<FrameNode>& overlay, 783 const RefPtr<UINode>& rootNode); 784 bool UpdatePopupMap(int32_t targetId, const PopupInfo& popupInfo); 785 void OpenToastAnimation(const RefPtr<FrameNode>& toastNode, int32_t duration); 786 void PlayDefaultModalIn(const RefPtr<FrameNode>& modalNode, const RefPtr<RenderContext>& context, 787 AnimationOption option, float showHeight); 788 void PlayDefaultModalOut(const RefPtr<FrameNode>& modalNode, const RefPtr<RenderContext>& context, 789 AnimationOption option, float showHeight); 790 void OnShowMenuAnimationFinished(const WeakPtr<FrameNode> menuWK, const WeakPtr<OverlayManager> weak, 791 int32_t instanceId); 792 void OnPopMenuAnimationFinished(const WeakPtr<FrameNode> menuWK, const WeakPtr<UINode> rootWeak, 793 const WeakPtr<OverlayManager> weak, int32_t instanceId); 794 void UpdateMenuVisibility(const RefPtr<FrameNode>& menu); 795 void RemoveMenuNotInSubWindow( 796 const WeakPtr<FrameNode>& menuWK, const WeakPtr<UINode>& rootWeak, const WeakPtr<OverlayManager>& overlayWeak); 797 bool CreateSheetKey(const RefPtr<NG::FrameNode>& sheetContentNode, int32_t targetId, 798 SheetKey& sheetKey); 799 800 bool CheckTopModalNode(const RefPtr<FrameNode>& topModalNode, int32_t targetId); 801 void HandleModalShow(std::function<void(const std::string&)>&& callback, 802 std::function<RefPtr<UINode>()>&& buildNodeFunc, NG::ModalStyle& modalStyle, std::function<void()>&& onAppear, 803 std::function<void()>&& onDisappear, std::function<void()>&& onWillDisappear, const RefPtr<UINode> rootNode, 804 const NG::ContentCoverParam& contentCoverParam, int32_t targetId, 805 std::optional<ModalTransition> modalTransition); 806 void HandleModalPop(std::function<void()>&& onWillDisappear, const RefPtr<UINode> rootNode, int32_t targetId); 807 808 int32_t ExceptComponent(const RefPtr<NG::UINode>& rootNode, RefPtr<NG::FrameNode>& overlay, 809 bool isBackPressed, bool isPageRouter); 810 int32_t RemoveOverlayCommon(const RefPtr<NG::UINode>& rootNode, RefPtr<NG::FrameNode>& overlay, 811 RefPtr<Pattern>& pattern, bool isBackPressed, bool isPageRouter); 812 int32_t WebBackward(RefPtr<NG::FrameNode>& overlay); 813 void FindWebNode(const RefPtr<NG::UINode>& node, RefPtr<NG::FrameNode>& webNode); 814 815 void RegisterDialogLifeCycleCallback(const RefPtr<FrameNode>& dialog, const DialogProperties& dialogProps); 816 void CustomDialogRecordEvent(const DialogProperties& dialogProps); 817 RefPtr<UINode> RebuildCustomBuilder(RefPtr<UINode>& contentNode); 818 819 void DumpPopupMapInfo() const; 820 void DumpMapInfo( 821 std::unordered_map<int32_t, RefPtr<FrameNode>> map, const std::string mapName, bool hasTarget = true) const; 822 void DumpMapInfo( 823 std::unordered_map<int32_t, WeakPtr<FrameNode>> map, const std::string mapName, bool hasTarget = true) const; 824 void DumpSheetMapInfo(const std::unordered_map<SheetKey, WeakPtr<FrameNode>, SheetKeyHash>& map, 825 const std::string mapName) const; 826 void DumpMaskNodeIdMapInfo() const; 827 void DumpModalListInfo() const; 828 void DumpEntry(const RefPtr<FrameNode>& targetNode, int32_t targetId, const RefPtr<FrameNode>& node) const; 829 std::string GetMapNodeLog(const RefPtr<FrameNode>& node, bool hasTarget = true) const; 830 void SetNodeBeforeAppbar(const RefPtr<NG::UINode>& rootNode, const RefPtr<FrameNode>& node); 831 RefPtr<FrameNode> GetOverlayFrameNode(); 832 void MountToParentWithService(const RefPtr<UINode>& rootNode, const RefPtr<FrameNode>& node); 833 void RemoveChildWithService(const RefPtr<UINode>& rootNode, const RefPtr<FrameNode>& node); 834 CustomKeyboardOffsetInfo CalcCustomKeyboardOffset(const RefPtr<FrameNode>& customKeyboard); 835 void SendToAccessibility(const WeakPtr<FrameNode> node, bool isShow); 836 837 void SetDragNodeNeedClean(); 838 void MountCustomKeyboard(const RefPtr<FrameNode>& customKeyboard, int32_t targetId); 839 840 RefPtr<FrameNode> overlayNode_; 841 // Key: frameNode Id, Value: index 842 std::unordered_map<int32_t, int32_t> frameNodeMapOnOverlay_; 843 // Key: target Id, Value: PopupInfo 844 std::unordered_map<int32_t, NG::PopupInfo> popupMap_; 845 // K: target frameNode ID, V: menuNode 846 std::unordered_map<int32_t, RefPtr<FrameNode>> menuMap_; 847 std::unordered_map<int32_t, RefPtr<FrameNode>> dialogMap_; 848 std::unordered_map<int32_t, RefPtr<FrameNode>> customPopupMap_; 849 std::unordered_map<int32_t, RefPtr<FrameNode>> customKeyboardMap_; 850 std::stack<WeakPtr<FrameNode>> modalStack_; 851 std::list<WeakPtr<FrameNode>> modalList_; 852 std::unordered_map<SheetKey, WeakPtr<FrameNode>, SheetKeyHash> sheetMap_; 853 std::function<void(const int32_t, const int32_t)> cleanViewContextMapCallback_ = nullptr; 854 std::unordered_map<int32_t, RefPtr<NG::ClickEvent>> sheetMaskClickEventMap_; // Key: maskNodeId 855 WeakPtr<FrameNode> lastModalNode_; // Previous Modal Node 856 float sheetHeight_ { 0.0 }; 857 WeakPtr<UINode> rootNodeWeak_; 858 int32_t dialogCount_ = 0; 859 DismissTarget dismissTarget_; 860 int32_t dismissSheetId_ = 0; 861 int32_t dismissDialogId_ = 0; 862 std::unordered_map<int32_t, int32_t> maskNodeIdMap_; 863 int32_t subWindowId_ = -1; 864 bool hasPixelMap_ { false }; 865 bool hasDragPixelMap_ { false }; 866 bool hasFilter_ { false }; 867 bool hasEvent_ { false }; 868 bool isOnAnimation_ { false }; 869 WeakPtr<FrameNode> pixmapColumnNodeWeak_; 870 WeakPtr<FrameNode> dragPixmapColumnNodeWeak_; 871 WeakPtr<FrameNode> filterColumnNodeWeak_; 872 WeakPtr<FrameNode> eventColumnNodeWeak_; 873 bool isContextMenuDragHideFinished_ = false; 874 OffsetF dragMoveVector_ = OffsetF(0.0f, 0.0f); 875 OffsetF lastDragMoveVector_ = OffsetF(0.0f, 0.0f); 876 877 std::function<void()> onHideDialogCallback_ = nullptr; 878 CancelableCallback<void()> continuousTask_; 879 std::function<bool()> backPressEvent_ = nullptr; 880 881 std::set<WeakPtr<UINode>> windowSceneSet_; 882 883 RefPtr<NG::ClickEvent> sheetMaskClickEvent_; 884 RefPtr<GroupManager> groupManager_ = MakeRefPtr<GroupManager>(); 885 886 // native modal ui extension 887 bool isProhibitBack_ = false; 888 889 std::unordered_map<int32_t, WeakPtr<FrameNode>> uiExtNodes_; 890 bool keyboardAvoidance_ = false; 891 ACE_DISALLOW_COPY_AND_MOVE(OverlayManager); 892 893 bool hasFilterActived {false}; 894 895 int32_t dismissPopupId_ = 0; 896 897 bool hasGatherNode_ { false }; 898 bool isGatherWithMenu_ { false }; 899 WeakPtr<FrameNode> gatherNodeWeak_; 900 std::vector<GatherNodeChildInfo> gatherNodeChildrenInfo_; 901 bool isMenuShow_ = false; 902 bool isAttachToCustomNode_ = false; 903 904 // Only used when CreateModalUIExtension 905 // No thread safety issue due to they are all run in UI thread 906 bool isAllowedBeCovered_ = true; 907 // Only hasValue when isAllowedBeCovered is false 908 std::set<int32_t> curSessionIds_; 909 std::optional<OverlayManagerInfo> overlayInfo_; 910 }; 911 } // namespace OHOS::Ace::NG 912 913 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_OVERLAY_OVERLAY_MANAGER_H 914