1/* 2 * Copyright (c) 2023 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 /** 17 * @addtogroup HdiLpfenceCellfence 18 * @{ 19 * 20 * @brief Provides cell fence APIs for low-power fence services. 21 * 22 * You can use the APIs to add or remove cell fences and obtain cell fence information of a device. 23 * The cell fence module is used to determine whether a device reaches a comparatively large area, so that subsequent services, for example, pushing the scenic spot introduction to tourists, can be implemented. 24 * 25 * @since 4.0 26 * @version 1.0 27 */ 28 29/** 30 * @file ICellfenceCallback.idl 31 * 32 * @brief Defines the callbacks of the cell fence module. 33 * 34 * @since 4.0 35 * @version 1.0 36 */ 37 38/** 39 * @brief Declares the path of the cell fence module interface package. 40 * 41 * @since 4.0 42 */ 43package ohos.hdi.location.lpfence.cellfence.v1_0; 44 45/** 46 * @brief Imports data types of the cell fence module. 47 * 48 * @since 4.0 49 */ 50import ohos.hdi.location.lpfence.cellfence.v1_0.CellfenceTypes; 51 52/** 53 * @brief Defines the callback of the cell fence module. 54 * 55 * Before enabling the cell fencing feature, you need to register the callback to report the cell fence status when the relationship between a cell fence and a device changes. 56 * For details, see {@link ICellfenceInterface}. 57 * 58 * @since 4.0 59 */ 60[callback] interface ICellfenceCallback { 61 /** 62 * @brief Called to report the cell fence status changes. 63 * 64 * This callback will be invoked to report the cell fence status when the relationship between a device and a cell fence changes. 65 * 66 * @param fences Indicates the cell fence status change to report. For details, see {@link CellfenceStatus}. 67 * 68 * @return Returns <b>0</b> if the callback is invoked successfully. 69 * @return Returns a negative value if the callback fails to be invoked. 70 * 71 * @since 4.0 72 */ 73 OnCellfenceChanged([in] struct CellfenceStatus fences); 74 75 /** 76 * @brief Called to report the cell fence information of a device. 77 * 78 * 79 * @param size Indicates the cell fence information obtained. For details, see {@link CellfenceSize}. 80 * 81 * @return Returns <b>0</b> if the callback is invoked successfully. 82 * @return Returns a negative value if the callback fails to be invoked. 83 * 84 * @since 4.0 85 */ 86 OnGetCellfenceSizeCb([in] struct CellfenceSize size); 87 88 /** 89 * @brief Called when the low-power fence service is reset. 90 * 91 * 92 * @return Returns <b>0</b> if the callback is invoked successfully. 93 * @return Returns a negative value if the callback fails to be invoked. 94 * 95 * @since 4.0 96 */ 97 OnCellfenceReset(); 98} 99/** @} */ 100