1 /* 2 * Copyright (c) 2023 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_location_info_wrapper.h" 17 18 namespace OHOS::ArkWeb { 19 ArkLocationInfoWrapper(ArkWebRefPtr<ArkLocationInfo> ref)20ArkLocationInfoWrapper::ArkLocationInfoWrapper(ArkWebRefPtr<ArkLocationInfo> ref) : ctocpp_(ref) {} 21 GetLatitude()22double ArkLocationInfoWrapper::GetLatitude() 23 { 24 return ctocpp_->GetLatitude(); 25 } 26 GetLongitude()27double ArkLocationInfoWrapper::GetLongitude() 28 { 29 return ctocpp_->GetLongitude(); 30 } 31 GetAltitude()32double ArkLocationInfoWrapper::GetAltitude() 33 { 34 return ctocpp_->GetAltitude(); 35 } 36 GetAccuracy()37float ArkLocationInfoWrapper::GetAccuracy() 38 { 39 return ctocpp_->GetAccuracy(); 40 } 41 GetSpeed()42float ArkLocationInfoWrapper::GetSpeed() 43 { 44 return ctocpp_->GetSpeed(); 45 } 46 GetDirection()47double ArkLocationInfoWrapper::GetDirection() 48 { 49 return ctocpp_->GetDirection(); 50 } 51 GetTimeStamp()52int64_t ArkLocationInfoWrapper::GetTimeStamp() 53 { 54 return ctocpp_->GetTimeStamp(); 55 } 56 GetTimeSinceBoot()57int64_t ArkLocationInfoWrapper::GetTimeSinceBoot() 58 { 59 return ctocpp_->GetTimeSinceBoot(); 60 } 61 GetAdditions()62std::vector<std::string> ArkLocationInfoWrapper::GetAdditions() 63 { 64 ArkWebStringVector vec = ctocpp_->GetAdditions(); 65 std::vector<std::string> result = ArkWebStringVectorStructToClass(vec); 66 ArkWebStringVectorStructRelease(vec); 67 return result; 68 } 69 70 } // namespace OHOS::ArkWeb 71