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 USER_IDM_CALLBACK_STUB_H
17 #define USER_IDM_CALLBACK_STUB_H
18 
19 #include "iremote_stub.h"
20 #include "message_parcel.h"
21 #include "nocopyable.h"
22 
23 #include "user_idm_callback_interface.h"
24 
25 namespace OHOS {
26 namespace UserIam {
27 namespace UserAuth {
28 class IdmCallbackStub : public IRemoteStub<IdmCallbackInterface>, public NoCopyable {
29 public:
30     int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
31 
32 private:
33     int32_t OnResultStub(MessageParcel &data, MessageParcel &reply);
34     int32_t OnAcquireInfoStub(MessageParcel &data, MessageParcel &reply);
35 };
36 
37 class IdmGetCredInfoCallbackStub : public IRemoteStub<IdmGetCredInfoCallbackInterface>, public NoCopyable {
38 public:
39     int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
40 
41 private:
42     int32_t OnCredentialInfosStub(MessageParcel &data, MessageParcel &reply);
43     ResultCode ReadCredentialInfoList(MessageParcel &data, std::vector<CredentialInfo> &credInfoList);
44 };
45 
46 class IdmGetSecureUserInfoCallbackStub : public IRemoteStub<IdmGetSecureUserInfoCallbackInterface>, public NoCopyable {
47 public:
48     int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
49 
50 private:
51     int32_t OnSecureUserInfoStub(MessageParcel &data, MessageParcel &reply);
52     ResultCode ReadSecureUserInfo(MessageParcel &data, SecUserInfo &secUserInfo);
53 };
54 } // namespace UserAuth
55 } // namespace UserIam
56 } // namespace OHOS
57 #endif // USER_IDM_CALLBACK_STUB_H