summaryrefslogtreecommitdiff
path: root/src/org.freedesktop.DeviceKit.Power.xml
blob: 3070c30dd7d3674e6f0537b50bf93f17ec2996f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE node PUBLIC
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">

  <interface name="org.freedesktop.DeviceKit.Power">
    <doc:doc>
      <doc:description>
        <doc:para>
          The DeviceKit-power service is available via the system message
          bus. To access the service, use
          the <doc:tt>org.freedesktop.DeviceKit.Power</doc:tt> interface on
          the <doc:tt>/org/freedesktop/DeviceKit/Power</doc:tt> object on
          the D-Bus system bus service with the well-known
          name <doc:tt>org.freedesktop.DeviceKit.Power</doc:tt>.
        </doc:para>
        <doc:para>
          <doc:example language="shell" title="simple example">
            <doc:code>
$ dbus-send --print-reply \
            --system \
            --dest=org.freedesktop.DeviceKit.Power \
            /org/freedesktop/DeviceKit/Power \
            org.freedesktop.DeviceKit.Power.EnumerateDevices

method return sender=:1.386 -> dest=:1.451 reply_serial=2
   array [
      object path "/org/freedesktop/DeviceKit/Power/devices/line_power_AC"
      object path "/org/freedesktop/DeviceKit/Power/devices/battery_BAT0"
   ]
            </doc:code>
          </doc:example>
        </doc:para>
      </doc:description>
    </doc:doc>

    <!-- ************************************************************ -->

    <method name="EnumerateDevices">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="devices" direction="out" type="ao">
        <doc:doc><doc:summary>An array of object paths for devices.</doc:summary></doc:doc>
      </arg>

      <doc:doc>
        <doc:description>
          <doc:para>
            Enumerate all power objects on the system.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <!-- ************************************************************ -->

    <signal name="DeviceAdded">
      <arg name="device" type="o">
        <doc:doc><doc:summary>Object path of device that was added.</doc:summary></doc:doc>
      </arg>

      <doc:doc>
        <doc:description>
          <doc:para>
            Emitted when a device is added.
          </doc:para>
        </doc:description>
      </doc:doc>
    </signal>

    <!-- ************************************************************ -->

    <signal name="DeviceRemoved">
      <arg name="device" type="o">
        <doc:doc><doc:summary>Object path of device that was removed.</doc:summary></doc:doc>
      </arg>

      <doc:doc>
        <doc:description>
          <doc:para>
            Emitted when a device is removed.
          </doc:para>
        </doc:description>
      </doc:doc>
    </signal>

    <!-- ************************************************************ -->

    <signal name="DeviceChanged">
      <arg name="device" type="o">
        <doc:doc><doc:summary>Object path of device that was changed.</doc:summary></doc:doc>
      </arg>

      <doc:doc>
        <doc:description>
          <doc:para>
            Emitted when a device changed.
          </doc:para>
        </doc:description>
      </doc:doc>
    </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">
      <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.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <!-- ************************************************************ -->

    <method name="CanHibernate">
      <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.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <!-- ************************************************************ -->

    <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=""/>
      <doc:doc>
        <doc:description>
          <doc:para>
            Hibernates the computer into a low power state.
            System state is preserved if the power is lost.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <!-- ************************************************************ -->

  </interface>

</node>