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_display_adapter_wrapper.h" 17 18 namespace OHOS::ArkWeb { 19 ArkDisplayAdapterWrapper(ArkWebRefPtr<ArkDisplayAdapter> ref)20ArkDisplayAdapterWrapper::ArkDisplayAdapterWrapper(ArkWebRefPtr<ArkDisplayAdapter> ref) : ctocpp_(ref) {} 21 GetId()22OHOS::NWeb::DisplayId ArkDisplayAdapterWrapper::GetId() 23 { 24 return ctocpp_->GetId(); 25 } 26 GetWidth()27int32_t ArkDisplayAdapterWrapper::GetWidth() 28 { 29 return ctocpp_->GetWidth(); 30 } 31 GetHeight()32int32_t ArkDisplayAdapterWrapper::GetHeight() 33 { 34 return ctocpp_->GetHeight(); 35 } 36 GetVirtualPixelRatio()37float ArkDisplayAdapterWrapper::GetVirtualPixelRatio() 38 { 39 return ctocpp_->GetVirtualPixelRatio(); 40 } 41 GetRotation()42OHOS::NWeb::RotationType ArkDisplayAdapterWrapper::GetRotation() 43 { 44 uint32_t type = ctocpp_->GetRotation(); 45 return (OHOS::NWeb::RotationType)type; 46 } 47 GetOrientation()48OHOS::NWeb::OrientationType ArkDisplayAdapterWrapper::GetOrientation() 49 { 50 uint32_t type = ctocpp_->GetOrientation(); 51 return (OHOS::NWeb::OrientationType)type; 52 } 53 GetDpi()54int32_t ArkDisplayAdapterWrapper::GetDpi() 55 { 56 return ctocpp_->GetDpi(); 57 } 58 GetDisplayOrientation()59OHOS::NWeb::DisplayOrientation ArkDisplayAdapterWrapper::GetDisplayOrientation() 60 { 61 uint32_t type = ctocpp_->GetDisplayOrientation(); 62 return (OHOS::NWeb::DisplayOrientation)type; 63 } 64 GetFoldStatus()65OHOS::NWeb::FoldStatus ArkDisplayAdapterWrapper::GetFoldStatus() 66 { 67 uint32_t foldstatus = ctocpp_->GetFoldStatus(); 68 return static_cast<OHOS::NWeb::FoldStatus>(foldstatus); 69 } 70 IsFoldable()71bool ArkDisplayAdapterWrapper::IsFoldable() 72 { 73 return ctocpp_->IsFoldable(); 74 } 75 } // namespace OHOS::ArkWeb 76