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 #ifndef NFC_CONTROLLER_PROXY_H 16 #define NFC_CONTROLLER_PROXY_H 17 18 19 #include "nfc_basic_proxy.h" 20 #include "nfc_sdk_common.h" 21 #include "indef_msg_callback.h" 22 #include "infc_controller_callback.h" 23 #include "infc_controller_service.h" 24 #include "iremote_proxy.h" 25 #include "iremote_object.h" 26 27 namespace OHOS { 28 namespace NFC { 29 class NfcControllerProxy final : public OHOS::IRemoteProxy<INfcControllerService>, public NfcBasicProxy { 30 public: NfcControllerProxy(const OHOS::sptr<OHOS::IRemoteObject> & remote)31 explicit NfcControllerProxy(const OHOS::sptr<OHOS::IRemoteObject>& remote) 32 : OHOS::IRemoteProxy<INfcControllerService>(remote), NfcBasicProxy(remote) 33 { 34 } 35 ~NfcControllerProxy() override; 36 37 int TurnOn() override; 38 int TurnOff() override; 39 int GetState() override; 40 int IsNfcOpen(bool &isOpen) override; 41 KITS::ErrorCode RegisterCallBack(const sptr<INfcControllerCallback> &callback, 42 const std::string& type) override; 43 KITS::ErrorCode UnRegisterCallBack(const std::string& type) override; 44 OHOS::sptr<IRemoteObject> GetTagServiceIface() override; 45 OHOS::sptr<IRemoteObject> GetHceServiceIface() override; 46 KITS::ErrorCode RegNdefMsgCb(const sptr<INdefMsgCallback> &callback) override; 47 #ifdef VENDOR_APPLICATIONS_ENABLED 48 KITS::ErrorCode RegQueryApplicationCb(sptr<IQueryAppInfoCallback> callback) override; 49 KITS::ErrorCode RegCardEmulationNotifyCb(sptr<IOnCardEmulationNotifyCb> callback) override; 50 KITS::ErrorCode NotifyEventStatus(int eventType, int arg1, std::string arg2) override; 51 #endif 52 53 private: 54 }; 55 } // namespace NFC 56 } // namespace OHOS 57 #endif // NFC_CONTROLLER_PROXY_H 58