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(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>& customTitle) 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>& customToolBar) override; 41 bool NeedSetItems() override; 42 void SetToolBarItems(std::vector<NG::BarItem>&& toolBarItems) override; 43 void SetToolbarConfiguration(std::vector<NG::BarItem>&& toolBarItems) override; 44 void GetToolBarItems(std::list<RefPtr<AceType>>& items) override; 45 void SetMenuItems(std::vector<NG::BarItem>&& menuItems) override; 46 void GetMenuItems(std::list<RefPtr<AceType>>& items) override; 47 void SetCustomMenu(const RefPtr<AceType>& customMenu) override; 48 void SetOnTitleModeChange(std::function<void(NG::NavigationTitleMode)>&& onTitleModeChange, 49 std::function<void(const BaseEventInfo* baseInfo)>&& eventInfo) override; 50 void SetUsrNavigationMode(NG::NavigationMode mode) override; 51 void SetNavBarPosition(NG::NavBarPosition mode) override; 52 void SetNavBarWidth(const Dimension& value) override; SetMinNavBarWidth(const Dimension & value)53 void SetMinNavBarWidth(const Dimension& value) override {} SetMaxNavBarWidth(const Dimension & value)54 void SetMaxNavBarWidth(const Dimension& value) override {} SetMinContentWidth(const Dimension & value)55 void SetMinContentWidth(const Dimension& value) override {} 56 void SetOnNavBarStateChange(std::function<void(bool)>&& onNavBarStateChange) override; 57 void SetNavigationMode(NG::NavigationMode mode) override; 58 void SetNavDestination(std::function<void(std::string)>&& builder) override; 59 RefPtr<NG::NavigationStack> GetNavigationStack() override; 60 void SetMenuCount(int32_t menuCount) override; 61 }; 62 } // namespace OHOS::Ace::Framework 63 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_NAVIGATION_MODEL_IMPL_H 64