• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "core/components_v2/pattern_lock/pattern_lock_component.h"
16 
17 #include "core/components_v2/pattern_lock/pattern_lock_element.h"
18 namespace OHOS::Ace::V2 {
PatternLockComponent()19 PatternLockComponent::PatternLockComponent()
20 {
21     patternLockController_ = AceType::MakeRefPtr<V2::PatternLockController>();
22 }
CreateRenderNode()23 RefPtr<RenderNode> PatternLockComponent::CreateRenderNode()
24 {
25     return RenderPatternLock::Create();
26 }
27 
CreateElement()28 RefPtr<Element> PatternLockComponent::CreateElement()
29 {
30     return AceType::MakeRefPtr<PatternLockElement>();
31 }
SetRegularColor(const Color & regularColor)32 void PatternLockComponent::SetRegularColor(const Color& regularColor)
33 {
34     regularColor_ = regularColor;
35 }
SetSelectedColor(const Color & selectedColor)36 void PatternLockComponent::SetSelectedColor(const Color& selectedColor)
37 {
38     selectedColor_ = selectedColor;
39 }
SetActiveColor(const Color & activeColor)40 void PatternLockComponent::SetActiveColor(const Color& activeColor)
41 {
42     activeColor_ = activeColor;
43 }
SetPathColor(const Color & pathColor)44 void PatternLockComponent::SetPathColor(const Color& pathColor)
45 {
46     pathColor_ = pathColor;
47 }
GetCircleRadius() const48 const Dimension& PatternLockComponent::GetCircleRadius() const
49 {
50     return circleRadius_;
51 }
GetSideLength() const52 const Dimension& PatternLockComponent::GetSideLength() const
53 {
54     return sideLength_;
55 }
SetCircleRadius(const Dimension & circleRadius)56 void PatternLockComponent::SetCircleRadius(const Dimension& circleRadius)
57 {
58     circleRadius_ = circleRadius;
59 }
SetSideLength(const Dimension & sideLength)60 void PatternLockComponent::SetSideLength(const Dimension& sideLength)
61 {
62     sideLength_ = sideLength;
63 }
GetRegularColor() const64 const Color& PatternLockComponent::GetRegularColor() const
65 {
66     return regularColor_;
67 }
GetActiveColor() const68 const Color& PatternLockComponent::GetActiveColor() const
69 {
70     return activeColor_;
71 }
GetPathColor() const72 const Color& PatternLockComponent::GetPathColor() const
73 {
74     return pathColor_;
75 }
GetSelectedColor() const76 const Color& PatternLockComponent::GetSelectedColor() const
77 {
78     return selectedColor_;
79 }
SetStrokeWidth(const Dimension & lineWidth)80 void PatternLockComponent::SetStrokeWidth(const Dimension& lineWidth)
81 {
82     strokeWidth_ = lineWidth;
83 }
GetStrokeWidth() const84 const Dimension& PatternLockComponent::GetStrokeWidth() const
85 {
86     return strokeWidth_;
87 }
SetAutoReset(bool isAutoReset)88 void PatternLockComponent::SetAutoReset(bool isAutoReset)
89 {
90     autoReset_ = isAutoReset;
91 }
GetAutoReset() const92 bool PatternLockComponent::GetAutoReset() const
93 {
94     return autoReset_;
95 }
GetPatternLockController() const96 RefPtr<V2::PatternLockController> PatternLockComponent::GetPatternLockController() const
97 {
98     return patternLockController_;
99 }
100 } // namespace OHOS::Ace::V2