1 /*
2  * Copyright (c) 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_V2_GRID_LAYOUT_RENDER_GRID_COL_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_GRID_LAYOUT_RENDER_GRID_COL_H
18 
19 #include "core/components_v2/grid_layout/grid_container_util_class.h"
20 #include "core/pipeline/base/render_node.h"
21 
22 namespace OHOS::Ace::V2 {
23 
24 class RenderGridCol : public RenderNode {
25     DECLARE_ACE_TYPE(RenderGridCol, RenderNode);
26 
27 public:
28     ~RenderGridCol() override = default;
29 
30     static RefPtr<RenderNode> Create();
31 
32     void Update(const RefPtr<Component>& component) override;
33     void PerformLayout() override;
SetSizeType(GridSizeType sizeType)34     void SetSizeType(GridSizeType sizeType)
35     {
36         sizeType_ = sizeType;
37     }
GetSizeType()38     GridSizeType GetSizeType() const
39     {
40         return sizeType_;
41     }
42 
43     int32_t GetSpan(GridSizeType sizeType) const;
44     int32_t GetOffset(GridSizeType sizeType) const;
45 
46     int32_t GetOrder(GridSizeType sizeType) const;
47 
48 private:
49     RefPtr<Component> component_;
50     GridSizeType sizeType_ = GridSizeType::XS;
51 };
52 } // namespace OHOS::Ace::V2
53 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_GRID_LAYOUT_RENDER_GRID_COL_H