• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 OS_ACCOUNT_INTERFACES_KITS_NAPI_IAM_INCLUDE_NAPI_IAM_CONSTANT_H
17 #define OS_ACCOUNT_INTERFACES_KITS_NAPI_IAM_INCLUDE_NAPI_IAM_CONSTANT_H
18 
19 #include "napi/native_api.h"
20 #include "napi/native_node_api.h"
21 
22 namespace OHOS {
23 namespace AccountJsKit {
24 
25 enum AuthSubType {
26     FACE_2D = 20000,
27     FACE_3D = 20001,
28 };
29 
30 enum AuthMethod {
31     PIN_ONLY = 0xF,
32     FACE_ONLY = 0xF0
33 };
34 
35 enum Module {
36     FACE_AUTH = 1
37 };
38 
39 enum FaceTipsCode {
40     FACE_AUTH_TIP_TOO_BRIGHT = 1,
41     FACE_AUTH_TIP_TOO_DARK = 2,
42     FACE_AUTH_TIP_TOO_CLOSE = 3,
43     FACE_AUTH_TIP_TOO_FAR = 4,
44     FACE_AUTH_TIP_TOO_HIGH = 5,
45     FACE_AUTH_TIP_TOO_LOW = 6,
46     FACE_AUTH_TIP_TOO_RIGHT = 7,
47     FACE_AUTH_TIP_TOO_LEFT = 8,
48     FACE_AUTH_TIP_TOO_MUCH_MOTION = 9,
49     FACE_AUTH_TIP_POOR_GAZE = 10,
50     FACE_AUTH_TIP_NOT_DETECTED = 11,
51 };
52 
53 enum FingerprintTips {
54     FINGERPRINT_AUTH_TIP_GOOD = 0,
55     FINGERPRINT_AUTH_TIP_IMAGER_DIRTY = 1,
56     FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2,
57     FINGERPRINT_AUTH_TIP_PARTIAL = 3,
58     FINGERPRINT_AUTH_TIP_TOO_FAST = 4,
59     FINGERPRINT_AUTH_TIP_TOO_SLOW = 5
60 };
61 
62 enum GetPropertyType : uint32_t {
63     AUTH_SUB_TYPE = 1,
64     REMAIN_TIMES = 2,
65     FREEZING_TIME = 3,
66 };
67 
68 enum SetPropertyType : uint32_t {
69     INIT_ALGORITHM = 1,
70     FREEZE_TEMPLATE = 2,
71     THAW_TEMPLATE = 3,
72 };
73 
74 enum class AuthenticationResult {
75     NO_SUPPORT = -1,
76     SUCCESS = 0,
77     COMPARE_FAILURE = 1,
78     CANCELED = 2,
79     TIMEOUT = 3,
80     CAMERA_FAIL = 4,
81     BUSY = 5,
82     INVALID_PARAMETERS = 6,
83     LOCKED = 7,
84     NOT_ENROLLED = 8,
85     GENERAL_ERROR = 100,
86 };
87 
88 class NapiAccountIAMConstant {
89 public:
90     static napi_value Init(napi_env env, napi_value exports);
91 };
92 }  // namespace AccountJsKit
93 }  // namespace OHOS
94 #endif  // OS_ACCOUNT_INTERFACES_KITS_NAPI_IAM_INCLUDE_NAPI_IAM_CONSTANT_H