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_AUTH_CALLBACK_PROXY_H 17 #define USER_AUTH_CALLBACK_PROXY_H 18 19 #include <iremote_proxy.h> 20 21 #include "user_auth_callback_interface.h" 22 23 namespace OHOS { 24 namespace UserIam { 25 namespace UserAuth { 26 class UserAuthCallbackProxy : public IRemoteProxy<UserAuthCallbackInterface>, public NoCopyable { 27 public: UserAuthCallbackProxy(const sptr<IRemoteObject> & object)28 explicit UserAuthCallbackProxy(const sptr<IRemoteObject> &object) : IRemoteProxy<UserAuthCallbackInterface>(object) 29 { 30 } 31 ~UserAuthCallbackProxy() override = default; 32 void OnResult(int32_t result, const Attributes &extraInfo) override; 33 void OnAcquireInfo(int32_t module, int32_t acquireInfo, const Attributes &extraInfo) override; 34 35 private: 36 static inline BrokerDelegator<UserAuthCallbackProxy> delegator_; 37 bool SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply); 38 }; 39 40 class GetExecutorPropertyCallbackProxy : public IRemoteProxy<GetExecutorPropertyCallbackInterface>, public NoCopyable { 41 public: GetExecutorPropertyCallbackProxy(const sptr<IRemoteObject> & object)42 explicit GetExecutorPropertyCallbackProxy(const sptr<IRemoteObject> &object) 43 : IRemoteProxy<GetExecutorPropertyCallbackInterface>(object) 44 { 45 } 46 ~GetExecutorPropertyCallbackProxy() override = default; 47 void OnGetExecutorPropertyResult(int32_t result, const Attributes &attributes) override; 48 49 private: 50 static inline BrokerDelegator<GetExecutorPropertyCallbackProxy> delegator_; 51 bool SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply); 52 }; 53 54 class SetExecutorPropertyCallbackProxy : public IRemoteProxy<SetExecutorPropertyCallbackInterface>, public NoCopyable { 55 public: SetExecutorPropertyCallbackProxy(const sptr<IRemoteObject> & object)56 explicit SetExecutorPropertyCallbackProxy(const sptr<IRemoteObject> &object) 57 : IRemoteProxy<SetExecutorPropertyCallbackInterface>(object) 58 { 59 } 60 ~SetExecutorPropertyCallbackProxy() override = default; 61 void OnSetExecutorPropertyResult(int32_t result) override; 62 63 private: 64 static inline BrokerDelegator<SetExecutorPropertyCallbackProxy> delegator_; 65 bool SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply); 66 }; 67 } // namespace UserAuth 68 } // namespace UserIam 69 } // namespace OHOS 70 #endif // USER_AUTH_CALLBACK_PROXY_H 71