1 /* 2 * Copyright (c) 2022-2023 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_BASE_FRAME_NODE_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_BASE_FRAME_NODE_H 18 19 #include <functional> 20 #include <list> 21 #include <utility> 22 23 #include "base/geometry/ng/offset_t.h" 24 #include "base/geometry/ng/point_t.h" 25 #include "base/geometry/ng/rect_t.h" 26 #include "base/memory/ace_type.h" 27 #include "base/memory/referenced.h" 28 #include "base/thread/cancelable_callback.h" 29 #include "base/thread/task_executor.h" 30 #include "base/utils/macros.h" 31 #include "base/utils/utils.h" 32 #include "core/accessibility/accessibility_utils.h" 33 #include "core/components/common/layout/constants.h" 34 #include "core/components_ng/base/geometry_node.h" 35 #include "core/components_ng/base/modifier.h" 36 #include "core/components_ng/base/ui_node.h" 37 #include "core/components_ng/event/event_hub.h" 38 #include "core/components_ng/event/focus_hub.h" 39 #include "core/components_ng/event/gesture_event_hub.h" 40 #include "core/components_ng/event/input_event_hub.h" 41 #include "core/components_ng/layout/layout_property.h" 42 #include "core/components_ng/property/accessibility_property.h" 43 #include "core/components_ng/property/layout_constraint.h" 44 #include "core/components_ng/property/property.h" 45 #include "core/components_ng/render/paint_property.h" 46 #include "core/components_ng/render/paint_wrapper.h" 47 #include "core/components_ng/render/render_context.h" 48 #include "core/components_v2/inspector/inspector_constants.h" 49 #include "core/components_v2/inspector/inspector_node.h" 50 51 namespace OHOS::Ace::NG { 52 class PipelineContext; 53 class Pattern; 54 class StateModifyTask; 55 class UITask; 56 class FramePorxy; 57 58 // FrameNode will display rendering region in the screen. 59 class ACE_FORCE_EXPORT FrameNode : public UINode, public LayoutWrapper { 60 DECLARE_ACE_TYPE(FrameNode, UINode, LayoutWrapper); 61 62 public: 63 // create a new child element with new element tree. 64 static RefPtr<FrameNode> CreateFrameNodeWithTree( 65 const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern); 66 67 static RefPtr<FrameNode> GetOrCreateFrameNode( 68 const std::string& tag, int32_t nodeId, const std::function<RefPtr<Pattern>(void)>& patternCreator); 69 70 // create a new element with new pattern. 71 static RefPtr<FrameNode> CreateFrameNode( 72 const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern, bool isRoot = false); 73 74 // get element with nodeId from node map. 75 static RefPtr<FrameNode> GetFrameNode(const std::string& tag, int32_t nodeId); 76 77 static void ProcessOffscreenNode(const RefPtr<FrameNode>& node); 78 // avoid use creator function, use CreateFrameNode 79 FrameNode(const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern, bool isRoot = false); 80 81 ~FrameNode() override; 82 FrameCount()83 int32_t FrameCount() const override 84 { 85 return 1; 86 } 87 88 void OnInspectorIdUpdate(const std::string& /*unused*/) override; 89 90 struct ZIndexComparator { operatorZIndexComparator91 bool operator()(const WeakPtr<FrameNode>& weakLeft, const WeakPtr<FrameNode>& weakRight) const 92 { 93 auto left = weakLeft.Upgrade(); 94 auto right = weakRight.Upgrade(); 95 if (left && right) { 96 return left->GetRenderContext()->GetZIndexValue(ZINDEX_DEFAULT_VALUE) < 97 right->GetRenderContext()->GetZIndexValue(ZINDEX_DEFAULT_VALUE); 98 } 99 return false; 100 } 101 }; 102 GetFrameChildren()103 const std::multiset<WeakPtr<FrameNode>, ZIndexComparator>& GetFrameChildren() const 104 { 105 return frameChildren_; 106 } 107 108 void InitializePatternAndContext(); 109 110 virtual void MarkModifyDone(); 111 112 void MarkDirtyNode(PropertyChangeFlag extraFlag = PROPERTY_UPDATE_NORMAL) override; 113 114 void MarkDirtyNode( 115 bool isMeasureBoundary, bool isRenderBoundary, PropertyChangeFlag extraFlag = PROPERTY_UPDATE_NORMAL); 116 117 void FlushUpdateAndMarkDirty() override; 118 119 void MarkNeedFrameFlushDirty(PropertyChangeFlag extraFlag = PROPERTY_UPDATE_NORMAL) override 120 { 121 MarkDirtyNode(extraFlag); 122 } 123 124 void OnMountToParentDone(); 125 126 void UpdateLayoutConstraint(const MeasureProperty& calcLayoutConstraint); 127 128 RefPtr<LayoutWrapperNode> CreateLayoutWrapper(bool forceMeasure = false, bool forceLayout = false) override; 129 130 RefPtr<LayoutWrapperNode> UpdateLayoutWrapper( 131 RefPtr<LayoutWrapperNode> layoutWrapper, bool forceMeasure = false, bool forceLayout = false); 132 133 std::optional<UITask> CreateLayoutTask(bool forceUseMainThread = false); 134 135 std::optional<UITask> CreateRenderTask(bool forceUseMainThread = false); 136 137 void SwapDirtyLayoutWrapperOnMainThread(const RefPtr<LayoutWrapper>& dirty); 138 139 // Clear the user callback. 140 void ClearUserOnAreaChange(); 141 142 void SetOnAreaChangeCallback(OnAreaChangedFunc&& callback); 143 144 void TriggerOnAreaChangeCallback(); 145 146 void OnConfigurationUpdate(const OnConfigurationChange& configurationChange) override; 147 AddVisibleAreaUserCallback(double ratio,const VisibleCallbackInfo & callback)148 void AddVisibleAreaUserCallback(double ratio, const VisibleCallbackInfo& callback) 149 { 150 visibleAreaUserCallbacks_[ratio] = callback; 151 } 152 ClearVisibleAreaUserCallback()153 void ClearVisibleAreaUserCallback() 154 { 155 visibleAreaUserCallbacks_.clear(); 156 } AddVisibleAreaInnerCallback(double ratio,const VisibleCallbackInfo & callback)157 void AddVisibleAreaInnerCallback(double ratio, const VisibleCallbackInfo& callback) 158 { 159 visibleAreaInnerCallbacks_[ratio] = callback; 160 } 161 162 void TriggerVisibleAreaChangeCallback(bool forceDisappear = false); 163 164 void SetGeometryNode(const RefPtr<GeometryNode>& node); 165 GetRenderContext()166 const RefPtr<RenderContext>& GetRenderContext() const 167 { 168 return renderContext_; 169 } 170 171 const RefPtr<Pattern>& GetPattern() const; 172 173 template<typename T> GetPattern()174 RefPtr<T> GetPattern() const 175 { 176 return DynamicCast<T>(pattern_); 177 } 178 179 template<typename T> GetAccessibilityProperty()180 RefPtr<T> GetAccessibilityProperty() const 181 { 182 return DynamicCast<T>(accessibilityProperty_); 183 } 184 185 template<typename T> GetLayoutProperty()186 RefPtr<T> GetLayoutProperty() const 187 { 188 return DynamicCast<T>(layoutProperty_); 189 } 190 191 template<typename T> GetPaintProperty()192 RefPtr<T> GetPaintProperty() const 193 { 194 return DynamicCast<T>(paintProperty_); 195 } 196 197 template<typename T> GetEventHub()198 RefPtr<T> GetEventHub() const 199 { 200 return DynamicCast<T>(eventHub_); 201 } 202 GetOrCreateGestureEventHub()203 RefPtr<GestureEventHub> GetOrCreateGestureEventHub() const 204 { 205 return eventHub_->GetOrCreateGestureEventHub(); 206 } 207 GetOrCreateInputEventHub()208 RefPtr<InputEventHub> GetOrCreateInputEventHub() const 209 { 210 return eventHub_->GetOrCreateInputEventHub(); 211 } 212 213 RefPtr<FocusHub> GetOrCreateFocusHub() const; 214 GetFocusHub()215 RefPtr<FocusHub> GetFocusHub() const 216 { 217 return eventHub_->GetFocusHub(); 218 } 219 GetFocusType()220 FocusType GetFocusType() const 221 { 222 FocusType type = FocusType::DISABLE; 223 auto focusHub = GetFocusHub(); 224 if (focusHub) { 225 type = focusHub->GetFocusType(); 226 } 227 return type; 228 } 229 230 static void PostTask(std::function<void()>&& task, TaskExecutor::TaskType taskType = TaskExecutor::TaskType::UI); 231 232 // If return true, will prevent TouchTest Bubbling to parent and brother nodes. 233 HitTestResult TouchTest(const PointF& globalPoint, const PointF& parentLocalPoint, 234 const PointF& parentRevertPoint, const TouchRestrict& touchRestrict, 235 TouchTestResult& result, int32_t touchId) override; 236 237 HitTestResult MouseTest(const PointF& globalPoint, const PointF& parentLocalPoint, MouseTestResult& onMouseResult, 238 MouseTestResult& onHoverResult, RefPtr<FrameNode>& hoverNode) override; 239 240 HitTestResult AxisTest( 241 const PointF& globalPoint, const PointF& parentLocalPoint, AxisTestResult& onAxisResult) override; 242 243 void CheckSecurityComponentStatus(std::vector<RectF>& rect); 244 245 bool HaveSecurityComponent(); 246 247 bool IsSecurityComponent(); 248 249 void AnimateHoverEffect(bool isHovered) const; 250 251 bool IsAtomicNode() const override; 252 253 void MarkNeedSyncRenderTree(bool needRebuild = false) override; 254 255 void RebuildRenderContextTree() override; 256 IsVisible()257 bool IsVisible() const 258 { 259 return layoutProperty_->GetVisibility().value_or(VisibleType::VISIBLE) == VisibleType::VISIBLE; 260 } 261 262 void ToJsonValue(std::unique_ptr<JsonValue>& json) const override; 263 264 void FromJson(const std::unique_ptr<JsonValue>& json) override; 265 266 RefPtr<FrameNode> GetAncestorNodeOfFrame() const; 267 GetNodeName()268 std::string& GetNodeName() 269 { 270 return nodeName_; 271 } 272 SetNodeName(std::string & nodeName)273 void SetNodeName(std::string& nodeName) 274 { 275 nodeName_ = nodeName; 276 } 277 bool IsResponseRegion() const; 278 void MarkResponseRegion(bool isResponseRegion); 279 280 void OnWindowShow() override; 281 282 void OnWindowHide() override; 283 284 void OnWindowFocused() override; 285 286 void OnWindowUnfocused() override; 287 288 void OnWindowSizeChanged(int32_t width, int32_t height, WindowSizeChangeReason type) override; 289 290 void OnNotifyMemoryLevel(int32_t level) override; 291 292 OffsetF GetOffsetRelativeToWindow() const; 293 294 OffsetF GetTransformRelativeOffset() const; 295 296 RectF GetTransformRectRelativeToWindow() const; 297 298 OffsetF GetPaintRectOffset(bool excludeSelf = false) const; 299 300 OffsetF GetPaintRectGlobalOffsetWithTranslate(bool excludeSelf = false) const; 301 302 OffsetF GetPaintRectOffsetToPage() const; 303 304 RectF GetPaintRectWithTransform() const; 305 306 VectorF GetTransformScale() const; 307 308 void AdjustGridOffset(); 309 IsInternal()310 bool IsInternal() const 311 { 312 return isInternal_; 313 } 314 SetInternal()315 void SetInternal() 316 { 317 isInternal_ = true; 318 } 319 320 int32_t GetAllDepthChildrenCount(); 321 322 void OnAccessibilityEvent( 323 AccessibilityEventType eventType, WindowsContentChangeTypes windowsContentChangeType = 324 WindowsContentChangeTypes::CONTENT_CHANGE_TYPE_INVALID) const; 325 326 void OnAccessibilityEvent( 327 AccessibilityEventType eventType, std::string beforeText, std::string latestContent) const; 328 329 void MarkNeedRenderOnly(); 330 331 void OnDetachFromMainTree(bool recursive) override; 332 void OnAttachToMainTree(bool recursive) override; 333 334 void OnVisibleChange(bool isVisible) override; 335 PushDestroyCallback(std::function<void ()> && callback)336 void PushDestroyCallback(std::function<void()>&& callback) 337 { 338 destroyCallbacks_.emplace_back(callback); 339 } 340 341 bool MarkRemoving() override; 342 343 void AddHotZoneRect(const DimensionRect& hotZoneRect) const; 344 void RemoveLastHotZoneRect() const; 345 346 virtual bool IsOutOfTouchTestRegion(const PointF& parentLocalPoint, int32_t sourceType); 347 bool CheckRectIntersect(const RectF& dest, std::vector<RectF>& origin); 348 IsLayoutDirtyMarked()349 bool IsLayoutDirtyMarked() const 350 { 351 return isLayoutDirtyMarked_; 352 } 353 HasPositionProp()354 bool HasPositionProp() const 355 { 356 CHECK_NULL_RETURN_NOLOG(renderContext_, false); 357 return renderContext_->HasPosition() || renderContext_->HasOffset() || renderContext_->HasAnchor(); 358 } 359 360 // The function is only used for fast preview. FastPreviewUpdateChildDone()361 void FastPreviewUpdateChildDone() override 362 { 363 OnMountToParentDone(); 364 } 365 IsExclusiveEventForChild()366 bool IsExclusiveEventForChild() const 367 { 368 return exclusiveEventForChild_; 369 } 370 SetExclusiveEventForChild(bool exclusiveEventForChild)371 void SetExclusiveEventForChild(bool exclusiveEventForChild) 372 { 373 exclusiveEventForChild_ = exclusiveEventForChild; 374 } 375 SetDraggable(bool draggable)376 void SetDraggable(bool draggable) 377 { 378 draggable_ = draggable; 379 userSet_ = true; 380 } 381 SetBackgroundFunction(std::function<RefPtr<UINode> ()> && buildFunc)382 void SetBackgroundFunction(std::function<RefPtr<UINode>()>&& buildFunc) 383 { 384 builderFunc_ = buildFunc; 385 backgroundNode_ = nullptr; 386 } 387 IsDraggable()388 bool IsDraggable() const 389 { 390 return draggable_; 391 } 392 IsUserSet()393 bool IsUserSet() const 394 { 395 return userSet_; 396 } 397 SetAllowDrop(const std::set<std::string> & allowDrop)398 void SetAllowDrop(const std::set<std::string>& allowDrop) 399 { 400 allowDrop_ = allowDrop; 401 } 402 GetAllowDrop()403 const std::set<std::string>& GetAllowDrop() const 404 { 405 return allowDrop_; 406 } 407 SetOverlayNode(const RefPtr<FrameNode> & overlayNode)408 void SetOverlayNode(const RefPtr<FrameNode>& overlayNode) 409 { 410 overlayNode_ = overlayNode; 411 } 412 GetOverlayNode()413 RefPtr<FrameNode> GetOverlayNode() const 414 { 415 return overlayNode_; 416 } 417 418 RefPtr<FrameNode> FindChildByPosition(float x, float y); 419 420 void CreateAnimatablePropertyFloat( 421 const std::string& propertyName, float value, const std::function<void(float)>& onCallbackEvent); 422 void UpdateAnimatablePropertyFloat(const std::string& propertyName, float value); 423 void CreateAnimatableArithmeticProperty(const std::string& propertyName, RefPtr<CustomAnimatableArithmetic>& value, 424 std::function<void(const RefPtr<CustomAnimatableArithmetic>&)>& onCallbackEvent); 425 void UpdateAnimatableArithmeticProperty(const std::string& propertyName, RefPtr<CustomAnimatableArithmetic>& value); 426 427 void SetHitTestMode(HitTestMode mode); 428 HitTestMode GetHitTestMode() const override; 429 430 std::string ProvideRestoreInfo(); 431 432 static std::vector<RefPtr<FrameNode>> GetNodesById(const std::unordered_set<int32_t>& set); 433 SetViewPort(RectF viewPort)434 void SetViewPort(RectF viewPort) 435 { 436 viewPort_ = viewPort; 437 } 438 GetSelfViewPort()439 std::optional<RectF> GetSelfViewPort() const 440 { 441 return viewPort_; 442 } 443 444 std::optional<RectF> GetViewPort() const; 445 446 enum class SceneStatus { 447 START, 448 RUNNING, 449 END, 450 }; 451 // Frame Rate Controller(FRC) decides FrameRateRange by scene, speed and scene status 452 void AddFRCSceneInfo(const std::string& name, float speed, SceneStatus status); 453 454 OffsetF GetParentGlobalOffsetDuringLayout() const; OnSetCacheCount(int32_t cacheCount,const std::optional<LayoutConstraintF> & itemConstraint)455 void OnSetCacheCount(int32_t cacheCount, const std::optional<LayoutConstraintF>& itemConstraint) override {}; 456 457 // layoutwrapper function override 458 const RefPtr<LayoutAlgorithmWrapper>& GetLayoutAlgorithm(bool needReset = false) override; 459 460 void Measure(const std::optional<LayoutConstraintF>& parentConstraint) override; 461 462 // Called to perform layout children. 463 void Layout() override; 464 GetTotalChildCount()465 int32_t GetTotalChildCount() const override 466 { 467 return UINode::TotalChildCount(); 468 } 469 GetGeometryNode()470 const RefPtr<GeometryNode>& GetGeometryNode() const override 471 { 472 return geometryNode_; 473 } 474 SetLayoutProperty(const RefPtr<LayoutProperty> & layoutProperty)475 void SetLayoutProperty(const RefPtr<LayoutProperty>& layoutProperty) 476 { 477 layoutProperty_ = layoutProperty; 478 layoutProperty_->SetHost(WeakClaim(this)); 479 } 480 GetLayoutProperty()481 const RefPtr<LayoutProperty>& GetLayoutProperty() const override 482 { 483 return layoutProperty_; 484 } 485 486 RefPtr<LayoutWrapper> GetOrCreateChildByIndex(uint32_t index, bool addToRenderTree = true) override; 487 RefPtr<LayoutWrapper> GetChildByIndex(uint32_t index) override; 488 const std::list<RefPtr<LayoutWrapper>>& GetAllChildrenWithBuild(bool addToRenderTree = true) override; 489 void RemoveChildInRenderTree(uint32_t index) override; 490 void RemoveAllChildInRenderTree() override; 491 void DoRemoveChildInRenderTree(uint32_t index, bool isAll) override; GetHostTag()492 const std::string& GetHostTag() const override 493 { 494 return GetTag(); 495 } 496 IsActive()497 bool IsActive() const override 498 { 499 return isActive_; 500 } 501 502 void SetActive(bool active = true) override; 503 IsOutOfLayout()504 bool IsOutOfLayout() const override 505 { 506 return renderContext_->HasPosition(); 507 } 508 509 bool SkipMeasureContent() const override; 510 float GetBaselineDistance() const override; 511 void SetCacheCount( 512 int32_t cacheCount = 0, const std::optional<LayoutConstraintF>& itemConstraint = std::nullopt) override; 513 514 void SyncGeometryNode(); 515 RefPtr<UINode> GetFrameChildByIndex(uint32_t index, bool needBuild) override; 516 bool CheckNeedForceMeasureAndLayout() override; 517 ForceSyncGeometryNode()518 void ForceSyncGeometryNode() 519 { 520 CHECK_NULL_VOID_NOLOG(renderContext_); 521 oldGeometryNode_.Reset(); 522 renderContext_->SyncGeometryProperties(RawPtr(geometryNode_)); 523 } 524 525 template<typename T> FindFocusChildNodeOfClass()526 RefPtr<T> FindFocusChildNodeOfClass() 527 { 528 const auto& children = GetChildren(); 529 for (auto iter = children.rbegin(); iter != children.rend(); ++iter) { 530 auto& child = *iter; 531 auto target = DynamicCast<FrameNode>(child->FindChildNodeOfClass<T>()); 532 if (target) { 533 auto focusEvent = target->eventHub_->GetFocusHub(); 534 if (focusEvent && focusEvent->IsCurrentFocus()) { 535 return AceType::DynamicCast<T>(target); 536 } 537 } 538 } 539 540 if (AceType::InstanceOf<T>(this)) { 541 auto target = DynamicCast<FrameNode>(this); 542 if (target) { 543 auto focusEvent = target->eventHub_->GetFocusHub(); 544 if (focusEvent && focusEvent->IsCurrentFocus()) { 545 return Claim(AceType::DynamicCast<T>(this)); 546 } 547 } 548 } 549 return nullptr; 550 } 551 552 private: 553 void MarkNeedRender(bool isRenderBoundary); 554 std::pair<float, float> ContextPositionConvertToPX( 555 const RefPtr<RenderContext>& context, const SizeF& percentReference) const; 556 bool IsNeedRequestParentMeasure() const; 557 void UpdateLayoutPropertyFlag() override; 558 void ForceUpdateLayoutPropertyFlag(PropertyChangeFlag propertyChangeFlag) override; 559 void AdjustParentLayoutFlag(PropertyChangeFlag& flag) override; 560 561 void UpdateChildrenLayoutWrapper(const RefPtr<LayoutWrapperNode>& self, bool forceMeasure, bool forceLayout); 562 void AdjustLayoutWrapperTree(const RefPtr<LayoutWrapperNode>& parent, bool forceMeasure, bool forceLayout) override; 563 564 LayoutConstraintF GetLayoutConstraint() const; 565 OffsetF GetParentGlobalOffset() const; 566 567 RefPtr<PaintWrapper> CreatePaintWrapper(); 568 void LayoutOverlay(); 569 570 void OnGenerateOneDepthVisibleFrame(std::list<RefPtr<FrameNode>>& visibleList) override; 571 void OnGenerateOneDepthVisibleFrameWithTransition(std::list<RefPtr<FrameNode>>& visibleList) override; 572 void OnGenerateOneDepthAllFrame(std::list<RefPtr<FrameNode>>& allList) override; 573 574 bool IsMeasureBoundary(); 575 bool IsRenderBoundary(); 576 577 bool OnRemoveFromParent(bool allowTransition) override; 578 bool RemoveImmediately() const override; 579 580 // dump self info. 581 void DumpInfo() override; 582 583 void DumpOverlayInfo(); 584 585 void FocusToJsonValue(std::unique_ptr<JsonValue>& json) const; 586 void MouseToJsonValue(std::unique_ptr<JsonValue>& json) const; 587 void TouchToJsonValue(std::unique_ptr<JsonValue>& json) const; 588 void GeometryNodeToJsonValue(std::unique_ptr<JsonValue>& json) const; 589 590 bool GetTouchable() const; 591 virtual std::vector<RectF> GetResponseRegionList(const RectF& rect, int32_t sourceType); 592 bool InResponseRegionList(const PointF& parentLocalPoint, const std::vector<RectF>& responseRegionList) const; 593 594 void ProcessAllVisibleCallback( 595 std::unordered_map<double, VisibleCallbackInfo>& visibleAreaCallbacks, double currentVisibleRatio); 596 void OnVisibleAreaChangeCallback( 597 VisibleCallbackInfo& callbackInfo, bool visibleType, double currentVisibleRatio, bool isHandled); 598 double CalculateCurrentVisibleRatio(const RectF& visibleRect, const RectF& renderRect); 599 600 // set costom background layoutConstraint 601 void SetBackgroundLayoutConstraint(const RefPtr<FrameNode>& customNode); 602 603 void GetPercentSensitive(); 604 void UpdatePercentSensitive(); 605 606 // sort in ZIndex. 607 std::multiset<WeakPtr<FrameNode>, ZIndexComparator> frameChildren_; 608 RefPtr<GeometryNode> geometryNode_ = MakeRefPtr<GeometryNode>(); 609 610 std::list<std::function<void()>> destroyCallbacks_; 611 std::unordered_map<double, VisibleCallbackInfo> visibleAreaUserCallbacks_; 612 std::unordered_map<double, VisibleCallbackInfo> visibleAreaInnerCallbacks_; 613 614 RefPtr<AccessibilityProperty> accessibilityProperty_; 615 RefPtr<LayoutProperty> layoutProperty_; 616 RefPtr<PaintProperty> paintProperty_; 617 RefPtr<RenderContext> renderContext_ = RenderContext::Create(); 618 RefPtr<EventHub> eventHub_; 619 RefPtr<Pattern> pattern_; 620 621 RefPtr<FrameNode> backgroundNode_; 622 std::function<RefPtr<UINode>()> builderFunc_; 623 std::unique_ptr<RectF> lastFrameRect_; 624 std::unique_ptr<OffsetF> lastParentOffsetToWindow_; 625 std::set<std::string> allowDrop_; 626 std::optional<RectF> viewPort_; 627 628 RefPtr<LayoutAlgorithmWrapper> layoutAlgorithm_; 629 RefPtr<GeometryNode> oldGeometryNode_; 630 std::optional<bool> skipMeasureContent_; 631 std::unique_ptr<FramePorxy> frameProxy_; 632 633 bool needSyncRenderTree_ = false; 634 635 bool isLayoutDirtyMarked_ = false; 636 bool isRenderDirtyMarked_ = false; 637 bool isMeasureBoundary_ = false; 638 bool hasPendingRequest_ = false; 639 640 // for container, this flag controls only the last child in touch area is consuming event. 641 bool exclusiveEventForChild_ = false; 642 bool isActive_ = false; 643 bool isResponseRegion_ = false; 644 bool bypass_ = false; 645 646 double lastVisibleRatio_ = 0.0; 647 648 // internal node such as Text in Button CreateWithLabel 649 // should not seen by preview inspector or accessibility 650 bool isInternal_ = false; 651 652 std::string nodeName_; 653 654 bool draggable_ = false; 655 bool userSet_ = false; 656 657 std::map<std::string, RefPtr<NodeAnimatablePropertyBase>> nodeAnimatablePropertyMap_; 658 659 bool isRestoreInfoUsed_ = false; 660 661 RefPtr<FrameNode> overlayNode_; 662 663 friend class RosenRenderContext; 664 friend class RenderContext; 665 friend class Pattern; 666 667 ACE_DISALLOW_COPY_AND_MOVE(FrameNode); 668 }; 669 } // namespace OHOS::Ace::NG 670 671 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_BASE_FRAME_NODE_H 672