dbus-settings-bindings/upower/src/upower.rs

44 lines
1.2 KiB
Rust
Raw Normal View History

// Copyright 2021 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use zbus::dbus_proxy;
use crate::device::{DeviceProxy, DeviceProxyBlocking};
#[dbus_proxy(interface = "org.freedesktop.UPower", assume_defaults = true)]
trait UPower {
2024-02-19 11:28:20 -05:00
/// EnumerateDevices method
fn enumerate_devices(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
2024-02-19 11:28:20 -05:00
/// GetCriticalAction method
fn get_critical_action(&self) -> zbus::Result<String>;
2024-02-19 11:28:20 -05:00
/// GetDisplayDevice method
#[dbus_proxy(object = "Device")]
fn get_display_device(&self);
2024-02-19 11:28:20 -05:00
/// DeviceAdded signal
#[dbus_proxy(signal)]
fn device_added(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
2024-02-19 11:28:20 -05:00
/// DeviceRemoved signal
#[dbus_proxy(signal)]
fn device_removed(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
2024-02-19 11:28:20 -05:00
/// DaemonVersion property
#[dbus_proxy(property)]
fn daemon_version(&self) -> zbus::Result<String>;
2024-02-19 11:28:20 -05:00
/// LidIsClosed property
#[dbus_proxy(property)]
fn lid_is_closed(&self) -> zbus::Result<bool>;
2024-02-19 11:28:20 -05:00
/// LidIsPresent property
#[dbus_proxy(property)]
fn lid_is_present(&self) -> zbus::Result<bool>;
2024-02-19 11:28:20 -05:00
/// OnBattery property
#[dbus_proxy(property)]
fn on_battery(&self) -> zbus::Result<bool>;
}