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_IMPL_H
17 #define ARK_MMI_DEVICE_INFO_ADAPTER_IMPL_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 ArkMMIDeviceInfoAdapterImpl : public ArkMMIDeviceInfoAdapter {
26 public:
27     explicit ArkMMIDeviceInfoAdapterImpl(std::shared_ptr<OHOS::NWeb::MMIDeviceInfoAdapter>);
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     ArkWebString GetName() override;
42 
43     ArkWebString GetPhys() override;
44 
45     ArkWebString 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(ArkWebString name) override;
60 
61     void SetPhys(ArkWebString phys) override;
62 
63     void SetUniq(ArkWebString uniq) override;
64 
65 private:
66     std::shared_ptr<OHOS::NWeb::MMIDeviceInfoAdapter> real_;
67 
68     IMPLEMENT_REFCOUNTING(ArkMMIDeviceInfoAdapterImpl);
69 };
70 
71 } // namespace OHOS::ArkWeb
72 
73 #endif // ARK_MMI_DEVICE_INFO_ADAPTER_IMPL_H
74