1c5e268c6Sopenharmony_ci/*
2c5e268c6Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at
6c5e268c6Sopenharmony_ci *
7c5e268c6Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c5e268c6Sopenharmony_ci *
9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and
13c5e268c6Sopenharmony_ci * limitations under the License.
14c5e268c6Sopenharmony_ci */
15c5e268c6Sopenharmony_ci
16c5e268c6Sopenharmony_ci /**
17c5e268c6Sopenharmony_ci * @addtogroup HdiLpfenceSafeLocation
18c5e268c6Sopenharmony_ci * @{
19c5e268c6Sopenharmony_ci *
20c5e268c6Sopenharmony_ci * @brief Provides safe location APIs for the safe location service.
21c5e268c6Sopenharmony_ci *
22c5e268c6Sopenharmony_ci * @since 5.0
23c5e268c6Sopenharmony_ci * @version 1.0
24c5e268c6Sopenharmony_ci */
25c5e268c6Sopenharmony_ci
26c5e268c6Sopenharmony_ci/**
27c5e268c6Sopenharmony_ci * @file ISafeLocationInterface.idl
28c5e268c6Sopenharmony_ci *
29c5e268c6Sopenharmony_ci * @brief Declares the callbacks for the safe location module.
30c5e268c6Sopenharmony_ci *
31c5e268c6Sopenharmony_ci * @since 5.0
32c5e268c6Sopenharmony_ci * @version 1.0
33c5e268c6Sopenharmony_ci */
34c5e268c6Sopenharmony_ci
35c5e268c6Sopenharmony_ci/**
36c5e268c6Sopenharmony_ci * @brief Declares the path of the safe location module interface package.
37c5e268c6Sopenharmony_ci *
38c5e268c6Sopenharmony_ci * @since 5.0
39c5e268c6Sopenharmony_ci */
40c5e268c6Sopenharmony_cipackage ohos.hdi.location.lpfence.safe_location.v1_0;
41c5e268c6Sopenharmony_ci
42c5e268c6Sopenharmony_ci/**
43c5e268c6Sopenharmony_ci * @brief Imports data types of the safe location module.
44c5e268c6Sopenharmony_ci *
45c5e268c6Sopenharmony_ci * @since 5.0
46c5e268c6Sopenharmony_ci */
47c5e268c6Sopenharmony_ciimport ohos.hdi.location.lpfence.safe_location.v1_0.SafeLocationTypes;
48c5e268c6Sopenharmony_ci
49c5e268c6Sopenharmony_ci/**
50c5e268c6Sopenharmony_ci * @brief Imports callbacks of the safe location module.
51c5e268c6Sopenharmony_ci *
52c5e268c6Sopenharmony_ci * @since 5.0
53c5e268c6Sopenharmony_ci */
54c5e268c6Sopenharmony_ciimport ohos.hdi.location.lpfence.safe_location.v1_0.ISafeLocationCallback;
55c5e268c6Sopenharmony_ci
56c5e268c6Sopenharmony_ci/**
57c5e268c6Sopenharmony_ci * @brief Provides APIs for basic safe location operations.
58c5e268c6Sopenharmony_ci *
59c5e268c6Sopenharmony_ci * You can use the APIs to register or unregister a callback
60c5e268c6Sopenharmony_ci */
61c5e268c6Sopenharmony_ciinterface ISafeLocationInterface {
62c5e268c6Sopenharmony_ci    /**
63c5e268c6Sopenharmony_ci     * @brief Registers a callback.
64c5e268c6Sopenharmony_ci     *
65c5e268c6Sopenharmony_ci     * Before enabling the safe location feature, you need to register a callback to report the device has obtained the safe location information.
66c5e268c6Sopenharmony_ci     *
67c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the callback to register, which needs to be registered only once. For details, see {@link ISafeLocCallback}.
68c5e268c6Sopenharmony_ci     *
69c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
70c5e268c6Sopenharmony_ci     * @return Returns a negative value if the operation fails.
71c5e268c6Sopenharmony_ci     *
72c5e268c6Sopenharmony_ci     * @since 5.0
73c5e268c6Sopenharmony_ci     * @version 1.0
74c5e268c6Sopenharmony_ci     */
75c5e268c6Sopenharmony_ci    RegisterSafeLocationCallback([in] ISafeLocationCallback callbackObj);
76c5e268c6Sopenharmony_ci
77c5e268c6Sopenharmony_ci    /**
78c5e268c6Sopenharmony_ci     * @brief Unregisters a callback.
79c5e268c6Sopenharmony_ci     *
80c5e268c6Sopenharmony_ci     * When the safe location feature is no longer required or the registered callback needs to be changed, you need to unregister the callback.
81c5e268c6Sopenharmony_ci     *
82c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the callback to unregister, which needs to be unregistered only once. For details, see {@link ISafeLocationCallback}.
83c5e268c6Sopenharmony_ci     *
84c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
85c5e268c6Sopenharmony_ci     * @return Returns a negative value if the operation fails.
86c5e268c6Sopenharmony_ci     *
87c5e268c6Sopenharmony_ci     * @since 5.0
88c5e268c6Sopenharmony_ci     * @version 1.0
89c5e268c6Sopenharmony_ci     */
90c5e268c6Sopenharmony_ci    UnregisterSafeLocationCallback([in] ISafeLocationCallback callbackObj);
91c5e268c6Sopenharmony_ci
92c5e268c6Sopenharmony_ci    /**
93c5e268c6Sopenharmony_ci     * @brief Obtains the latest safe location information.
94c5e268c6Sopenharmony_ci     *
95c5e268c6Sopenharmony_ci     *
96c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
97c5e268c6Sopenharmony_ci     * @return Returns a negative value if the operation fails.
98c5e268c6Sopenharmony_ci     *
99c5e268c6Sopenharmony_ci     * @since 5.0
100c5e268c6Sopenharmony_ci     * @version 1.0
101c5e268c6Sopenharmony_ci     */
102c5e268c6Sopenharmony_ci    GetSafeLocationSwitch([in] int mode);
103c5e268c6Sopenharmony_ci}
104c5e268c6Sopenharmony_ci/** @} */
105