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_ANIMATION_ANIMATABLE_PROPERTIES_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_ANIMATION_ANIMATABLE_PROPERTIES_H
18 
19 #include "base/geometry/dimension.h"
20 #include "base/memory/ace_type.h"
21 #include "core/animation/property_animatable_helper.h"
22 #include "core/animation/property_animation.h"
23 #include "core/components/common/properties/color.h"
24 #include "core/components/common/properties/decoration.h"
25 #include "core/components/common/properties/shadow.h"
26 
27 namespace OHOS::Ace {
28 
29 class AnimatableProperties : public virtual AceType {
30     DECLARE_ACE_TYPE(AnimatableProperties, AceType);
31 
32 public:
33     void UpdatePropAnimation(const PropAnimationMap& propAnimations);
34 
35 private:
36     void SetPropWidth(const Dimension& width);
37     Dimension GetPropWidth() const;
38     void SetPropHeight(const Dimension& height);
39     Dimension GetPropHeight() const;
40     void SetPropBgColor(const Color& color);
41     Color GetPropBgColor() const;
42     void SetPropOpacity(float opacity);
43     float GetPropOpacity() const;
44     void SetPropShadow(const Shadow& shadow);
45     Shadow GetPropShadow() const;
46     void SetPropBackgroundPosition(const BackgroundImagePosition& position);
47     BackgroundImagePosition GetPropBackgroundImagePosition() const;
48     void SetPropBackgroundSize(const BackgroundImageSize& size);
49     BackgroundImageSize GetPropBackgroundImageSize() const;
50     void SetPadding(const AnimatableDimension& value, const DimensionHelper& helper);
51     AnimatableDimension GetPadding(const DimensionHelper& helper);
52     void SetMargin(const AnimatableDimension& value, const DimensionHelper& helper);
53     AnimatableDimension GetMargin(const DimensionHelper& helper) const;
54     void SetBorderWidth(float value, const BorderEdgeHelper& helper);
55     float GetBorderWidth(const BorderEdgeHelper& helper) const;
56     void SetBorderColor(const Color& color, const BorderEdgeHelper& helper);
57     Color GetBorderColor(const BorderEdgeHelper& helper) const;
58     void SetBorderStyle(BorderStyle style, const BorderEdgeHelper& helper);
59     BorderStyle GetBorderStyle(const BorderEdgeHelper& helper) const;
60     void SetBorderRadius(float value, const BorderRadiusHelper& helper);
61     float GetBorderRadius(const BorderRadiusHelper& helper) const;
62     void SetBlurRadius(const AnimatableDimension& radius);
63     AnimatableDimension GetBlurRadius() const;
64     void SetBackdropRadius(const AnimatableDimension& radius);
65     AnimatableDimension GetBackdropRadius() const;
66     void SetWindowBlurProgress(double progress);
67     double GetWindowBlurProgress() const;
68     void SetPositionLeft(const Dimension& left);
69     Dimension GetPositionLeft() const;
70     void SetPositionTop(const Dimension& top);
71     Dimension GetPositionTop() const;
72     void SetPositionRight(const Dimension& right);
73     Dimension GetPositionRight() const;
74     void SetPositionBottom(const Dimension& bottom);
75     Dimension GetPositionBottom() const;
76 };
77 
78 } // namespace OHOS::Ace
79 
80 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_ANIMATION_ANIMATABLE_PROPERTIES_H
81