use zbus::proxy;
use zvariant::ObjectPath;
#[allow(dead_code)]
pub enum AccuracyLevel {
None = 0,
Country = 1,
City = 4,
Neighborhood = 5,
Street = 6,
Exact = 8,
}
#[proxy(
default_service = "org.freedesktop.GeoClue2",
interface = "org.freedesktop.GeoClue2.Manager",
default_path = "/org/freedesktop/GeoClue2/Manager"
)]
pub trait Manager {
#[zbus(object = "Client")]
fn get_client(&self);
}
#[proxy(
default_service = "org.freedesktop.GeoClue2",
interface = "org.freedesktop.GeoClue2.Client"
)]
pub trait Client {
fn start(&self) -> zbus::Result<()>;
fn stop(&self) -> zbus::Result<()>;
#[zbus(signal)]
fn location_updated(&self, old: ObjectPath<'_>, new: ObjectPath<'_>) -> zbus::Result<()>;
#[zbus(property)]
fn set_desktop_id(&self, id: &str) -> zbus::Result<()>;
#[zbus(property)]
fn set_distance_threshold(&self, meters: u32) -> zbus::Result<()>;
#[zbus(property)]
fn set_requested_accuracy_level(&self, level: u32) -> zbus::Result<()>;
}
#[proxy(
default_service = "org.freedesktop.GeoClue2",
interface = "org.freedesktop.GeoClue2.Location"
)]
pub trait Location {
#[zbus(property)]
fn latitude(&self) -> zbus::Result<f64>;
#[zbus(property)]
fn longitude(&self) -> zbus::Result<f64>;
}