• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_PATTERNS_NAVIGATION_NAVIGATION_MODEL_NG_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAVIGATION_MODEL_NG_H
18 
19 #include "core/components_ng/pattern/navigation/navigation_model.h"
20 
21 namespace OHOS::Ace::NG {
22 class ACE_EXPORT NavigationModelNG : public OHOS::Ace::NavigationModel {
23 public:
24     void Create() override;
25     void SetNavigationStack() override;
26     void SetNavigationStack(RefPtr<NG::NavigationStack>&& navigationStack) override;
27     void SetNavigationStackProvided(bool provided) override;
28     bool ParseCommonTitle(bool hasSubTitle, bool hasMainTitle, const std::string& subtitle,
29         const std::string& title) override;
30     void SetTitle(const std::string& title, bool hasSubTitle = false) override;
31     void SetCustomTitle(const RefPtr<AceType>& customNode) override;
32     void SetTitleHeight(const Dimension& height) override;
33     void SetTitleMode(NG::NavigationTitleMode mode) override;
34     void SetSubtitle(const std::string& subtitle) override;
35     void SetHideTitleBar(bool hideTitleBar) override;
36     void SetHideNavBar(bool hideNavBar) override;
37     void SetBackButtonIcon(const std::string& src, bool noPixMap, RefPtr<PixelMap>& pixMap) override;
38     void SetHideBackButton(bool hideBackButton) override;
39     void SetHideToolBar(bool hideToolBar) override;
40     void SetCustomToolBar(const RefPtr<AceType>& customNode) override;
41     bool NeedSetItems() override;
42 
43     void SetToolBarItems(std::vector<NG::BarItem>&& toolBarItems) override;
44     void SetToolbarConfiguration(std::vector<NG::BarItem>&& toolBarItems) override;
45     void SetMenuItems(std::vector<NG::BarItem>&& menuItems) override;
46     void SetCustomMenu(const RefPtr<AceType>& customNode) override;
47     void SetOnTitleModeChange(std::function<void(NG::NavigationTitleMode)>&& onTitleModeChange,
48         std::function<void(const BaseEventInfo* baseInfo)>&& eventInfo) override;
49     void SetUsrNavigationMode(NG::NavigationMode mode) override;
50     void SetNavBarPosition(NG::NavBarPosition mode) override;
51     void SetNavBarWidth(const Dimension& value) override;
52     void SetMinNavBarWidth(const Dimension& value) override;
53     void SetMaxNavBarWidth(const Dimension& value) override;
54     void SetMinContentWidth(const Dimension& value) override;
55     void SetOnNavBarStateChange(std::function<void(bool)>&& onNavBarStateChange) override;
56     void SetNavigationMode(NG::NavigationMode mode) override;
57     void SetNavDestination(std::function<void(std::string)>&& builder) override;
58     RefPtr<NG::NavigationStack> GetNavigationStack() override;
59     void SetMenuCount(int32_t menuCount) override;
60 };
61 } // namespace OHOS::Ace::NG
62 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAVIGATION_MODEL_NG_H
63