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/*
17 * @addtogroup HdiGeofence
18 * @{
19 *
20 * @brief Provides unified APIs for the GNSS geofence service.
21 *
22 * A gnss service module can use the interfaces of this module to add fences, and delete fences, and monitor
23 * fence status changes.
24 *
25 * @since 5.0
26 */
27
28/*
29 * @file IGeofenceInterface.idl
30 *
31 * @brief Define interfaces such as adding fences, deleting fences, and setting callback.
32 *
33 * @since 5.0
34 * @version 2.0
35 */
36
37package ohos.hdi.location.geofence.v2_0;
38
39import ohos.hdi.location.geofence.v2_0.IGeofenceCallback;
40import ohos.hdi.location.geofence.v2_0.GeofenceTypes;
41
42/*
43 * @brief Defines the functions for performing basic operations on geofence.
44 *
45 * The operations include adding fences, deleting fences, and setting callback.
46 *
47 * @since 5.0
48 */
49interface IGeofenceInterface {
50    /*
51     * @brief Set callback function for geofence.
52     *
53     * @param callback Indicates callback function of geofence, gnss driver use this callback to report
54     * the geofence service Availability, and report geofence event, and report the geofence operation result.
55     * For details, see {@link IGeofenceCallback}.
56     * @return Returns <b>0</b> if setup callback successed; returns a negative value otherwise.
57     *
58     * @since 5.0
59     * @version 2.0
60     */
61    SetGeofenceCallback([in] IGeofenceCallback callbackObj);
62
63    /*
64     * @brief Add a geofence.
65     *
66     * @param fence Indicates geofence configuration parameters. For details, see {@link GeofenceInfo}.
67     * @param monitorEvent Indicates the geofence events that the application needs to listen to.
68     * For details, see {@link GeofenceEvent}.
69     * @return Returns <b>0</b> if add geofence successed; returns a negative value otherwise.
70     *
71     * @since 5.0
72     * @version 2.0
73     */
74    AddGnssGeofence([in] struct GeofenceInfo fence,
75                    [in]int monitorEvent);
76
77    /*
78     * @brief Delete a geofence.
79     *
80     * @param fenceIndex Indicates the ID of the geofence.
81     * @return Returns <b>0</b> if delete geofence successed; returns a negative value otherwise.
82     *
83     * @since 5.0
84     * @version 2.0
85     */
86    DeleteGnssGeofence([in] int fenceIndex);
87}
88/** @} */