1 /* 2 * Copyright (c) 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_PATTERN_RENDER_NODE_RENDER_NODE_PAINT_PROPERTY_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_RENDER_NODE_RENDER_NODE_PAINT_PROPERTY_H 18 19 #include <cstdint> 20 #include "core/components_ng/render/paint_property.h" 21 #include "core/components_ng/base/frame_node.h" 22 23 namespace OHOS::Ace::NG { 24 class RenderNodePaintProperty : public PaintProperty { 25 DECLARE_ACE_TYPE(RenderNodePaintProperty, PaintProperty) 26 private: 27 WeakPtr<FrameNode> host_; 28 29 public: 30 RenderNodePaintProperty() = default; 31 ~RenderNodePaintProperty() override = default; 32 SetHost(const WeakPtr<FrameNode> & host)33 void SetHost(const WeakPtr<FrameNode>& host) 34 { 35 host_ = host; 36 } 37 GetHost()38 RefPtr<FrameNode> GetHost() const 39 { 40 return host_.Upgrade(); 41 } 42 43 ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(RenderNodeFlag, int32_t, PROPERTY_UPDATE_RENDER); 44 }; 45 } 46 47 #endif 48