1 /*
2  * Copyright (c) 2022 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_NAVIGATION_NAV_BAR_NODE_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAV_BAR_NODE_H
18 
19 #include <cstdint>
20 #include <list>
21 
22 #include "core/animation/page_transition_common.h"
23 #include "core/components_ng/base/frame_node.h"
24 #include "core/components_ng/base/group_node.h"
25 #include "core/components_ng/pattern/navigation/bar_item_node.h"
26 #include "core/components_ng/pattern/navigation/navdestination_node_base.h"
27 #include "core/components_ng/pattern/navigation/navigation_declaration.h"
28 #include "core/components_ng/pattern/navigation/title_bar_node.h"
29 #include "core/components_ng/property/property.h"
30 
31 namespace OHOS::Ace::NG {
32 class InspectorFilter;
33 
34 class ACE_EXPORT NavBarNode : public NavDestinationNodeBase {
DECLARE_ACE_TYPE(NavBarNode,NavDestinationNodeBase)35     DECLARE_ACE_TYPE(NavBarNode, NavDestinationNodeBase)
36 public:
37     NavBarNode(const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern)
38         : NavDestinationNodeBase(tag, nodeId, pattern) {}
39     ~NavBarNode() override = default;
40     void AddChildToGroup(const RefPtr<UINode>& child, int32_t slot = DEFAULT_NODE_SLOT) override;
41     static RefPtr<NavBarNode> GetOrCreateNavBarNode(
42         const std::string& tag, int32_t nodeId, const std::function<RefPtr<Pattern>(void)>& patternCreator);
43 
44     void InitSystemTransitionPop();
45     void SystemTransitionPushAction(bool isFinish);
46     void StartSystemTransitionPush();
47     void StartSystemTransitionPop();
48     bool IsNodeInvisible(const RefPtr<FrameNode>& node) override;
49 };
50 
51 } // namespace OHOS::Ace::NG
52 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAV_BAR_NODE_H
53