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_IMPL_H 17#define GEOLOCATIONMANAGER_IMPL_H 18 19#include <cstdint> 20#include <functional> 21#include <string> 22#include <vector> 23#include "locator.h" 24#include "location_napi_event.h" 25#include "geolocationmanager_utils.h" 26 27namespace OHOS { 28namespace GeoLocationManager { 29CJLocation GetLastLocation(int32_t& errCode); 30 31bool IsLocationEnabled(int32_t& errCode); 32 33bool IsGeocoderAvailable(int32_t& errCode); 34 35int32_t GetCachedGnssLocationsSize(int32_t& errCode); 36 37CJLocation GetCurrentLocation(int32_t& errCode); 38 39CJLocation GetCurrentLocationCurrent(CJCurrentLocationRequest request, int32_t& errCode); 40 41CJLocation GetCurrentLocationSingle(CJSingleLocationRequest request, int32_t& errCode); 42 43CJLocation GetCurrentLocation(std::unique_ptr<Location::RequestConfig>& requestConfig, int32_t& errCode); 44 45void FlushCachedGnssLocations(int32_t& errCode); 46 47void SendCommand(CJLocationCommand command, int32_t& errCode); 48 49CJCountryCode GetCountryCode(int32_t& errCode); 50 51CJGeoAddressArr GetAddressesFromLocation(CJReverseGeoCodeRequest request, int32_t& errCode); 52 53CJGeoAddressArr GetAddressesFromLocationName(CJGeoCodeRequest request, int32_t& errCode); 54 55int32_t OnLocationRequest(CJLocationRequest request, int64_t callbackId); 56 57int32_t OnContinuousLocationRequest(CJContinuousLocationRequest request, int64_t callbackId); 58 59int32_t OffLocationChange(int64_t callbackId); 60 61int32_t OffLocationChangeAll(); 62 63int32_t OnLocationError(int64_t callbackId); 64 65int32_t OffLocationError(int64_t callbackId); 66 67int32_t OffLocationErrorAll(); 68 69int32_t OnLocationEnabledChange(int64_t callbackId); 70 71int32_t OffLocationEnabledChange(int64_t callbackId); 72 73int32_t OffLocationEnabledChangeAll(); 74 75int32_t OnCachedGnssLocationsChange(CJCachedGnssLocationsRequest request, 76 int64_t callbackId); 77 78int32_t OffCachedGnssLocationsChange(int64_t callbackId); 79 80int32_t OffCachedGnssLocationsChangeAll(); 81 82int32_t OnSatelliteStatusChange(int64_t callbackId); 83 84int32_t OffSatelliteStatusChange(int64_t callbackId); 85 86int32_t OffSatelliteStatusChangeAll(); 87 88int32_t OnNmeaMessage(int64_t callbackId); 89 90int32_t OffNmeaMessage(int64_t callbackId); 91 92int32_t OffNmeaMessageAll(); 93 94int32_t OnCountryCodeChange(int64_t callbackId); 95 96int32_t OffCountryCodeChange(int64_t callbackId); 97 98int32_t OffCountryCodeChangeAll(); 99 100CArrI32 GetGeofenceSupportedCoordTypes(int32_t& errCode); 101} 102} 103 104#endif // GEOLOCATIONMANAGER_IMPL_H