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 #include "ohos_adapter/bridge/ark_mmi_device_info_adapter_impl.h"
17 
18 namespace OHOS::ArkWeb {
19 
ArkMMIDeviceInfoAdapterImpl(std::shared_ptr<OHOS::NWeb::MMIDeviceInfoAdapter> ref)20 ArkMMIDeviceInfoAdapterImpl::ArkMMIDeviceInfoAdapterImpl(std::shared_ptr<OHOS::NWeb::MMIDeviceInfoAdapter> ref)
21     : real_(ref)
22 {}
23 
GetId()24 int32_t ArkMMIDeviceInfoAdapterImpl::GetId()
25 {
26     return real_->GetId();
27 }
28 
GetType()29 int32_t ArkMMIDeviceInfoAdapterImpl::GetType()
30 {
31     return real_->GetType();
32 }
33 
GetBus()34 int32_t ArkMMIDeviceInfoAdapterImpl::GetBus()
35 {
36     return real_->GetBus();
37 }
38 
GetVersion()39 int32_t ArkMMIDeviceInfoAdapterImpl::GetVersion()
40 {
41     return real_->GetVersion();
42 }
43 
GetProduct()44 int32_t ArkMMIDeviceInfoAdapterImpl::GetProduct()
45 {
46     return real_->GetProduct();
47 }
48 
GetVendor()49 int32_t ArkMMIDeviceInfoAdapterImpl::GetVendor()
50 {
51     return real_->GetVendor();
52 }
53 
GetName()54 ArkWebString ArkMMIDeviceInfoAdapterImpl::GetName()
55 {
56     std::string str = real_->GetName();
57     return ArkWebStringClassToStruct(str);
58 }
59 
GetPhys()60 ArkWebString ArkMMIDeviceInfoAdapterImpl::GetPhys()
61 {
62     std::string str = real_->GetPhys();
63     return ArkWebStringClassToStruct(str);
64 }
65 
GetUniq()66 ArkWebString ArkMMIDeviceInfoAdapterImpl::GetUniq()
67 {
68     std::string str = real_->GetUniq();
69     return ArkWebStringClassToStruct(str);
70 }
71 
SetId(int32_t id)72 void ArkMMIDeviceInfoAdapterImpl::SetId(int32_t id)
73 {
74     real_->SetId(id);
75 }
76 
SetType(int32_t type)77 void ArkMMIDeviceInfoAdapterImpl::SetType(int32_t type)
78 {
79     real_->SetType(type);
80 }
81 
SetBus(int32_t bus)82 void ArkMMIDeviceInfoAdapterImpl::SetBus(int32_t bus)
83 {
84     real_->SetBus(bus);
85 }
86 
SetVersion(int32_t version)87 void ArkMMIDeviceInfoAdapterImpl::SetVersion(int32_t version)
88 {
89     real_->SetVersion(version);
90 }
91 
SetProduct(int32_t product)92 void ArkMMIDeviceInfoAdapterImpl::SetProduct(int32_t product)
93 {
94     real_->SetProduct(product);
95 }
96 
SetVendor(int32_t vendor)97 void ArkMMIDeviceInfoAdapterImpl::SetVendor(int32_t vendor)
98 {
99     real_->SetVendor(vendor);
100 }
101 
SetName(ArkWebString name)102 void ArkMMIDeviceInfoAdapterImpl::SetName(ArkWebString name)
103 {
104     real_->SetName(ArkWebStringStructToClass(name));
105 }
106 
SetPhys(ArkWebString phys)107 void ArkMMIDeviceInfoAdapterImpl::SetPhys(ArkWebString phys)
108 {
109     real_->SetPhys(ArkWebStringStructToClass(phys));
110 }
111 
SetUniq(ArkWebString uniq)112 void ArkMMIDeviceInfoAdapterImpl::SetUniq(ArkWebString uniq)
113 {
114     real_->SetUniq(ArkWebStringStructToClass(uniq));
115 }
116 
117 } // namespace OHOS::ArkWeb
118