• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SKELETON_H
17 #define GEO_CONVERT_SKELETON_H
18 
19 #include <vector>
20 
21 #include "iremote_broker.h"
22 #include "iremote_stub.h"
23 #include "message_parcel.h"
24 #include "string_ex.h"
25 
26 #include "geo_coding_mock_info.h"
27 
28 namespace OHOS {
29 namespace Location {
30 class IGeoConvert : public IRemoteBroker {
31 public:
32     enum {
33         IS_AVAILABLE = 11,
34         GET_FROM_COORDINATE = 12,
35         GET_FROM_LOCATION_NAME_BY_BOUNDARY = 13,
36         ENABLE_REVERSE_GEOCODE_MOCK = 33,
37         DISABLE_REVERSE_GEOCODE_MOCK = 34,
38         SET_REVERSE_GEOCODE_MOCKINFO = 35,
39     };
40     DECLARE_INTERFACE_DESCRIPTOR(u"location.IGeoConvert");
41     virtual int IsGeoConvertAvailable(MessageParcel &rep) = 0;
42     virtual int GetAddressByCoordinate(MessageParcel &data, MessageParcel &rep) = 0;
43     virtual int GetAddressByLocationName(MessageParcel &data, MessageParcel &rep) = 0;
44     virtual bool EnableReverseGeocodingMock() = 0;
45     virtual bool DisableReverseGeocodingMock() = 0;
46     virtual LocationErrCode SetReverseGeocodingMockInfo(std::vector<std::shared_ptr<GeocodingMockInfo>>& mockInfo) = 0;
47 };
48 
49 class GeoConvertServiceStub : public IRemoteStub<IGeoConvert> {
50 public:
51     int32_t OnRemoteRequest(uint32_t code,
52         MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
53 private:
54     std::vector<std::shared_ptr<GeocodingMockInfo>> ParseGeocodingMockInfos(MessageParcel &data);
55 };
56 } // namespace OHOS
57 } // namespace Location
58 #endif // GEO_CONVERT_SKELETON_H
59