1 /*
2  * Copyright (c) 2021-2022 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_SPLIT_CONTAINER_SPLIT_CONTAINER_COMPONENT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SPLIT_CONTAINER_SPLIT_CONTAINER_COMPONENT_H
18 
19 #include "base/memory/ace_type.h"
20 #include "core/pipeline/base/component.h"
21 #include "core/pipeline/base/component_group.h"
22 
23 namespace OHOS::Ace {
24 
25 enum class SplitType {
26     ROW_SPLIT,
27     COLUMN_SPLIT,
28 };
29 
30 class ACE_EXPORT SplitContainerComponent : virtual public ComponentGroup {
DECLARE_ACE_TYPE(SplitContainerComponent,ComponentGroup)31     DECLARE_ACE_TYPE(SplitContainerComponent, ComponentGroup)
32 
33 public:
34     SplitContainerComponent(const std::list<RefPtr<Component>>& children, SplitType splitType)
35         : ComponentGroup(children), splitType_(splitType)
36     {}
37     ~SplitContainerComponent() override = default;
38 
GetResizable()39     bool GetResizable()
40     {
41         return resizable_;
42     }
SetResizable(bool resizable)43     void SetResizable(bool resizable)
44     {
45         resizable_ = resizable;
46     }
47 
GetSplitType()48     SplitType GetSplitType() const
49     {
50         return splitType_;
51     }
52 
53 private:
54     bool resizable_ = false;
55     SplitType splitType_ = SplitType::ROW_SPLIT;
56 };
57 
58 } // namespace OHOS::Ace
59 
60 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SPLIT_CONTAINER_SPLIT_CONTAINER_COMPONENT_H