1 /*
2 * Copyright (c) 2025 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 #include "modifier_ng/appearance/rs_border_modifier.h"
17
18 namespace OHOS::Rosen::ModifierNG {
SetBorderColor(const Vector4<Color> & color)19 void RSBorderModifier::SetBorderColor(const Vector4<Color>& color)
20 {
21 Setter(RSPropertyType::BORDER_COLOR, color);
22 }
23
GetBorderColor() const24 Vector4<Color> RSBorderModifier::GetBorderColor() const
25 {
26 return Getter<Vector4<Color>>(RSPropertyType::BORDER_COLOR, {});
27 }
28
SetBorderWidth(const Vector4f & width)29 void RSBorderModifier::SetBorderWidth(const Vector4f& width)
30 {
31 Setter(RSPropertyType::BORDER_WIDTH, width);
32 }
33
GetBorderWidth() const34 Vector4f RSBorderModifier::GetBorderWidth() const
35 {
36 return Getter<Vector4f>(RSPropertyType::BORDER_WIDTH, {});
37 }
38
SetBorderStyle(const Vector4<uint32_t> & style)39 void RSBorderModifier::SetBorderStyle(const Vector4<uint32_t>& style)
40 {
41 Setter<RSProperty>(RSPropertyType::BORDER_STYLE, style);
42 }
43
GetBorderStyle() const44 Vector4<uint32_t> RSBorderModifier::GetBorderStyle() const
45 {
46 return Getter<Vector4<uint32_t>>(RSPropertyType::BORDER_STYLE, {});
47 }
48
SetBorderDashWidth(const Vector4f & dashWidth)49 void RSBorderModifier::SetBorderDashWidth(const Vector4f& dashWidth)
50 {
51 Setter<RSProperty>(RSPropertyType::BORDER_DASH_WIDTH, dashWidth);
52 }
53
GetBorderDashWidth() const54 Vector4f RSBorderModifier::GetBorderDashWidth() const
55 {
56 return Getter<Vector4f>(RSPropertyType::BORDER_DASH_WIDTH, {});
57 }
58
SetBorderDashGap(const Vector4f & dashGap)59 void RSBorderModifier::SetBorderDashGap(const Vector4f& dashGap)
60 {
61 Setter<RSProperty>(RSPropertyType::BORDER_DASH_GAP, dashGap);
62 }
63
GetBorderDashGap() const64 Vector4f RSBorderModifier::GetBorderDashGap() const
65 {
66 return Getter<Vector4f>(RSPropertyType::BORDER_DASH_GAP, {});
67 }
68 } // namespace OHOS::Rosen::ModifierNG
69