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 LOCATION_NAPI_ADAPTER_H 17 #define LOCATION_NAPI_ADAPTER_H 18 19 #include "common_utils.h" 20 #include "locator.h" 21 #include "napi_util.h" 22 23 namespace OHOS { 24 namespace Location { 25 napi_value GetLastLocation(napi_env env, napi_callback_info info); 26 napi_value IsLocationEnabled(napi_env env, napi_callback_info info); 27 napi_value EnableLocation(napi_env env, napi_callback_info info); 28 napi_value DisableLocation(napi_env env, napi_callback_info info); 29 napi_value RequestEnableLocation(napi_env env, napi_callback_info info); 30 napi_value IsGeoServiceAvailable(napi_env env, napi_callback_info info); 31 napi_value GetAddressesFromLocation(napi_env env, napi_callback_info info); 32 napi_value GetAddressesFromLocationName(napi_env env, napi_callback_info info); 33 napi_value GetCachedGnssLocationsSize(napi_env env, napi_callback_info info); 34 napi_value FlushCachedGnssLocations(napi_env env, napi_callback_info info); 35 napi_value SendCommand(napi_env env, napi_callback_info info); 36 #ifdef ENABLE_NAPI_MANAGER 37 napi_value IsLocationPrivacyConfirmed(napi_env env, napi_callback_info info); 38 napi_value SetLocationPrivacyConfirmStatus(napi_env env, napi_callback_info info); 39 napi_value GetIsoCountryCode(napi_env env, napi_callback_info info); 40 napi_value EnableLocationMock(napi_env env, napi_callback_info info); 41 napi_value DisableLocationMock(napi_env env, napi_callback_info info); 42 napi_value SetMockedLocations(napi_env env, napi_callback_info info); 43 napi_value EnableReverseGeocodingMock(napi_env env, napi_callback_info info); 44 napi_value DisableReverseGeocodingMock(napi_env env, napi_callback_info info); 45 napi_value SetReverseGeocodingMockInfo(napi_env env, napi_callback_info info); 46 napi_value HandleGetCachedLocation(napi_env env); 47 LocationErrCode CheckLocationSwitchState(); 48 napi_value GetLocatingRequiredData(napi_env env, napi_callback_info info); 49 #endif 50 } // namespace Location 51 } // namespace OHOS 52 #endif // LOCATION_NAPI_ADAPTER_H 53