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 GEO_ADDRESS_H 17 #define GEO_ADDRESS_H 18 19 #include <map> 20 #include <parcel.h> 21 #include <string> 22 23 namespace OHOS { 24 namespace Location { 25 class GeoAddress : public Parcelable { 26 public: 27 GeoAddress(); 28 ~GeoAddress() override = default; 29 bool Marshalling(Parcel& parcel) const override; 30 static std::unique_ptr<GeoAddress> Unmarshalling(Parcel& parcel); 31 std::string GetDescriptions(int index); 32 double GetLatitude(); 33 double GetLongitude(); 34 void ReadFromParcel(Parcel& in); 35 36 double m_latitude; 37 double m_longitude; 38 std::string m_localeLanguage; 39 std::string m_localeCountry; 40 std::string m_placeName; 41 std::string m_countryCode; 42 std::string m_countryName; 43 std::string m_administrativeArea; 44 std::string m_subAdministrativeArea; 45 std::string m_locality; 46 std::string m_subLocality; 47 std::string m_roadName; 48 std::string m_subRoadName; 49 std::string m_premises; 50 std::string m_postalCode; 51 std::string m_phoneNumber; 52 std::string m_addressUrl; 53 std::map<int, std::string> m_descriptions; 54 int m_descriptionsSize = 0; 55 bool m_hasLatitude = false; 56 bool m_hasLongitude = false; 57 bool m_isFromMock = false; 58 static constexpr double PARCEL_INT_SIZE = 64.0; 59 static constexpr int MAX_PARCEL_SIZE = 100; 60 static constexpr int MAX_RESULT = 10; 61 }; 62 } // namespace Location 63 } // namespace OHOS 64 #endif // GEO_ADDRESS_H 65