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_SERVICES_ACCOUNTMGR_INCLUDE_ACCOUNT_IAM_CLIENT_CALLBACK_PROXY_H 17 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_ACCOUNT_IAM_CLIENT_CALLBACK_PROXY_H 18 19 #include "account_error_no.h" 20 #include "account_iam_info.h" 21 #include "iaccount_iam_callback.h" 22 #include "iremote_proxy.h" 23 24 namespace OHOS { 25 namespace AccountSA { 26 class IDMCallbackProxy : public IRemoteProxy<IIDMCallback> { 27 public: 28 explicit IDMCallbackProxy(const sptr<IRemoteObject> &object); 29 void OnAcquireInfo(int32_t module, uint32_t acquireInfo, const Attributes &extraInfo) override; 30 void OnResult(int32_t result, const Attributes &extraInfo) override; 31 32 private: 33 ErrCode SendRequest(IIDMCallback::Message code, MessageParcel &data, MessageParcel &reply); 34 35 private: 36 static inline BrokerDelegator<IDMCallbackProxy> delegator_; 37 }; 38 39 class GetCredInfoCallbackProxy : public IRemoteProxy<IGetCredInfoCallback> { 40 public: 41 explicit GetCredInfoCallbackProxy(const sptr<IRemoteObject> &object); 42 void OnCredentialInfo(const std::vector<CredentialInfo> &infoList) override; 43 44 private: 45 ErrCode SendRequest(IGetCredInfoCallback::Message code, MessageParcel &data, MessageParcel &reply); 46 47 private: 48 static inline BrokerDelegator<GetCredInfoCallbackProxy> delegator_; 49 }; 50 51 class GetSetPropCallbackProxy : public IRemoteProxy<IGetSetPropCallback> { 52 public: 53 explicit GetSetPropCallbackProxy(const sptr<IRemoteObject> &object); 54 void OnResult(int32_t result, const Attributes &extraInfo) override; 55 56 private: 57 ErrCode SendRequest(IGetSetPropCallback::Message code, MessageParcel &data, MessageParcel &reply); 58 59 private: 60 static inline BrokerDelegator<GetSetPropCallbackProxy> delegator_; 61 }; 62 } // namespace AccountSA 63 } // namespace OHOS 64 #endif // OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_ACCOUNT_IAM_CLIENT_CALLBACK_PROXY_H 65