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_DRAG_BAR_DRAG_BAR_COMPONENT_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DRAG_BAR_DRAG_BAR_COMPONENT_H 18 19 #include "core/components/common/layout/constants.h" 20 #include "core/components/image/image_component.h" 21 #include "core/pipeline/base/render_component.h" 22 23 namespace OHOS::Ace { 24 25 class DragBarComponent : public RenderComponent { 26 DECLARE_ACE_TYPE(DragBarComponent, RenderComponent); 27 28 public: 29 RefPtr<Element> CreateElement() override; 30 RefPtr<RenderNode> CreateRenderNode() override; 31 SetPanelMode(PanelMode mode)32 void SetPanelMode(PanelMode mode) 33 { 34 mode_ = mode; 35 } 36 GetPanelMode()37 PanelMode GetPanelMode() const 38 { 39 return mode_; 40 } 41 HasDragBar()42 bool HasDragBar() const 43 { 44 return hasDragBar_; 45 } 46 SetHasDragBar(bool hasDragBar)47 void SetHasDragBar(bool hasDragBar) 48 { 49 hasDragBar_ = hasDragBar; 50 } 51 52 private: 53 PanelMode mode_ = PanelMode::FULL; 54 bool hasDragBar_ = true; 55 }; 56 57 } // namespace OHOS::Ace 58 59 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DRAG_BAR_DRAG_BAR_COMPONENT_H 60