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_CORE_COMMON_FORCE_SPLIT_FORCE_SPLIT_UTILS_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_FORCE_SPLIT_FORCE_SPLIT_UTILS_H 18 19 #include "core/components_ng/base/frame_node.h" 20 #include "core/pipeline_ng/pipeline_context.h" 21 22 namespace OHOS::Ace::NG { 23 24 class NavDestinationGroupNode; 25 class NavBarNode; 26 27 struct ForceSplitConfig { 28 bool isArkUIHookEnabled = false; 29 std::optional<std::string> navigationId; 30 std::optional<int32_t> navigationDepth; 31 }; 32 33 class ForceSplitUtils { 34 public: 35 static RefPtr<FrameNode> CreatePlaceHolderContent(const RefPtr<PipelineContext>& context); 36 static RefPtr<NavDestinationGroupNode> CreateNavDestinationProxyNode(); 37 static bool IsHomePageNavDestination(const RefPtr<NavDestinationGroupNode>& node); 38 static bool IsHomePageNavBar(const RefPtr<NavBarNode>& navBar); 39 static RefPtr<FrameNode> CreatePlaceHolderNode(); 40 static bool ParseForceSplitConfig(const std::string& configJsonStr, ForceSplitConfig& config); 41 }; 42 43 } // namespace OHOS::Ace::NG 44 45 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_FORCE_SPLIT_FORCE_SPLIT_UTILS_H 46