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_NAPI_H
17#define GEOFENCE_NAPI_H
18
19#include <list>
20#include <string>
21
22#include "napi_util.h"
23#include "geofence_request.h"
24#ifdef NOTIFICATION_ENABLE
25#include "notification.h"
26#include "notification_request.h"
27#endif
28
29namespace OHOS {
30namespace Location {
31bool JsObjToGeoFenceRequest(const napi_env& env, const napi_value& object,
32    const std::shared_ptr<GeofenceRequest>& request);
33bool ParseGnssGeofenceRequest(
34    const napi_env& env, const napi_value& value, std::shared_ptr<GeofenceRequest>& request);
35bool GenGnssGeofenceRequest(
36    const napi_env& env, const napi_value& value, std::shared_ptr<GeofenceRequest>& reminder);
37#ifdef NOTIFICATION_ENABLE
38void JsObjToNotificationRequestList(const napi_env& env, const napi_value& object,
39    std::vector<OHOS::Notification::NotificationRequest>& notificationRequestList);
40void GetNotificationRequestArray(const napi_env& env, const napi_value& notificationRequest,
41    std::vector<OHOS::Notification::NotificationRequest>& notificationRequestList);
42#endif
43void JsObjToGeofenceTransitionEventList(const napi_env& env, const napi_value& object,
44    std::vector<GeofenceTransitionEvent>& geofenceTransitionStatusList);
45void GetGeofenceTransitionEventArray(const napi_env& env, const napi_value& monitorGeofenceTransition,
46    std::vector<GeofenceTransitionEvent>& geofenceTransitionStatusList);
47#ifdef NOTIFICATION_ENABLE
48void GenNotificationRequest(const napi_env& env, const napi_value& elementValue,
49    OHOS::Notification::NotificationRequest& notificationRequest);
50#endif
51void GeofenceTransitionToJs(const napi_env& env,
52    const GeofenceTransition geofenceTransition, napi_value& result);
53void JsObjToGeofenceTransitionCallback(const napi_env& env, const napi_value& object,
54    sptr<LocationGnssGeofenceCallbackNapi> callbackHost);
55}  // namespace Location
56}  // namespace OHOS
57#endif // GEOFENCE_NAPI_H
58