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_INNERKITS_ACCOUNT_IAM_NATIVE_INCLUDE_ACCOUNT_IAM_CALLBACK_STUB_H 17 #define OS_ACCOUNT_INTERFACES_INNERKITS_ACCOUNT_IAM_NATIVE_INCLUDE_ACCOUNT_IAM_CALLBACK_STUB_H 18 19 #include <map> 20 #include "iaccount_iam_callback.h" 21 #include "iremote_stub.h" 22 23 namespace OHOS { 24 namespace AccountSA { 25 class IDMCallbackStub : public IRemoteStub<IIDMCallback> { 26 public: 27 using MessageProcFunction = ErrCode (IDMCallbackStub::*)(MessageParcel &data, MessageParcel &reply); IDMCallbackStub()28 IDMCallbackStub() {}; 29 int OnRemoteRequest( 30 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 31 32 private: 33 ErrCode ProcOnAcquireInfo(MessageParcel &data, MessageParcel &reply); 34 ErrCode ProcOnResult(MessageParcel &data, MessageParcel &reply); 35 36 private: 37 static const std::map<uint32_t, MessageProcFunction> messageProcMap_; 38 DISALLOW_COPY_AND_MOVE(IDMCallbackStub); 39 }; 40 41 class GetCredInfoCallbackStub : public IRemoteStub<IGetCredInfoCallback> { 42 public: 43 using MessageProcFunction = ErrCode (GetCredInfoCallbackStub::*)(MessageParcel &data, MessageParcel &reply); GetCredInfoCallbackStub()44 GetCredInfoCallbackStub() {}; 45 int OnRemoteRequest( 46 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 47 48 private: 49 ErrCode ProcOnCredentialInfo(MessageParcel &data, MessageParcel &reply); 50 51 private: 52 static const std::map<uint32_t, MessageProcFunction> messageProcMap_; 53 DISALLOW_COPY_AND_MOVE(GetCredInfoCallbackStub); 54 }; 55 56 class GetSetPropCallbackStub : public IRemoteStub<IGetSetPropCallback> { 57 public: 58 using MessageProcFunction = ErrCode (GetSetPropCallbackStub::*)(MessageParcel &data, MessageParcel &reply); GetSetPropCallbackStub()59 GetSetPropCallbackStub() {}; 60 int OnRemoteRequest( 61 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 62 63 private: 64 ErrCode ProcOnResult(MessageParcel &data, MessageParcel &reply); 65 66 private: 67 static const std::map<uint32_t, MessageProcFunction> messageProcMap_; 68 DISALLOW_COPY_AND_MOVE(GetSetPropCallbackStub); 69 }; 70 } // namespace AccountSA 71 } // namespace OHOS 72 #endif // OS_ACCOUNT_INTERFACES_INNERKITS_ACCOUNT_IAM_NATIVE_INCLUDE_ACCOUNT_IAM_CALLBACK_STUB_H