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