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_CONVERT_PROXY_H 17 #define GEO_CONVERT_PROXY_H 18 #ifdef FEATURE_GEOCODE_SUPPORT 19 20 #include "iremote_object.h" 21 #include "iremote_proxy.h" 22 23 #include "common_utils.h" 24 #include "constant_definition.h" 25 #include "geo_coding_mock_info.h" 26 #include "geo_convert_skeleton.h" 27 28 namespace OHOS { 29 namespace Location { 30 class GeoConvertProxy : public IRemoteProxy<IGeoConvert> { 31 public: 32 explicit GeoConvertProxy(const sptr<IRemoteObject> &impl); 33 ~GeoConvertProxy() = default; 34 int IsGeoConvertAvailable(MessageParcel &reply) override; 35 int GetAddressByCoordinate(MessageParcel &data, MessageParcel &reply) override; 36 int GetAddressByLocationName(MessageParcel &data, MessageParcel &reply) override; 37 bool EnableReverseGeocodingMock() override; 38 bool DisableReverseGeocodingMock() override; 39 LocationErrCode SetReverseGeocodingMockInfo(std::vector<std::shared_ptr<GeocodingMockInfo>>& mockInfo) override; 40 bool SendSimpleMsgAndParseResult(const int msgId); 41 int SendSimpleMsg(const int msgId, MessageParcel& reply); 42 int SendMsgWithDataReply(const int msgId, MessageParcel& data, MessageParcel& reply); 43 private: 44 static inline BrokerDelegator<GeoConvertProxy> delegator_; 45 }; 46 } // namespace Location 47 } // namespace OHOS 48 #endif // FEATURE_GEOCODE_SUPPORT 49 #endif // GEO_CONVERT_PROXY_H 50