• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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_BASE_UTIL_BUILDER_UTILS_H
17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_UTIL_BUILDER_UTILS_H
18 
19 #include "core/components_ng/base/ui_node.h"
20 
21 namespace OHOS::Ace::BuilderUtils {
22     bool IsBuilderRootNode(const RefPtr<NG::UINode>& node);
23     bool IsBuilderContainer(const RefPtr<NG::UINode>& node);
24     void AddBuilderToParent(const RefPtr<NG::UINode>& parentNode, std::list<RefPtr<NG::UINode>> nodes);
25     void AddBuilderToParent(const RefPtr<NG::UINode>& parentNode, const RefPtr<NG::UINode>& childNode);
26     void AddBuilderToContainer(const RefPtr<NG::UINode>& node, const std::list<RefPtr<NG::UINode>>& nodes);
27     void AddBuilderToBuilder(const RefPtr<NG::UINode>& node, const std::list<RefPtr<NG::UINode>>& nodes);
28     void RemoveBuilderFromParent(const RefPtr<NG::UINode>& parentNode, std::list<RefPtr<NG::UINode>> nodes);
29     void RemoveBuilderFromParent(const RefPtr<NG::UINode>& parentNode, const RefPtr<NG::UINode>& childNode);
30     void RemoveBuilderFromContainer(const RefPtr<NG::UINode>& node, const std::list<RefPtr<NG::UINode>>& nodes);
31     void RemoveBuilderFromBuilder(const RefPtr<NG::UINode>& node, const std::list<RefPtr<NG::UINode>>& nodes);
32     void GetBuilderNodes(const RefPtr<NG::UINode>& node, std::list<RefPtr<NG::UINode>>& nodes);
33     void GetFirstBuilderNode(const RefPtr<NG::UINode>& node, std::list<RefPtr<NG::UINode>>& nodes);
34     void ClearChildInBuilderContainer(int32_t nodeId, std::list<RefPtr<NG::UINode>>& nodes);
35 } // namespace OHOS::Ace::BuilderUtils
36 
37 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_UTIL_BUILDER_UTILS_H
38