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_PROGRESS_BUBBLE_PROGRESS_COMPONENT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_PROGRESS_BUBBLE_PROGRESS_COMPONENT_H
18 
19 #include "base/geometry/dimension.h"
20 #include "base/geometry/offset.h"
21 #include "core/components/common/properties/color.h"
22 #include "core/pipeline/base/render_component.h"
23 
24 namespace OHOS::Ace {
25 
26 class BubbleProgressComponent : public RenderComponent {
27     DECLARE_ACE_TYPE(BubbleProgressComponent, RenderComponent);
28 
29 public:
30     BubbleProgressComponent() = default;
BubbleProgressComponent(double diameter)31     explicit BubbleProgressComponent(double diameter) : diameter_(diameter) {}
32     ~BubbleProgressComponent() override = default;
33 
34     RefPtr<RenderNode> CreateRenderNode() override;
35     RefPtr<Element> CreateElement() override;
36 
GetDiameter()37     const Dimension& GetDiameter() const
38     {
39         return diameter_;
40     }
41 
SetDiameter(const Dimension & diameter)42     void SetDiameter(const Dimension& diameter)
43     {
44         diameter_ = diameter;
45     }
46 
SetBubbleRadius(const Dimension & radius)47     void SetBubbleRadius(const Dimension& radius)
48     {
49         bubbleRadius_ = radius;
50     }
51 
GetBubbleRadius()52     const Dimension& GetBubbleRadius() const
53     {
54         return bubbleRadius_;
55     }
56 
57 private:
58     Dimension diameter_;
59     Dimension bubbleRadius_;
60 };
61 
62 } // namespace OHOS::Ace
63 
64 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_PROGRESS_BUBBLE_PROGRESS_COMPONENT_H