Top | ![]() |
![]() |
![]() |
![]() |
A helper GObject to use for accessing UPower information, and to be notified when it is changed.
See also: UpDevice
gboolean up_client_about_to_sleep_sync (UpClient *client
,UpSleepKind sleep_kind
,GCancellable *cancellable
,GError **error
);
Tells UPower that we are soon to reqest either Suspend()
or Hibernate()
and that session and system components should be notified of this.
client |
a UpClient instance. |
|
sleep_kind |
a sleep type, e.g. |
|
cancellable |
a GCancellable or |
|
error |
Since 0.9.11
gboolean up_client_enumerate_devices_sync (UpClient *client
,GCancellable *cancellable
,GError **error
);
Enumerates all the devices from the daemon.
Since 0.9.0
gboolean
up_client_get_can_hibernate (UpClient *client
);
Get whether the system is able to hibernate.
Since 0.9.0
gboolean
up_client_get_can_suspend (UpClient *client
);
Get whether the system is able to suspend.
Since 0.9.0
const gchar *
up_client_get_daemon_version (UpClient *client
);
Get UPower daemon version.
Since 0.9.0
GPtrArray *
up_client_get_devices (UpClient *client
);
Get a copy of the device objects.
You must have called up_client_enumerate_devices_sync()
before calling this
function.
an array of UpDevice objects, free with g_ptr_array_unref()
.
[element-type UpDevice][transfer full]
Since 0.9.0
gboolean
up_client_get_is_docked (UpClient *client
);
Get whether the machine is docked into a docking station.
Since 0.9.2
gboolean
up_client_get_lid_force_sleep (UpClient *client
);
Get whether the laptop has to sleep when the lid is closed.
Since 0.9.9
gboolean
up_client_get_lid_is_closed (UpClient *client
);
Get whether the laptop lid is closed.
Since 0.9.0
gboolean
up_client_get_lid_is_present (UpClient *client
);
Get whether a laptop lid is present on this machine.
Since 0.9.2
gboolean
up_client_get_on_battery (UpClient *client
);
Get whether the system is running on battery power.
Since 0.9.0
gboolean
up_client_get_on_low_battery (UpClient *client
);
Get whether the system is running on low battery power.
Since 0.9.0
gboolean up_client_get_properties_sync (UpClient *client
,GCancellable *cancellable
,GError **error
);
Get all the properties from UPower daemon.
Since 0.9.0
gboolean up_client_hibernate_sync (UpClient *client
,GCancellable *cancellable
,GError **error
);
Puts the computer into a low power state, where state is preserved if the power is lost.
Since 0.9.0
gboolean up_client_suspend_sync (UpClient *client
,GCancellable *cancellable
,GError **error
);
Puts the computer into a low power state, but state is not preserved if the power is lost.
NOTE: The system is still consuming a small amount of power
Since 0.9.0