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_COVERAGE_RENDER_COVERAGE_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_COVERAGE_RENDER_COVERAGE_H
18 
19 #include "core/components/coverage/coverage_component.h"
20 #include "core/pipeline/base/render_node.h"
21 
22 namespace OHOS::Ace {
23 
24 class RenderCoverage : public RenderNode {
25     DECLARE_ACE_TYPE(RenderCoverage, RenderNode);
26 
27 public:
28     RenderCoverage();
29     ~RenderCoverage() override = default;
30 
31     static RefPtr<RenderNode> Create();
32 
GetX()33     const Dimension& GetX() const
34     {
35         return x_;
36     }
37 
GetAlignment()38     const Alignment& GetAlignment() const
39     {
40         return align_;
41     }
42 
GetY()43     const Dimension& GetY() const
44     {
45         return y_;
46     }
47 
GetTextVal()48     const std::string GetTextVal() const
49     {
50         return title_;
51     }
52 
53     void Update(const RefPtr<Component>& component) override;
54     void PerformLayout() override;
55 private:
56     Dimension y_;
57     Alignment align_;
58     Dimension x_;
59     std::string title_;
60 };
61 
62 } // namespace OHOS::Ace
63 
64 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_COVERAGE_RENDER_COVERAGE_H
65