1 /* 2 * Copyright (C) 2018, Matthias Clasen 3 * 4 * This file is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU Lesser General Public License as 6 * published by the Free Software Foundation, version 3.0 of the 7 * License. 8 * 9 * This file is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * 17 * SPDX-License-Identifier: LGPL-3.0-only 18 */ 19 20 #pragma once 21 22 #include <libportal/types.h> 23 24 G_BEGIN_DECLS 25 26 /** 27 * XdpLocationAccuracy: 28 * @XDP_LOCATION_ACCURACY_NONE: No particular accuracy 29 * @XDP_LOCATION_ACCURACY_COUNTRY: Country-level accuracy 30 * @XDP_LOCATION_ACCURACY_CITY: City-level accuracy 31 * @XDP_LOCATION_ACCURACY_NEIGHBORHOOD: Neighborhood-level accuracy 32 * @XDP_LOCATION_ACCURACY_STREET: Street-level accuracy 33 * @XDP_LOCATION_ACCURACY_EXACT: Maximum accuracy 34 * 35 * The values of this enum indicate the desired level 36 * of accuracy for location information. 37 */ 38 typedef enum { 39 XDP_LOCATION_ACCURACY_NONE, 40 XDP_LOCATION_ACCURACY_COUNTRY, 41 XDP_LOCATION_ACCURACY_CITY, 42 XDP_LOCATION_ACCURACY_NEIGHBORHOOD, 43 XDP_LOCATION_ACCURACY_STREET, 44 XDP_LOCATION_ACCURACY_EXACT 45 } XdpLocationAccuracy; 46 47 typedef enum { 48 XDP_LOCATION_MONITOR_FLAG_NONE = 0 49 } XdpLocationMonitorFlags; 50 51 XDP_PUBLIC 52 void xdp_portal_location_monitor_start (XdpPortal *portal, 53 XdpParent *parent, 54 guint distance_threshold, 55 guint time_threshold, 56 XdpLocationAccuracy accuracy, 57 XdpLocationMonitorFlags flags, 58 GCancellable *cancellable, 59 GAsyncReadyCallback callback, 60 gpointer data); 61 62 XDP_PUBLIC 63 gboolean xdp_portal_location_monitor_start_finish (XdpPortal *portal, 64 GAsyncResult *result, 65 GError **error); 66 67 XDP_PUBLIC 68 void xdp_portal_location_monitor_stop (XdpPortal *portal); 69 70 G_END_DECLS 71