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_DOMAIN_ACCOUNT_NATIVE_INCLUDE_DOMAIN_ACCOUNT_PROXY_H 17 #define OS_ACCOUNT_INTERFACES_INNERKITS_DOMAIN_ACCOUNT_NATIVE_INCLUDE_DOMAIN_ACCOUNT_PROXY_H 18 19 #include <string> 20 #include "account_error_no.h" 21 #include "idomain_account.h" 22 #include "iremote_proxy.h" 23 24 namespace OHOS { 25 namespace AccountSA { 26 class DomainAccountProxy : public IRemoteProxy<IDomainAccount> { 27 public: 28 explicit DomainAccountProxy(const sptr<IRemoteObject> &object); 29 ~DomainAccountProxy() override; 30 ErrCode RegisterPlugin(const sptr<IDomainAccountPlugin> &plugin) override; 31 ErrCode UnregisterPlugin() override; 32 ErrCode Auth(const DomainAccountInfo &info, const std::vector<uint8_t> &password, 33 const sptr<IDomainAuthCallback> &callback) override; 34 ErrCode AuthUser(int32_t userId, const std::vector<uint8_t> &password, 35 const sptr<IDomainAuthCallback> &callback) override; 36 37 private: 38 ErrCode SendRequest(IDomainAccount::Message code, MessageParcel &data, MessageParcel &reply); 39 40 private: 41 static inline BrokerDelegator<DomainAccountProxy> delegator_; 42 }; 43 } // namespace AccountSA 44 } // namespace OHOS 45 #endif // OS_ACCOUNT_INTERFACES_INNERKITS_DOMAIN_ACCOUNT_NATIVE_INCLUDE_DOMAIN_ACCOUNT_PROXY_H