1bc2ed2b3Sopenharmony_ci/* 2bc2ed2b3Sopenharmony_ci * Copyright (C) 2023 Huawei Device Co., Ltd. 3bc2ed2b3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4bc2ed2b3Sopenharmony_ci * you may not use this file except in compliance with the License. 5bc2ed2b3Sopenharmony_ci * You may obtain a copy of the License at 6bc2ed2b3Sopenharmony_ci * 7bc2ed2b3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8bc2ed2b3Sopenharmony_ci * 9bc2ed2b3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10bc2ed2b3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11bc2ed2b3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12bc2ed2b3Sopenharmony_ci * See the License for the specific language governing permissions and 13bc2ed2b3Sopenharmony_ci * limitations under the License. 14bc2ed2b3Sopenharmony_ci */ 15bc2ed2b3Sopenharmony_ci 16bc2ed2b3Sopenharmony_ci#ifndef I_NCI_NATIVE_INTERFACE_H 17bc2ed2b3Sopenharmony_ci#define I_NCI_NATIVE_INTERFACE_H 18bc2ed2b3Sopenharmony_ci 19bc2ed2b3Sopenharmony_ci#include <memory> 20bc2ed2b3Sopenharmony_ci#include "inci_ce_interface.h" 21bc2ed2b3Sopenharmony_ci#include "inci_nfcc_interface.h" 22bc2ed2b3Sopenharmony_ci#include "inci_tag_interface.h" 23bc2ed2b3Sopenharmony_ci 24bc2ed2b3Sopenharmony_cinamespace OHOS { 25bc2ed2b3Sopenharmony_cinamespace NFC { 26bc2ed2b3Sopenharmony_cinamespace NCI { 27bc2ed2b3Sopenharmony_ciclass INciNativeInterface { 28bc2ed2b3Sopenharmony_cipublic: 29bc2ed2b3Sopenharmony_ci virtual ~INciNativeInterface() = default; 30bc2ed2b3Sopenharmony_ci 31bc2ed2b3Sopenharmony_ci /** 32bc2ed2b3Sopenharmony_ci * @brief Get the ptr of INciCeInterface 33bc2ed2b3Sopenharmony_ci * @return thr ptr of INciCeInterface 34bc2ed2b3Sopenharmony_ci */ 35bc2ed2b3Sopenharmony_ci virtual std::shared_ptr<INciCeInterface> GetNciCeInterface() = 0; 36bc2ed2b3Sopenharmony_ci 37bc2ed2b3Sopenharmony_ci /** 38bc2ed2b3Sopenharmony_ci * @brief Get the ptr of INciNfccInterface 39bc2ed2b3Sopenharmony_ci * @return thr ptr of INciNfccInterface 40bc2ed2b3Sopenharmony_ci */ 41bc2ed2b3Sopenharmony_ci virtual std::shared_ptr<INciNfccInterface> GetNciNfccInterface() = 0; 42bc2ed2b3Sopenharmony_ci 43bc2ed2b3Sopenharmony_ci /** 44bc2ed2b3Sopenharmony_ci * @brief Get the ptr of INciTagInterface 45bc2ed2b3Sopenharmony_ci * @return thr ptr of INciTagInterface 46bc2ed2b3Sopenharmony_ci */ 47bc2ed2b3Sopenharmony_ci virtual std::shared_ptr<INciTagInterface> GetNciTagInterface() = 0; 48bc2ed2b3Sopenharmony_ci}; 49bc2ed2b3Sopenharmony_ci 50bc2ed2b3Sopenharmony_ci#define DECLARE_NATIVE_INTERFACE(interfaceClass) \ 51bc2ed2b3Sopenharmony_ci extern "C" INciNativeInterface *NewInterface(void) \ 52bc2ed2b3Sopenharmony_ci { \ 53bc2ed2b3Sopenharmony_ci return static_cast<INciNativeInterface *>(new interfaceClass()); \ 54bc2ed2b3Sopenharmony_ci } \ 55bc2ed2b3Sopenharmony_ci extern "C" void DeleteInterface(INciNativeInterface *p) \ 56bc2ed2b3Sopenharmony_ci { \ 57bc2ed2b3Sopenharmony_ci delete p; \ 58bc2ed2b3Sopenharmony_ci } 59bc2ed2b3Sopenharmony_ci} // namespace NCI 60bc2ed2b3Sopenharmony_ci} // namespace NFC 61bc2ed2b3Sopenharmony_ci} // namespace OHOS 62bc2ed2b3Sopenharmony_ci 63bc2ed2b3Sopenharmony_ci#endif