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 GEOFENCE_EVENT_CALLBACK_H 17 #define GEOFENCE_EVENT_CALLBACK_H 18 19 #ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 20 21 #include <v2_0/igeofence_callback.h> 22 23 namespace OHOS { 24 namespace Location { 25 using HDI::Location::Geofence::V2_0::IGeofenceCallback; 26 using HDI::Location::Geofence::V2_0::GeofenceEvent; 27 using HDI::Location::Geofence::V2_0::GeofenceOperateType; 28 using HDI::Location::Geofence::V2_0::GeofenceOperateResult; 29 using HDI::Location::Geofence::V2_0::TYPE_DELETE; 30 using HDI::Location::Geofence::V2_0::GEOFENCE_OPERATION_SUCCESS; 31 using HDI::Location::Geofence::V2_0::TYPE_ADD; 32 33 class GeofenceEventCallback : public IGeofenceCallback { 34 public: ~GeofenceEventCallback()35 ~GeofenceEventCallback() override {} 36 int32_t ReportGeofenceAvailability(bool isAvailable) override; 37 int32_t ReportGeofenceEvent(int32_t fenceIndex, 38 const HDI::Location::Geofence::V2_0::LocationInfo& location, GeofenceEvent event, int64_t timestamp) override; 39 int32_t ReportGeofenceOperateResult( 40 int32_t fenceIndex, GeofenceOperateType type, GeofenceOperateResult result) override; 41 }; 42 } // namespace Location 43 } // namespace OHOS 44 #endif // HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 45 #endif // GEOFENCE_EVENT_CALLBACK_H 46