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_SIDE_BAR_CONTAINER_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SIDE_BAR_CONTAINER_MODEL_IMPL_H 18 19 #include "bridge/declarative_frontend/jsview/js_stack.h" 20 #include "core/components/side_bar/side_bar_container_component.h" 21 #include "core/components_ng/pattern/side_bar/side_bar_container_model.h" 22 23 namespace OHOS::Ace::Framework { 24 class ACE_EXPORT SideBarContainerModelImpl : public SideBarContainerModel { 25 public: Create()26 void Create() override {} 27 void SetSideBarContainerType(SideBarContainerType type) override; 28 void SetShowSideBar(bool isShow) override; 29 void SetShowControlButton(bool showControlButton) override; 30 void ParseAndSetWidth(WidthType widthType, Dimension& width) override; 31 void SetSideBarWidth(const Dimension& sideBarWidth) override; 32 void SetMinSideBarWidth(const Dimension& minSideBarWidth) override; 33 void SetMaxSideBarWidth(const Dimension& maxSideBarWidth) override; 34 void SetAutoHide(bool autoHide) override; 35 void SetSideBarPosition(SideBarPosition sideBarPosition) override; 36 void SetControlButtonWidth(const Dimension& width) override; 37 void SetControlButtonHeight(const Dimension& height) override; 38 void SetControlButtonLeft(const Dimension& left) override; 39 void SetControlButtonTop(const Dimension& top) override; 40 void SetControlButtonShowIconInfo( 41 const std::string& showIconStr, bool isPixelMap, RefPtr<PixelMap> pixMap) override; 42 void SetControlButtonHiddenIconInfo( 43 const std::string& hiddenIconStr, bool isPixelMap, RefPtr<PixelMap> pixMap) override; 44 void SetControlButtonSwitchingIconInfo( 45 const std::string& switchingIconStr, bool isPixelMap, RefPtr<PixelMap> pixMap) override; 46 void ResetControlButtonIconInfo() override; 47 void SetOnChange(std::function<void(const bool)>&& onChange) override; 48 void SetDividerStrokeWidth(const Dimension& strokeWidth) override; 49 void SetDividerColor(const Color& color) override; 50 void SetDividerStartMargin(const Dimension& startMargin) override; 51 void SetDividerEndMargin(const Dimension& endMargin) override; SetOnChangeEvent(std::function<void (const bool)> && onChange)52 void SetOnChangeEvent(std::function<void(const bool)>&& onChange) override {}; 53 void SetMinContentWidth(const Dimension& minContentWidth) override; 54 55 private: 56 void MarkNeedInitRealSideBarWidth() override; 57 }; 58 } // namespace OHOS::Ace::Framework 59 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_SIDE_BAR_CONTAINER_MODEL_IMPL_H 60