• 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 /**
17  * @file user_idm_client_callback.h
18  *
19  * @brief Callback definitions returned by idm client.
20  * @since 3.1
21  * @version 3.2
22  */
23 
24 #ifndef USER_IDM_CLIENT_CALLBACK_H
25 #define USER_IDM_CLIENT_CALLBACK_H
26 
27 #include "attributes.h"
28 #include "iam_common_defines.h"
29 #include "user_idm_client_defines.h"
30 
31 namespace OHOS {
32 namespace UserIam {
33 namespace UserAuth {
34 class GetCredentialInfoCallback {
35 public:
36     /**
37      * @brief The callback return get credential info result.
38      *
39      * @param infoList The credential info list.
40      */
41     virtual void OnCredentialInfo(const std::vector<CredentialInfo> &infoList) = 0;
42 };
43 
44 class GetSecUserInfoCallback {
45 public:
46     /**
47      * @brief The callback return get security user info result.
48      *
49      * @param info The security user info.
50      */
51     virtual void OnSecUserInfo(const SecUserInfo &info) = 0;
52 };
53 
54 class UserIdmClientCallback {
55 public:
56     /**
57      * @brief The callback return authenticate acquire information.
58      *
59      * @param module Module of current acquire info.
60      * @param acquireInfo Acquire info needed to be pass in.
61      * @param extraInfo Other related information about authentication.
62      */
63     virtual void OnAcquireInfo(int32_t module, uint32_t acquireInfo, const Attributes &extraInfo) = 0;
64 
65     /**
66      * @brief The callback return set property result.
67      *
68      * @param result The result success or error code{@link ResultCode}.
69      * @param extraInfo Other related information about set property.
70      */
71     virtual void OnResult(int32_t result, const Attributes &extraInfo) = 0;
72 };
73 } // namespace UserAuth
74 } // namespace UserIam
75 } // namespace OHOS
76 
77 #endif // USER_IDM_CLIENT_CALLBACK_H