1 /* 2 * Copyright (c) 2021 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_PANEL_SLIDING_PANEL_COMPONENT_V2_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_PANEL_SLIDING_PANEL_COMPONENT_V2_H 18 19 #include "core/components/panel/sliding_panel_component.h" 20 21 namespace OHOS::Ace { 22 23 class ACE_EXPORT SlidingPanelComponentV2 : public SlidingPanelComponent { 24 DECLARE_ACE_TYPE(SlidingPanelComponentV2, SlidingPanelComponent); 25 26 public: 27 void OnChildAdded(const RefPtr<Component>& child) override; 28 GetBoxStyle()29 const RefPtr<BoxComponent>& GetBoxStyle() const 30 { 31 return boxStyle_; 32 } 33 SetBoxStyle(const RefPtr<BoxComponent> & boxStyle)34 void SetBoxStyle(const RefPtr<BoxComponent>& boxStyle) 35 { 36 boxStyle_ = boxStyle; 37 } 38 HasDecorationStyle()39 bool HasDecorationStyle() const 40 { 41 return hasDecorationStyle_; 42 } 43 SetHasDecorationStyle(bool hasDecorationStyle)44 void SetHasDecorationStyle(bool hasDecorationStyle) 45 { 46 hasDecorationStyle_ = hasDecorationStyle; 47 } 48 HasBorderStyle()49 bool HasBorderStyle() const 50 { 51 return hasBorderStyle_; 52 } 53 SetHasBorderStyle(bool hasBorderStyle)54 void SetHasBorderStyle(bool hasBorderStyle) 55 { 56 hasBorderStyle_ = hasBorderStyle; 57 } 58 HasBgStyle()59 bool HasBgStyle() const 60 { 61 return hasBgStyle_; 62 } 63 SetHasBgStyle(bool hasBgStyle)64 void SetHasBgStyle(bool hasBgStyle) 65 { 66 hasBgStyle_ = hasBgStyle; 67 } 68 69 protected: 70 void BuildInnerChild(); 71 72 RefPtr<BoxComponent> boxStyle_; 73 bool hasDecorationStyle_ = false; 74 bool hasBorderStyle_ = false; 75 bool hasBgStyle_ = false; 76 }; 77 78 } // namespace OHOS::Ace 79 80 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_PANEL_SLIDING_PANEL_COMPONENT_V2_H 81