1/*
2 * Copyright (c) 2024 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 GEOLOCATIONMANAGER_FFI_H
17#define GEOLOCATIONMANAGER_FFI_H
18
19#include <functional>
20#include <string>
21#include <vector>
22#include <cstdint>
23#include "ffi_remote_data.h"
24#include "geolocationmanager_utils.h"
25
26
27namespace OHOS {
28namespace GeoLocationManager {
29extern "C" {
30FFI_EXPORT CJLocation FfiOHOSGeoLocationManagerGetLastLocation(int32_t* errCode);
31
32FFI_EXPORT bool FfiOHOSGeoLocationManagerIsLocationEnabled(int32_t* errCode);
33
34FFI_EXPORT bool FfiOHOSGeoLocationManagerIsGeocoderAvailable(int32_t* errCode);
35
36FFI_EXPORT int32_t FfiOHOSGeoLocationManagerGetCachedGnssLocationsSize(int32_t* errCode);
37
38FFI_EXPORT CJLocation FfiOHOSGeoLocationManagerGetCurrentLocation(int32_t* errCode);
39
40FFI_EXPORT CJLocation FfiOHOSGeoLocationManagerGetCurrentLocationCurrent(CJCurrentLocationRequest request,
41    int32_t* errCode);
42
43FFI_EXPORT CJLocation FfiOHOSGeoLocationManagerGetCurrentLocationSingle(CJSingleLocationRequest request,
44    int32_t* errCode);
45
46FFI_EXPORT void FfiOHOSGeoLocationManagerFlushCachedGnssLocations(int32_t* errCode);
47
48FFI_EXPORT void FfiOHOSGeoLocationManagerSendCommand(CJLocationCommand command, int32_t* errCode);
49
50FFI_EXPORT CJCountryCode FfiOHOSGeoLocationManagerGetCountryCode(int32_t* errCode);
51
52FFI_EXPORT CJGeoAddressArr FfiOHOSGeoLocationManagerGetAddressesFromLocation(CJReverseGeoCodeRequest request,
53    int32_t* errCode);
54
55FFI_EXPORT CJGeoAddressArr FfiOHOSGeoLocationManagerGetAddressesFromLocationName(CJGeoCodeRequest request,
56    int32_t* errCode);
57
58FFI_EXPORT int32_t FfiGeoLocationManagerOnLocationChange(CJLocationRequest request, int64_t callbackId);
59
60FFI_EXPORT int32_t FfiGeoLocationManagerOnContinuousLocationRequest(CJContinuousLocationRequest request,
61    int64_t callbackId);
62
63FFI_EXPORT int32_t FfiGeoLocationManagerOffLocationChange(int64_t callbackId);
64
65FFI_EXPORT int32_t FfiGeoLocationManagerOffLocationChangeAll();
66
67FFI_EXPORT int32_t FfiGeoLocationManagerOnLocationError(int64_t callbackId);
68
69FFI_EXPORT int32_t FfiGeoLocationManagerOffLocationError(int64_t callbackId);
70
71FFI_EXPORT int32_t FfiGeoLocationManagerOffLocationErrorAll();
72
73FFI_EXPORT int32_t FfiGeoLocationManagerOnLocationEnabledChange(int64_t callbackId);
74
75FFI_EXPORT int32_t FfiGeoLocationManagerOffLocationEnabledChange(int64_t callbackId);
76
77FFI_EXPORT int32_t FfiGeoLocationManagerOffLocationEnabledChangeAll();
78
79FFI_EXPORT int32_t FfiGeoLocationManagerOnCachedGnssLocationsChange(CJCachedGnssLocationsRequest request,
80    int64_t callbackId);
81
82FFI_EXPORT int32_t FfiGeoLocationManagerOffCachedGnssLocationsChange(int64_t callbackId);
83
84FFI_EXPORT int32_t FfiGeoLocationManagerOffCachedGnssLocationsChangeAll();
85
86FFI_EXPORT int32_t FfiGeoLocationManagerOnSatelliteStatusChange(int64_t callbackId);
87
88FFI_EXPORT int32_t FfiGeoLocationManagerOffSatelliteStatusChange(int64_t callbackId);
89
90FFI_EXPORT int32_t FfiGeoLocationManagerOffSatelliteStatusChangeAll();
91
92FFI_EXPORT int32_t FfiGeoLocationManagerOnNmeaMessage(int64_t callbackId);
93
94FFI_EXPORT int32_t FfiGeoLocationManagerOffNmeaMessage(int64_t callbackId);
95
96FFI_EXPORT int32_t FfiGeoLocationManagerOffNmeaMessageAll();
97
98FFI_EXPORT int32_t FfiGeoLocationManagerOnCountryCodeChange(int64_t callbackId);
99
100FFI_EXPORT int32_t FfiGeoLocationManagerOffCountryCodeChange(int64_t callbackId);
101
102FFI_EXPORT int32_t FfiGeoLocationManagerOffCountryCodeChangeAll();
103
104FFI_EXPORT CArrI32 FfiGeoLocationManagerGetGeofenceSupportedCoordTypes(int32_t* errCode);
105}
106}
107}
108
109#endif // GEOLOCATIONMANAGER_FFI_H