/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * @addtogroup HdiGeofence * @{ * * @brief Provides unified APIs for the GNSS geofence service. * * A gnss service module can use the interfaces of this module to add fences, and delete fences, and monitor * fence status changes. * * @since 3.2 */ /* * @file IGeofenceCallback.idl * * @brief Define callback interfaces for reporting whether the geofence service is available, and reporting * geofence events, and reporting geofence operation results. * * @since 3.2 * @version 1.0 */ package ohos.hdi.location.geofence.v1_0; import ohos.hdi.location.geofence.v1_0.GeofenceTypes; /* * @brief Defines the geofence callback interface for reporting geofence service availability, geofence events, * and geofence operation results. * * @since 3.2 */ [callback] interface IGeofenceCallback { /* * @brief Report whether the geofence service is available. * * @param isAvailable Indicates whether the geofence service is available. * @return Returns 0 if reporting is successed; returns a negative value otherwise. * * @since 3.2 * @version 1.0 */ ReportGeofenceAvailability([in] boolean isAvailable); /* * @brief Report of fence entry and exit events. * * @param fenceIndex Indicates geofence ID, this geofence ID is unique. * @param location Indicates current Location. For details, see {@link Location}. * @param event Indicates name of the currently report event. For details, see {@link GeofenceEvent}. * @param timestamp Indicates timestamp when the geofence event is reported. Milliseconds since January 1, 1970. * @return Returns 0 if reporting is successed; returns a negative value otherwise. * * @since 3.2 * @version 1.0 */ ReportGeofenceEvent([in] int fenceIndex, [in] struct LocationInfo location, [in] enum GeofenceEvent event, [in] long timestamp); /* * @brief Report the fence operation result. * * @param fenceIndex Indicates geofence ID, this geofence ID is unique. * @param type Indicates geofence operation type. For details, see {@link GeofenceOperateType}. * @param result Indicates geofence operation result. For details, see {@link GeofenceOperateResult}. * @return Returns 0 if reporting is successed; returns a negative value otherwise. * * @since 3.2 * @version 1.0 */ ReportGeofenceOperateResult([in] int fenceIndex, [in] enum GeofenceOperateType type, [in] enum GeofenceOperateResult result); }