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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_NAVIGATION_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_NAVIGATION_MODEL_IMPL_H 18 19 #include "frameworks/core/components_ng/pattern/navigation/navigation_model.h" 20 21 namespace OHOS::Ace::Framework { 22 class NavigationModelImpl : public NavigationModel { 23 public: 24 void Create() override; 25 void SetNavigationStack() override; 26 void SetNavigationStack(const RefPtr<NG::NavigationStack>& navigationStack) override; 27 void SetNavigationStackProvided(bool provided) override; 28 void SetTitle(const std::string& title, bool hasSubTitle = false) override; 29 void SetCustomTitle(const RefPtr<AceType>& customTitle) override; 30 void SetTitleHeight(const Dimension& height, bool isValid = true) override; 31 void SetTitleMode(NG::NavigationTitleMode mode) override; 32 void SetSubtitle(const std::string& subtitle) override; 33 void SetEnableModeChangeAnimation(bool isEnable) override; 34 void SetHideTitleBar(bool hideTitleBar, bool animated = false) override; 35 void SetHideNavBar(bool hideNavBar) override; 36 void SetBackButtonIcon(const std::function<void(WeakPtr<NG::FrameNode>)>& symbolApply, const std::string& src, 37 const NG::ImageOption& imageOption, RefPtr<PixelMap>& pixMap, 38 const std::vector<std::string>& nameList) override; 39 void SetHideBackButton(bool hideBackButton) override; 40 void SetHideToolBar(bool hideToolBar, bool animated = false) override; 41 void SetCustomToolBar(const RefPtr<AceType>& customToolBar) override; 42 bool NeedSetItems() override; 43 void SetToolBarItems(std::vector<NG::BarItem>&& toolBarItems) override; 44 void SetToolbarConfiguration(std::vector<NG::BarItem>&& toolBarItems) override; 45 void GetToolBarItems(std::list<RefPtr<AceType>>& items) override; 46 void SetMenuItems(std::vector<NG::BarItem>&& menuItems) override; 47 void GetMenuItems(std::list<RefPtr<AceType>>& items) override; 48 void SetCustomMenu(const RefPtr<AceType>& customMenu) override; 49 void SetOnTitleModeChange(std::function<void(NG::NavigationTitleMode)>&& onTitleModeChange, 50 std::function<void(const BaseEventInfo* baseInfo)>&& eventInfo) override; 51 void SetUsrNavigationMode(NG::NavigationMode mode) override; 52 void SetNavBarPosition(NG::NavBarPosition mode) override; 53 void SetNavBarWidth(const Dimension& value) override; SetMinNavBarWidth(const Dimension & value)54 void SetMinNavBarWidth(const Dimension& value) override {} SetMaxNavBarWidth(const Dimension & value)55 void SetMaxNavBarWidth(const Dimension& value) override {} SetMinContentWidth(const Dimension & value)56 void SetMinContentWidth(const Dimension& value) override {} 57 void SetOnNavBarStateChange(std::function<void(bool)>&& onNavBarStateChange) override; 58 void SetNavigationMode(NG::NavigationMode mode) override; 59 void SetNavDestination(std::function<void(std::string)>&& builder) override; 60 RefPtr<NG::NavigationStack> GetNavigationStack() override; 61 void SetMenuCount(int32_t menuCount) override; 62 void SetOnNavigationModeChange(std::function<void(NG::NavigationMode)>&& modeChange) override; 63 void SetIsCustomAnimation(bool isCustom) override; 64 void SetCustomTransition(NavigationTransitionEvent&& animationTransition) override; 65 void SetIgnoreLayoutSafeArea(const NG::SafeAreaExpandOpts& opts) override; 66 }; 67 } // namespace OHOS::Ace::Framework 68 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_NAVIGATION_MODEL_IMPL_H 69