summaryrefslogtreecommitdiff
path: root/src/org.freedesktop.DeviceKit.Power.xml
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2008-11-11 13:58:26 -0500
committerDavid Zeuthen <davidz@redhat.com>2008-11-11 13:58:26 -0500
commitc9dbc80f367c5f537e96cf634badbae6fa2adc91 (patch)
treeaad708ab3601defd5d0e03a589fdf38c8d812f8c /src/org.freedesktop.DeviceKit.Power.xml
parentd34ad4346454b9bf03cd60a5d65fed558e691f43 (diff)
turn some methods into properties
GetOnBattery() -> :on-battery (bool) GetLowBattery() -> :on-low-battery (bool) CanSuspend() -> :can-suspend (bool) CanHibernate() -> :can-hibernate (bool) also add a new property for the daemon version :daemon-version (string) introduce a new Changed() signal that replaces ::LowBatteryChanged() ::OnBatteryChanged() Also fix a few bugs - we need to compute ::on-battery and ::on-low-battery *after* the actual device is updated - need to fire Device::Changed() before Power::DeviceChanged() otherwise devkit-power --monitor-detail lies also fix up libdevkit-power and devkit-power(1) to use these changes.
Diffstat (limited to 'src/org.freedesktop.DeviceKit.Power.xml')
-rw-r--r--src/org.freedesktop.DeviceKit.Power.xml153
1 files changed, 41 insertions, 112 deletions
diff --git a/src/org.freedesktop.DeviceKit.Power.xml b/src/org.freedesktop.DeviceKit.Power.xml
index 3070c30..b696364 100644
--- a/src/org.freedesktop.DeviceKit.Power.xml
+++ b/src/org.freedesktop.DeviceKit.Power.xml
@@ -100,88 +100,14 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2
</signal>
<!-- ************************************************************ -->
- <signal name="OnBatteryChanged">
- <arg name="on_battery" type="b">
- <doc:doc><doc:summary>If we are on battery power.</doc:summary></doc:doc>
- </arg>
-
- <doc:doc>
- <doc:description>
- <doc:para>
- Emitted when the main power source of the system has changed.
- </doc:para>
- </doc:description>
- </doc:doc>
- </signal>
-
- <!-- ************************************************************ -->
- <signal name="LowBatteryChanged">
- <arg name="low_battery" type="b">
- <doc:doc><doc:summary>If we are critically low on battery power.</doc:summary></doc:doc>
- </arg>
- <doc:doc>
- <doc:description>
- <doc:para>
- Emitted when the main power source of the system is critically low in power.
- </doc:para>
- </doc:description>
- </doc:doc>
- </signal>
-
- <!-- ************************************************************ -->
- <method name="GetOnBattery">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="on_battery" direction="out" type="b">
- <doc:doc><doc:summary>If we are on battery power.</doc:summary></doc:doc>
- </arg>
- <doc:doc>
- <doc:description>
- <doc:para>
- Finds out if we are using battery so we can make policy decisions,
- for instance not running the indexer when we are on battery power.
- </doc:para>
- </doc:description>
- </doc:doc>
- </method>
-
- <!-- ************************************************************ -->
- <method name="GetLowBattery">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="low_battery" direction="out" type="b">
- <doc:doc><doc:summary>If we are critically low on battery power.</doc:summary></doc:doc>
- </arg>
- <doc:doc>
- <doc:description>
- <doc:para>
- Finds out if we are critically low on battery so we can make policy
- decisions, for instance saving documents or turning off network
- connections.
- </doc:para>
- </doc:description>
- </doc:doc>
- </method>
-
- <!-- ************************************************************ -->
- <method name="CanSuspend">
+ <method name="Suspend">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="interactive" direction="in" type="b">
- <doc:doc>
- <doc:summary>
- If we are allowed to be interactive, and ask the user to authorise
- the action.
- </doc:summary>
- </doc:doc>
- </arg>
- <arg name="can_suspend" direction="out" type="b">
- <doc:doc><doc:summary>If we can suspend.</doc:summary></doc:doc>
- </arg>
<doc:doc>
<doc:description>
<doc:para>
- Returns if the computer is able to suspend.
- This function should be used to decide whether to show the
- Supend menu item or button in GUI programs.
+ Suspends the computer into a low power state.
+ System state is not preserved if the power is lost.
</doc:para>
</doc:description>
</doc:doc>
@@ -189,25 +115,13 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2
<!-- ************************************************************ -->
- <method name="CanHibernate">
+ <method name="Hibernate">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="interactive" direction="in" type="b">
- <doc:doc>
- <doc:summary>
- If we are allowed to be interactive, and ask the user to authorise
- the action.
- </doc:summary>
- </doc:doc>
- </arg>
- <arg name="can_hibernate" direction="out" type="b">
- <doc:doc><doc:summary>If we can hibernate.</doc:summary></doc:doc>
- </arg>
<doc:doc>
<doc:description>
<doc:para>
- Returns if the computer is able to hibernate.
- This function should be used to decide whether to show the
- Hibernate menu item or button in GUI programs.
+ Hibernates the computer into a low power state.
+ System state is preserved if the power is lost.
</doc:para>
</doc:description>
</doc:doc>
@@ -215,33 +129,48 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2
<!-- ************************************************************ -->
- <method name="Suspend">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <doc:doc>
- <doc:description>
- <doc:para>
- Suspends the computer into a low power state.
- System state is not preserved if the power is lost.
- </doc:para>
- </doc:description>
- </doc:doc>
- </method>
-
- <!-- ************************************************************ -->
- <method name="Hibernate">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <property name="daemon-version" type="s" access="read">
+ <doc:doc><doc:description><doc:para>
+ Version of the running daemon, e.g. <doc:tt>002</doc:tt>.
+ </doc:para></doc:description></doc:doc>
+ </property>
+
+ <property name="can-suspend" type="b" access="read">
+ <doc:doc><doc:description><doc:para>
+ Whether the system is able to suspend.
+ </doc:para></doc:description></doc:doc>
+ </property>
+
+ <property name="can-hibernate" type="b" access="read">
+ <doc:doc><doc:description><doc:para>
+ Whether the system is able to hibernate.
+ </doc:para></doc:description></doc:doc>
+ </property>
+
+ <property name="on-battery" type="b" access="read">
+ <doc:doc><doc:description><doc:para>
+ Indicates whether the system is running on battery power.
+ This property is provided for convenience.
+ </doc:para></doc:description></doc:doc>
+ </property>
+
+ <property name="on-low-battery" type="b" access="read">
+ <doc:doc><doc:description><doc:para>
+ Indicates whether the system is running on battery power and if the battery is critically low.
+ This property is provided for convenience.
+ </doc:para></doc:description></doc:doc>
+ </property>
+
+ <signal name="Changed">
<doc:doc>
<doc:description>
<doc:para>
- Hibernates the computer into a low power state.
- System state is preserved if the power is lost.
+ Emitted when one or more properties on the object changes.
</doc:para>
</doc:description>
</doc:doc>
- </method>
-
- <!-- ************************************************************ -->
+ </signal>
</interface>