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 ARK_MMI_DEVICE_INFO_ADAPTER_WRAPPER_H 17 #define ARK_MMI_DEVICE_INFO_ADAPTER_WRAPPER_H 18 #pragma once 19 20 #include "mmi_adapter.h" 21 #include "ohos_adapter/include/ark_mmi_adapter.h" 22 23 namespace OHOS::ArkWeb { 24 25 class ArkMMIDeviceInfoAdapterWrapper : public NWeb::MMIDeviceInfoAdapter { 26 public: 27 explicit ArkMMIDeviceInfoAdapterWrapper(ArkWebRefPtr<ArkMMIDeviceInfoAdapter>); 28 29 int32_t GetId() override; 30 31 int32_t GetType() override; 32 33 int32_t GetBus() override; 34 35 int32_t GetVersion() override; 36 37 int32_t GetProduct() override; 38 39 int32_t GetVendor() override; 40 41 std::string GetName() override; 42 43 std::string GetPhys() override; 44 45 std::string GetUniq() override; 46 47 void SetId(int32_t id) override; 48 49 void SetType(int32_t type) override; 50 51 void SetBus(int32_t bus) override; 52 53 void SetVersion(int32_t version) override; 54 55 void SetProduct(int32_t product) override; 56 57 void SetVendor(int32_t vendor) override; 58 59 void SetName(std::string name) override; 60 61 void SetPhys(std::string phys) override; 62 63 void SetUniq(std::string uniq) override; 64 65 private: 66 ArkWebRefPtr<ArkMMIDeviceInfoAdapter> ctocpp_; 67 }; 68 69 } // namespace OHOS::ArkWeb 70 71 #endif // ARK_MMI_DEVICE_INFO_ADAPTER_WRAPPER_H 72