1 /* 2 * Copyright (c) 2022-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_TAB_CONTENT_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_TAB_CONTENT_MODEL_IMPL_H 18 19 #include "core/components_ng/pattern/tabs/tab_content_model.h" 20 #include "core/components_v2/tabs/tab_content_item_component.h" 21 22 namespace OHOS::Ace::Framework { 23 24 class TabContentModelImpl : public OHOS::Ace::TabContentModel { 25 public: 26 void Create(std::function<void()>&& deepRenderFunc) override; 27 void Create() override; 28 void Pop() override; 29 void SetTabBar(const std::optional<std::string>& text, const std::optional<std::string>& icon, 30 const std::optional<TabBarSymbol>& tabBarSymbol, std::function<void()>&& builder, 31 bool useContentOnly) override; SetTabBarStyle(TabBarStyle tabBarStyle)32 void SetTabBarStyle(TabBarStyle tabBarStyle) override {} SetIndicator(const IndicatorStyle & indicator)33 void SetIndicator(const IndicatorStyle& indicator) override {} SetBoard(const BoardStyle & board)34 void SetBoard(const BoardStyle& board) override {} SetSelectedMode(SelectedMode selectedMode)35 void SetSelectedMode(SelectedMode selectedMode) override {} SetLabelStyle(const LabelStyle & labelStyle)36 void SetLabelStyle(const LabelStyle& labelStyle) override {} SetIconStyle(const IconStyle & iconStyle)37 void SetIconStyle(const IconStyle& iconStyle) override {} SetPadding(const NG::PaddingProperty & padding)38 void SetPadding(const NG::PaddingProperty& padding) override {} SetUseLocalizedPadding(bool useLocalizedPadding)39 void SetUseLocalizedPadding(bool useLocalizedPadding) override {} SetLayoutMode(LayoutMode layoutMode)40 void SetLayoutMode(LayoutMode layoutMode) override {} SetVerticalAlign(FlexAlign verticalAlign)41 void SetVerticalAlign(FlexAlign verticalAlign) override {} SetSymmetricExtensible(bool isExtensible)42 void SetSymmetricExtensible(bool isExtensible) override {} SetId(const std::string & id)43 void SetId(const std::string& id) override {} SetOnWillShow(std::function<void ()> && onWillShow)44 void SetOnWillShow(std::function<void()>&& onWillShow) override {} SetOnWillHide(std::function<void ()> && onWillHide)45 void SetOnWillHide(std::function<void()>&& onWillHide) override {} 46 47 private: 48 RefPtr<Component> ProcessTabBarBuilderFunction( 49 RefPtr<V2::TabContentItemComponent>& tabContent, std::function<void()>&& builderFunc); 50 RefPtr<Component> ProcessTabBarTextIconPair(RefPtr<V2::TabContentItemComponent>& tabContent, 51 const std::optional<std::string>& textVal, const std::optional<std::string>& iconVal); 52 RefPtr<Component> CreateTabBarLabelComponent( 53 RefPtr<V2::TabContentItemComponent>& tabContent, const std::string& labelStr); 54 RefPtr<Component> ProcessTabBarLabel( 55 RefPtr<V2::TabContentItemComponent>& tabContent, const std::optional<std::string>& textVal); 56 }; 57 58 } // namespace OHOS::Ace::Framework 59 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_TAB_CONTENT_MODEL_IMPL_H 60