1 /*
2  * Copyright (c) 2024 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 #ifndef OHOS_ACE_FRAMEWORK_CJ_PATTERN_LOCK_H
16 #define OHOS_ACE_FRAMEWORK_CJ_PATTERN_LOCK_H
17 
18 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_collection_ffi.h"
19 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_common_ffi.h"
20 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
21 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_view_abstract_ffi.h"
22 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
23 #include "core/components_v2/pattern_lock/pattern_lock_component.h"
24 #include "core/components_v2/pattern_lock/pattern_lock_theme.h"
25 #include "ffi_remote_data.h"
26 
27 namespace OHOS::Ace::Framework {
28 class ACE_EXPORT NativePatternLockController : public OHOS::FFI::FFIData {
29     DECL_TYPE(NativePatternLockController, OHOS::FFI::FFIData)
30 public:
31     NativePatternLockController();
32 
33     void Reset();
SetController(const RefPtr<V2::PatternLockController> & controller)34     void SetController(const RefPtr<V2::PatternLockController>& controller)
35     {
36         controller_ = controller;
37     }
38 
39 private:
40     RefPtr<V2::PatternLockController> controller_;
41 };
42 } // namespace OHOS::Ace::Framework
43 
44 extern "C" {
45 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockCreate(int64_t controller);
46 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockOnPatternComplete(void (*callback)(VectorInt32Handle array));
47 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockSelectedColor(uint32_t color);
48 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockAutoReset(bool value);
49 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockPathColor(uint32_t color);
50 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockActiveColor(uint32_t color);
51 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockRegularColor(uint32_t color);
52 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockCircleRadius(double value, int32_t unit);
53 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockSideLength(double value, int32_t unit);
54 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockStrokeWidth(double value, int32_t unit);
55 CJ_EXPORT int64_t FfiOHOSAceFrameworkPatternLockControllerCreate();
56 CJ_EXPORT void FfiOHOSAceFrameworkPatternLockControllerReset(int64_t selfID);
57 };
58 
59 #endif // OHOS_ACE_FRAMEWORK_CJ_PATTERN_LOCK_H
60