1 /*
2 * Copyright (c) 2023 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 "core/interfaces/native/node/pattern_lock_modifier.h"
17 #include "core/components_v2/pattern_lock/pattern_lock_theme.h"
18 #include "core/components_ng/pattern/patternlock/patternlock_model_ng.h"
19 namespace OHOS::Ace::NG {
SetPatternLockActiveColor(ArkUINodeHandle node,uint32_t value)20 void SetPatternLockActiveColor(ArkUINodeHandle node, uint32_t value)
21 {
22 auto *frameNode = reinterpret_cast<FrameNode*>(node);
23 CHECK_NULL_VOID(frameNode);
24 PatternLockModelNG::SetActiveColor(frameNode, Color(value));
25 }
26
SetPatternLockActiveColorRes(ArkUINodeHandle node,uint32_t value,void * activeColorRawPtr)27 void SetPatternLockActiveColorRes(ArkUINodeHandle node, uint32_t value, void* activeColorRawPtr)
28 {
29 auto* frameNode = reinterpret_cast<FrameNode*>(node);
30 CHECK_NULL_VOID(frameNode);
31 PatternLockModelNG::SetActiveColor(frameNode, Color(value));
32 if (SystemProperties::ConfigChangePerform()) {
33 auto* activeColor = reinterpret_cast<ResourceObject*>(activeColorRawPtr);
34 auto activeColorResObj = AceType::Claim(activeColor);
35 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::ACTIVECOLOR, activeColorResObj);
36 }
37 }
38
ResetPatternLockActiveColor(ArkUINodeHandle node)39 void ResetPatternLockActiveColor(ArkUINodeHandle node)
40 {
41 auto *frameNode = reinterpret_cast<FrameNode*>(node);
42 CHECK_NULL_VOID(frameNode);
43 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
44 CHECK_NULL_VOID(patternLockTheme);
45 Color activeColor = patternLockTheme->GetActiveColor();
46 PatternLockModelNG::SetActiveColor(frameNode, activeColor);
47 if (SystemProperties::ConfigChangePerform()) {
48 PatternLockModelNG::SetActiveColorByUser(frameNode, false);
49 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::ACTIVECOLOR, nullptr);
50 }
51 }
52
ResetPatternLockCircleRadius(ArkUINodeHandle node)53 void ResetPatternLockCircleRadius(ArkUINodeHandle node)
54 {
55 auto *frameNode = reinterpret_cast<FrameNode*>(node);
56 CHECK_NULL_VOID(frameNode);
57 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
58 CHECK_NULL_VOID(patternLockTheme);
59 CalcDimension radius = patternLockTheme->GetCircleRadius();
60 PatternLockModelNG::SetCircleRadius(frameNode, Dimension(radius.Value(), radius.Unit()));
61 if (SystemProperties::ConfigChangePerform()) {
62 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::CIRCLERADIUS, nullptr);
63 }
64 }
65
SetPatternLockCircleRadius(ArkUINodeHandle node,ArkUI_Float32 number,ArkUI_Int32 unit)66 void SetPatternLockCircleRadius(ArkUINodeHandle node, ArkUI_Float32 number, ArkUI_Int32 unit)
67 {
68 auto *frameNode = reinterpret_cast<FrameNode*>(node);
69 CHECK_NULL_VOID(frameNode);
70 PatternLockModelNG::SetCircleRadius(frameNode, Dimension(number, static_cast<DimensionUnit>(unit)));
71 }
72
SetPatternLockCircleRadiusRes(ArkUINodeHandle node,ArkUI_Float32 number,ArkUI_Int32 unit,void * circleRadiusRawPtr)73 void SetPatternLockCircleRadiusRes(
74 ArkUINodeHandle node, ArkUI_Float32 number, ArkUI_Int32 unit, void* circleRadiusRawPtr)
75 {
76 auto* frameNode = reinterpret_cast<FrameNode*>(node);
77 CHECK_NULL_VOID(frameNode);
78 PatternLockModelNG::SetCircleRadius(frameNode, Dimension(number, static_cast<DimensionUnit>(unit)));
79 if (SystemProperties::ConfigChangePerform()) {
80 auto* circleRadius = reinterpret_cast<ResourceObject*>(circleRadiusRawPtr);
81 auto circleRadiusResObj = AceType::Claim(circleRadius);
82 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::CIRCLERADIUS, circleRadiusResObj);
83 }
84 }
85
SetPatternLockSelectedColor(ArkUINodeHandle node,uint32_t value)86 void SetPatternLockSelectedColor(ArkUINodeHandle node, uint32_t value)
87 {
88 auto *frameNode = reinterpret_cast<FrameNode*>(node);
89 CHECK_NULL_VOID(frameNode);
90 PatternLockModelNG::SetSelectedColor(frameNode, Color(value));
91 }
92
SetPatternLockSelectedColorRes(ArkUINodeHandle node,uint32_t value,void * selectedColorRawPtr)93 void SetPatternLockSelectedColorRes(ArkUINodeHandle node, uint32_t value, void* selectedColorRawPtr)
94 {
95 auto* frameNode = reinterpret_cast<FrameNode*>(node);
96 CHECK_NULL_VOID(frameNode);
97 PatternLockModelNG::SetSelectedColor(frameNode, Color(value));
98 if (SystemProperties::ConfigChangePerform()) {
99 auto* selectedColor = reinterpret_cast<ResourceObject*>(selectedColorRawPtr);
100 auto selectedColorResObj = AceType::Claim(selectedColor);
101 PatternLockModelNG::CreateWithResourceObj(
102 frameNode, PatternLockResourceType::SELECTEDCOLOR, selectedColorResObj);
103 }
104 }
105
ResetPatternLockSelectedColor(ArkUINodeHandle node)106 void ResetPatternLockSelectedColor(ArkUINodeHandle node)
107 {
108 auto *frameNode = reinterpret_cast<FrameNode*>(node);
109 CHECK_NULL_VOID(frameNode);
110 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
111 CHECK_NULL_VOID(patternLockTheme);
112 Color selectedColor = patternLockTheme->GetSelectedColor();
113 PatternLockModelNG::SetSelectedColor(frameNode, selectedColor);
114 if (SystemProperties::ConfigChangePerform()) {
115 PatternLockModelNG::SetSelectedColorByUser(frameNode, false);
116 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::SELECTEDCOLOR, nullptr);
117 }
118 }
119
SetPatternLockSideLength(ArkUINodeHandle node,ArkUI_Float32 number,ArkUI_Int32 unit)120 void SetPatternLockSideLength(ArkUINodeHandle node, ArkUI_Float32 number, ArkUI_Int32 unit)
121 {
122 auto *frameNode = reinterpret_cast<FrameNode*>(node);
123 CHECK_NULL_VOID(frameNode);
124 PatternLockModelNG::SetSideLength(frameNode, Dimension(number, static_cast<DimensionUnit>(unit)));
125 }
126
SetPatternLockSideLengthRes(ArkUINodeHandle node,ArkUI_Float32 number,ArkUI_Int32 unit,void * sideLengthRawPtr)127 void SetPatternLockSideLengthRes(ArkUINodeHandle node, ArkUI_Float32 number, ArkUI_Int32 unit, void* sideLengthRawPtr)
128 {
129 auto* frameNode = reinterpret_cast<FrameNode*>(node);
130 CHECK_NULL_VOID(frameNode);
131 PatternLockModelNG::SetSideLength(frameNode, Dimension(number, static_cast<DimensionUnit>(unit)));
132 if (SystemProperties::ConfigChangePerform()) {
133 auto* sideLength = reinterpret_cast<ResourceObject*>(sideLengthRawPtr);
134 auto sideLengthResObj = AceType::Claim(sideLength);
135 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::SIDELENGTH, sideLengthResObj);
136 }
137 }
138
ResetPatternLockSideLength(ArkUINodeHandle node)139 void ResetPatternLockSideLength(ArkUINodeHandle node)
140 {
141 auto *frameNode = reinterpret_cast<FrameNode*>(node);
142 CHECK_NULL_VOID(frameNode);
143 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
144 CHECK_NULL_VOID(patternLockTheme);
145 CalcDimension sideLength = patternLockTheme->GetSideLength();
146 PatternLockModelNG::SetSideLength(frameNode, Dimension(sideLength.Value(), sideLength.Unit()));
147 if (SystemProperties::ConfigChangePerform()) {
148 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::SIDELENGTH, nullptr);
149 }
150 }
151
SetPatternLockAutoReset(ArkUINodeHandle node,uint32_t value)152 void SetPatternLockAutoReset(ArkUINodeHandle node, uint32_t value)
153 {
154 auto *frameNode = reinterpret_cast<FrameNode*>(node);
155 CHECK_NULL_VOID(frameNode);
156 PatternLockModelNG::SetAutoReset(frameNode, static_cast<bool>(value));
157 }
158
ResetPatternLockAutoReset(ArkUINodeHandle node)159 void ResetPatternLockAutoReset(ArkUINodeHandle node)
160 {
161 auto *frameNode = reinterpret_cast<FrameNode*>(node);
162 CHECK_NULL_VOID(frameNode);
163 PatternLockModelNG::SetAutoReset(frameNode, true);
164 }
165
SetPatternLockPathStrokeWidth(ArkUINodeHandle node,ArkUI_Float32 number,ArkUI_Int32 unit)166 void SetPatternLockPathStrokeWidth(ArkUINodeHandle node, ArkUI_Float32 number, ArkUI_Int32 unit)
167 {
168 auto *frameNode = reinterpret_cast<FrameNode*>(node);
169 CHECK_NULL_VOID(frameNode);
170 PatternLockModelNG::SetStrokeWidth(frameNode, Dimension(number, static_cast<DimensionUnit>(unit)));
171 }
172
ResetPatternLockPathStrokeWidth(ArkUINodeHandle node)173 void ResetPatternLockPathStrokeWidth(ArkUINodeHandle node)
174 {
175 auto *frameNode = reinterpret_cast<FrameNode*>(node);
176 CHECK_NULL_VOID(frameNode);
177 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
178 CHECK_NULL_VOID(patternLockTheme);
179 CalcDimension lineWidth = patternLockTheme->GetPathStrokeWidth();
180 PatternLockModelNG::SetStrokeWidth(frameNode, lineWidth);
181 }
182
SetPatternLockRegularColor(ArkUINodeHandle node,uint32_t color)183 void SetPatternLockRegularColor(ArkUINodeHandle node, uint32_t color)
184 {
185 auto *frameNode = reinterpret_cast<FrameNode*>(node);
186 CHECK_NULL_VOID(frameNode);
187 PatternLockModelNG::SetRegularColor(frameNode, Color(color));
188 }
189
SetPatternLockRegularColorRes(ArkUINodeHandle node,uint32_t color,void * regularColorRawPtr)190 void SetPatternLockRegularColorRes(ArkUINodeHandle node, uint32_t color, void* regularColorRawPtr)
191 {
192 auto* frameNode = reinterpret_cast<FrameNode*>(node);
193 CHECK_NULL_VOID(frameNode);
194 PatternLockModelNG::SetRegularColor(frameNode, Color(color));
195 if (SystemProperties::ConfigChangePerform()) {
196 auto* regularColor = reinterpret_cast<ResourceObject*>(regularColorRawPtr);
197 auto regularColorResObj = AceType::Claim(regularColor);
198 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::REGULARCOLOR, regularColorResObj);
199 }
200 }
201
ResetPatternLockRegularColor(ArkUINodeHandle node)202 void ResetPatternLockRegularColor(ArkUINodeHandle node)
203 {
204 auto *frameNode = reinterpret_cast<FrameNode*>(node);
205 CHECK_NULL_VOID(frameNode);
206 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
207 CHECK_NULL_VOID(patternLockTheme);
208 Color regularColor = patternLockTheme->GetRegularColor();
209 PatternLockModelNG::SetRegularColor(frameNode, regularColor);
210 if (SystemProperties::ConfigChangePerform()) {
211 PatternLockModelNG::SetRegularColorByUser(frameNode, false);
212 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::REGULARCOLOR, nullptr);
213 }
214 }
215
SetPatternLockPathColor(ArkUINodeHandle node,uint32_t color)216 void SetPatternLockPathColor(ArkUINodeHandle node, uint32_t color)
217 {
218 auto *frameNode = reinterpret_cast<FrameNode*>(node);
219 CHECK_NULL_VOID(frameNode);
220 PatternLockModelNG::SetPathColor(frameNode, Color(color));
221 }
222
SetPatternLockPathColorRes(ArkUINodeHandle node,uint32_t color,void * pathColorRawPtr)223 void SetPatternLockPathColorRes(ArkUINodeHandle node, uint32_t color, void* pathColorRawPtr)
224 {
225 auto* frameNode = reinterpret_cast<FrameNode*>(node);
226 CHECK_NULL_VOID(frameNode);
227 PatternLockModelNG::SetPathColor(frameNode, Color(color));
228 if (SystemProperties::ConfigChangePerform()) {
229 auto* pathColor = reinterpret_cast<ResourceObject*>(pathColorRawPtr);
230 auto pathColorResObj = AceType::Claim(pathColor);
231 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::PATHCOLOR, pathColorResObj);
232 }
233 }
234
ResetPatternLockPathColor(ArkUINodeHandle node)235 void ResetPatternLockPathColor(ArkUINodeHandle node)
236 {
237 auto *frameNode = reinterpret_cast<FrameNode*>(node);
238 CHECK_NULL_VOID(frameNode);
239 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
240 CHECK_NULL_VOID(patternLockTheme);
241 Color pathColor = patternLockTheme->GetPathColor();
242 PatternLockModelNG::SetPathColor(frameNode, pathColor);
243 if (SystemProperties::ConfigChangePerform()) {
244 PatternLockModelNG::SetPathColorByUser(frameNode, false);
245 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::PATHCOLOR, nullptr);
246 }
247 }
248
SetPatternLockActiveCircleColor(ArkUINodeHandle node,uint32_t value)249 void SetPatternLockActiveCircleColor(ArkUINodeHandle node, uint32_t value)
250 {
251 auto *frameNode = reinterpret_cast<FrameNode*>(node);
252 CHECK_NULL_VOID(frameNode);
253 PatternLockModelNG::SetActiveCircleColor(frameNode, Color(value));
254 }
255
SetPatternLockActiveCircleColorRes(ArkUINodeHandle node,uint32_t value,void * activeCircleColorRawPtr)256 void SetPatternLockActiveCircleColorRes(ArkUINodeHandle node, uint32_t value, void* activeCircleColorRawPtr)
257 {
258 auto* frameNode = reinterpret_cast<FrameNode*>(node);
259 CHECK_NULL_VOID(frameNode);
260 PatternLockModelNG::SetActiveCircleColor(frameNode, Color(value));
261 if (SystemProperties::ConfigChangePerform()) {
262 auto* activeCircleColor = reinterpret_cast<ResourceObject*>(activeCircleColorRawPtr);
263 auto activeCircleColorResObj = AceType::Claim(activeCircleColor);
264 PatternLockModelNG::CreateWithResourceObj(
265 frameNode, PatternLockResourceType::ACTIVECIRCLECOLOR, activeCircleColorResObj);
266 }
267 }
268
ResetPatternLockActiveCircleColor(ArkUINodeHandle node)269 void ResetPatternLockActiveCircleColor(ArkUINodeHandle node)
270 {
271 auto *frameNode = reinterpret_cast<FrameNode*>(node);
272 CHECK_NULL_VOID(frameNode);
273 PatternLockModelNG::SetActiveCircleColor(frameNode, Color::TRANSPARENT);
274 if (SystemProperties::ConfigChangePerform()) {
275 PatternLockModelNG::SetActiveCircleColorByUser(frameNode, false);
276 PatternLockModelNG::CreateWithResourceObj(frameNode, PatternLockResourceType::ACTIVECIRCLECOLOR, nullptr);
277 }
278 }
279
SetPatternLockActiveCircleRadius(ArkUINodeHandle node,ArkUI_Float32 number,ArkUI_Int32 unit)280 void SetPatternLockActiveCircleRadius(ArkUINodeHandle node, ArkUI_Float32 number, ArkUI_Int32 unit)
281 {
282 auto *frameNode = reinterpret_cast<FrameNode*>(node);
283 CHECK_NULL_VOID(frameNode);
284 PatternLockModelNG::SetActiveCircleRadius(frameNode, Dimension(number, static_cast<DimensionUnit>(unit)));
285 }
286
ResetPatternLockActiveCircleRadius(ArkUINodeHandle node)287 void ResetPatternLockActiveCircleRadius(ArkUINodeHandle node)
288 {
289 auto *frameNode = reinterpret_cast<FrameNode*>(node);
290 CHECK_NULL_VOID(frameNode);
291 auto patternLockTheme = GetTheme<V2::PatternLockTheme>();
292 CHECK_NULL_VOID(patternLockTheme);
293 CalcDimension radius = patternLockTheme->GetCircleRadius();
294 PatternLockModelNG::SetActiveCircleRadius(frameNode, Dimension(0.0f, DimensionUnit::VP));
295 }
296
SetPatternLockEnableWaveEffect(ArkUINodeHandle node,uint32_t value)297 void SetPatternLockEnableWaveEffect(ArkUINodeHandle node, uint32_t value)
298 {
299 auto *frameNode = reinterpret_cast<FrameNode*>(node);
300 CHECK_NULL_VOID(frameNode);
301 PatternLockModelNG::SetEnableWaveEffect(frameNode, static_cast<bool>(value));
302 }
303
ResetPatternLockEnableWaveEffect(ArkUINodeHandle node)304 void ResetPatternLockEnableWaveEffect(ArkUINodeHandle node)
305 {
306 auto *frameNode = reinterpret_cast<FrameNode*>(node);
307 CHECK_NULL_VOID(frameNode);
308 PatternLockModelNG::SetEnableWaveEffect(frameNode, true);
309 }
310
SetPatternLockEnableForeground(ArkUINodeHandle node,uint32_t value)311 void SetPatternLockEnableForeground(ArkUINodeHandle node, uint32_t value)
312 {
313 auto *frameNode = reinterpret_cast<FrameNode*>(node);
314 CHECK_NULL_VOID(frameNode);
315 PatternLockModelNG::SetEnableForeground(frameNode, static_cast<bool>(value));
316 }
317
ResetPatternLockEnableForeground(ArkUINodeHandle node)318 void ResetPatternLockEnableForeground(ArkUINodeHandle node)
319 {
320 auto *frameNode = reinterpret_cast<FrameNode*>(node);
321 CHECK_NULL_VOID(frameNode);
322 PatternLockModelNG::SetEnableForeground(frameNode, false);
323 }
324
SetPatternLockSkipUnselectedPoint(ArkUINodeHandle node,uint32_t value)325 void SetPatternLockSkipUnselectedPoint(ArkUINodeHandle node, uint32_t value)
326 {
327 auto *frameNode = reinterpret_cast<FrameNode*>(node);
328 CHECK_NULL_VOID(frameNode);
329 PatternLockModelNG::SetSkipUnselectedPoint(frameNode, static_cast<bool>(value));
330 }
331
ResetPatternLockSkipUnselectedPoint(ArkUINodeHandle node)332 void ResetPatternLockSkipUnselectedPoint(ArkUINodeHandle node)
333 {
334 auto *frameNode = reinterpret_cast<FrameNode*>(node);
335 CHECK_NULL_VOID(frameNode);
336 PatternLockModelNG::SetSkipUnselectedPoint(frameNode, false);
337 }
338
SetPatternLockOnPatternComplete(ArkUINodeHandle node,void * callback)339 void SetPatternLockOnPatternComplete(ArkUINodeHandle node, void* callback)
340 {
341 auto* frameNode = reinterpret_cast<FrameNode*>(node);
342 CHECK_NULL_VOID(frameNode);
343 if (callback) {
344 auto onPatternComplete = reinterpret_cast<NG::PatternLockCompleteEvent*>(callback);
345 PatternLockModelNG::SetPatternComplete(frameNode, std::move(*onPatternComplete));
346 } else {
347 PatternLockModelNG::SetPatternComplete(frameNode, nullptr);
348 }
349 }
350
ResetPatternLockOnPatternComplete(ArkUINodeHandle node)351 void ResetPatternLockOnPatternComplete(ArkUINodeHandle node)
352 {
353 auto* frameNode = reinterpret_cast<FrameNode*>(node);
354 CHECK_NULL_VOID(frameNode);
355 PatternLockModelNG::SetPatternComplete(frameNode, nullptr);
356 }
357
SetPatternLockOnDotConnect(ArkUINodeHandle node,void * callback)358 void SetPatternLockOnDotConnect(ArkUINodeHandle node, void* callback)
359 {
360 auto* frameNode = reinterpret_cast<FrameNode*>(node);
361 CHECK_NULL_VOID(frameNode);
362 if (callback) {
363 auto onDotConnect = reinterpret_cast<std::function<void(int32_t)>*>(callback);
364 PatternLockModelNG::SetDotConnect(frameNode, std::move(*onDotConnect));
365 } else {
366 PatternLockModelNG::SetDotConnect(frameNode, nullptr);
367 }
368 }
369
ResetPatternLockOnDotConnect(ArkUINodeHandle node)370 void ResetPatternLockOnDotConnect(ArkUINodeHandle node)
371 {
372 auto* frameNode = reinterpret_cast<FrameNode*>(node);
373 CHECK_NULL_VOID(frameNode);
374 PatternLockModelNG::SetDotConnect(frameNode, nullptr);
375 }
376
377 namespace NodeModifier {
GetPatternLockModifier()378 const ArkUIPatternLockModifier* GetPatternLockModifier()
379 {
380 CHECK_INITIALIZED_FIELDS_BEGIN(); // don't move this line
381 static const ArkUIPatternLockModifier modifier = {
382 .setPatternLockActiveColor = SetPatternLockActiveColor,
383 .setPatternLockActiveColorRes = SetPatternLockActiveColorRes,
384 .resetPatternLockActiveColor = ResetPatternLockActiveColor,
385 .setPatternLockCircleRadius = SetPatternLockCircleRadius,
386 .setPatternLockCircleRadiusRes = SetPatternLockCircleRadiusRes,
387 .resetPatternLockCircleRadius = ResetPatternLockCircleRadius,
388 .setPatternLockSelectedColor = SetPatternLockSelectedColor,
389 .setPatternLockSelectedColorRes = SetPatternLockSelectedColorRes,
390 .resetPatternLockSelectedColor = ResetPatternLockSelectedColor,
391 .setPatternLockSideLength = SetPatternLockSideLength,
392 .setPatternLockSideLengthRes = SetPatternLockSideLengthRes,
393 .resetPatternLockSideLength = ResetPatternLockSideLength,
394 .setPatternLockAutoReset = SetPatternLockAutoReset,
395 .resetPatternLockAutoReset = ResetPatternLockAutoReset,
396 .setPatternLockPathStrokeWidth = SetPatternLockPathStrokeWidth,
397 .resetPatternLockPathStrokeWidth = ResetPatternLockPathStrokeWidth,
398 .setPatternLockRegularColor = SetPatternLockRegularColor,
399 .setPatternLockRegularColorRes = SetPatternLockRegularColorRes,
400 .resetPatternLockRegularColor = ResetPatternLockRegularColor,
401 .setPatternLockPathColor = SetPatternLockPathColor,
402 .setPatternLockPathColorRes = SetPatternLockPathColorRes,
403 .resetPatternLockPathColor = ResetPatternLockPathColor,
404 .setPatternLockActiveCircleColor = SetPatternLockActiveCircleColor,
405 .setPatternLockActiveCircleColorRes = SetPatternLockActiveCircleColorRes,
406 .resetPatternLockActiveCircleColor = ResetPatternLockActiveCircleColor,
407 .setPatternLockActiveCircleRadius = SetPatternLockActiveCircleRadius,
408 .resetPatternLockActiveCircleRadius = ResetPatternLockActiveCircleRadius,
409 .setPatternLockEnableWaveEffect = SetPatternLockEnableWaveEffect,
410 .resetPatternLockEnableWaveEffect = ResetPatternLockEnableWaveEffect,
411 .setPatternLockEnableForeground = SetPatternLockEnableForeground,
412 .resetPatternLockEnableForeground = ResetPatternLockEnableForeground,
413 .setPatternLockSkipUnselectedPoint = SetPatternLockSkipUnselectedPoint,
414 .resetPatternLockSkipUnselectedPoint = ResetPatternLockSkipUnselectedPoint,
415 .setPatternLockOnPatternComplete = SetPatternLockOnPatternComplete,
416 .resetPatternLockOnPatternComplete = ResetPatternLockOnPatternComplete,
417 .setPatternLockOnDotConnect = SetPatternLockOnDotConnect,
418 .resetPatternLockOnDotConnect = ResetPatternLockOnDotConnect,
419 };
420 CHECK_INITIALIZED_FIELDS_END(modifier, 0, 0, 0); // don't move this line
421 return &modifier;
422 }
423
GetCJUIPatternLockModifier()424 const CJUIPatternLockModifier* GetCJUIPatternLockModifier()
425 {
426 CHECK_INITIALIZED_FIELDS_BEGIN(); // don't move this line
427 static const CJUIPatternLockModifier modifier = {
428 .setPatternLockActiveColor = SetPatternLockActiveColor,
429 .setPatternLockActiveColorRes = SetPatternLockActiveColorRes,
430 .resetPatternLockActiveColor = ResetPatternLockActiveColor,
431 .setPatternLockCircleRadius = SetPatternLockCircleRadius,
432 .setPatternLockCircleRadiusRes = SetPatternLockCircleRadiusRes,
433 .resetPatternLockCircleRadius = ResetPatternLockCircleRadius,
434 .setPatternLockSelectedColor = SetPatternLockSelectedColor,
435 .setPatternLockSelectedColorRes = SetPatternLockSelectedColorRes,
436 .resetPatternLockSelectedColor = ResetPatternLockSelectedColor,
437 .setPatternLockSideLength = SetPatternLockSideLength,
438 .setPatternLockSideLengthRes = SetPatternLockSideLengthRes,
439 .resetPatternLockSideLength = ResetPatternLockSideLength,
440 .setPatternLockAutoReset = SetPatternLockAutoReset,
441 .resetPatternLockAutoReset = ResetPatternLockAutoReset,
442 .setPatternLockPathStrokeWidth = SetPatternLockPathStrokeWidth,
443 .resetPatternLockPathStrokeWidth = ResetPatternLockPathStrokeWidth,
444 .setPatternLockRegularColor = SetPatternLockRegularColor,
445 .setPatternLockRegularColorRes = SetPatternLockRegularColorRes,
446 .resetPatternLockRegularColor = ResetPatternLockRegularColor,
447 .setPatternLockPathColor = SetPatternLockPathColor,
448 .setPatternLockPathColorRes = SetPatternLockPathColorRes,
449 .resetPatternLockPathColor = ResetPatternLockPathColor,
450 .setPatternLockActiveCircleColor = SetPatternLockActiveCircleColor,
451 .setPatternLockActiveCircleColorRes = SetPatternLockActiveCircleColorRes,
452 .resetPatternLockActiveCircleColor = ResetPatternLockActiveCircleColor,
453 .setPatternLockActiveCircleRadius = SetPatternLockActiveCircleRadius,
454 .resetPatternLockActiveCircleRadius = ResetPatternLockActiveCircleRadius,
455 .setPatternLockEnableWaveEffect = SetPatternLockEnableWaveEffect,
456 .resetPatternLockEnableWaveEffect = ResetPatternLockEnableWaveEffect,
457 .setPatternLockEnableForeground = SetPatternLockEnableForeground,
458 .resetPatternLockEnableForeground = ResetPatternLockEnableForeground,
459 .setPatternLockSkipUnselectedPoint = SetPatternLockSkipUnselectedPoint,
460 .resetPatternLockSkipUnselectedPoint = ResetPatternLockSkipUnselectedPoint,
461 };
462 CHECK_INITIALIZED_FIELDS_END(modifier, 0, 0, 0); // don't move this line
463 return &modifier;
464 }
465 }
466 } // namespace OHOS::Ace::NG
467