aboutsummaryrefslogtreecommitdiff
path: root/src/backend-dbus/org.freedesktop.ConsoleKit.Manager.xml
blob: f903b5546c128661920f2867e2b61aebd067f1ed (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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/freedesktop/ConsoleKit/Manager"
  xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"
>

  <interface name="org.freedesktop.ConsoleKit.Manager">
    <method name="Restart">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <doc:doc>
        <doc:description>
          <doc:para>This method initiates a request to restart (ie. reboot) the computer system.</doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <method name="CanRestart">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="can_restart" type="b" direction="out"/>
    </method>

    <method name="Stop">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <doc:doc>
        <doc:description>
          <doc:para>This method initiates a request to stop (ie. shutdown) the computer system.</doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <method name="CanStop">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="can_stop" type="b" direction="out"/>
    </method>

    <method name="OpenSession">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="cookie" direction="out" type="s">
        <doc:doc>
          <doc:summary>The secret cookie that is used to identify the new session</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This method requests that a new <doc:ref type="interface" to="Session">Session</doc:ref>
          be created for the calling process.  The properties of this new Session are set automatically
          from information collected about the calling process.
          </doc:para>
          <doc:para>This new session exists until the calling process disconnects from the system bus or
          calls <doc:ref type="method" to="Manager.CloseSession">CloseSession()</doc:ref>.
          </doc:para>
          <doc:para>It is the responsibility of the calling process to set the environment variable
          XDG_SESSION_COOKIE to the value of the returned cookie.  This cookie should only
          be made available to child processes of the caller so that they may be identified
          as members of this session.
          </doc:para>
          <doc:para>See this simple example:
          <doc:example language="c" title="simple example"><doc:code>
	DBusError       error;
	DBusMessage    *message;
	DBusMessage    *reply;

	message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit",
						"/org/freedesktop/ConsoleKit/Manager",
						"org.freedesktop.ConsoleKit.Manager",
						"OpenSession");
	if (message == NULL) {
		goto out;
	}

        dbus_error_init (&amp;error);
        reply = dbus_connection_send_with_reply_and_block (connector->connection,
                                                           message,
                                                           -1,
                                                           &amp;error);
        if (reply == NULL) {
		goto out;
        }

        dbus_error_init (&amp;error);
        if (! dbus_message_get_args (reply,
                                     &amp;error,
                                     DBUS_TYPE_STRING, &amp;cookie,
                                     DBUS_TYPE_INVALID)) {
		goto out;
        }

          </doc:code></doc:example></doc:para>
        </doc:description>
        <doc:seealso><doc:ref type="method" to="Manager.OpenSessionWithParameters">OpenSessionWithParameters()</doc:ref></doc:seealso>
      </doc:doc>
    </method>
    <method name="OpenSessionWithParameters">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="parameters" direction="in" type="a(sv)">
        <doc:doc>
          <doc:summary>An array of sets of property names and values</doc:summary>
        </doc:doc>
      </arg>
      <arg name="cookie" direction="out" type="s">
        <doc:doc>
          <doc:summary>The secret cookie that is used to identify the new session</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This method requests that a new <doc:ref type="interface" to="Session">Session</doc:ref>
          be created for the calling process.  The properties of this new Session are from the
          parameters provided.
          </doc:para>
          <doc:para>This new session exists until the calling process disconnects from the system bus or
          calls <doc:ref type="method" to="Manager.CloseSession">CloseSession()</doc:ref>.
          </doc:para>
          <doc:para>It is the responsibility of the calling process to set the environment variable
          XDG_SESSION_COOKIE to the value of the returned cookie.  This cookie should only
          be made available to child processes of the caller so that they may be identified
          as members of this session.
          </doc:para>
          <doc:para>See the <doc:ref type="interface" to="Session">Session</doc:ref> properties for a list of valid parameters.</doc:para>
        </doc:description>
        <doc:seealso><doc:ref type="interface" to="Session">org.freedesktop.ConsoleKit.Session</doc:ref></doc:seealso>
        <doc:permission>This method is restricted to privileged users by D-Bus policy.</doc:permission>
      </doc:doc>
    </method>
    <method name="CloseSession">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="cookie" direction="in" type="s">
        <doc:doc>
          <doc:summary>The secret cookie that is used to identify the session</doc:summary>
        </doc:doc>
      </arg>
      <arg name="result" direction="out" type="b">
        <doc:doc>
          <doc:summary>Whether the session was successfully closed</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This method is used to close the session identified by the supplied cookie.
          </doc:para>
          <doc:para>The session can only be closed by the same process that opened the session.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <method name="GetSeats">
      <arg name="seats" direction="out" type="ao">
        <doc:doc>
          <doc:summary>an array of Seat IDs</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This gets a list of all the <doc:ref type="interface" to="Seat">Seats</doc:ref>
          that are currently present on the system.</doc:para>
          <doc:para>Each Seat ID is an D-Bus object path for the object that implements the
          <doc:ref type="interface" to="Seat">Seat</doc:ref> interface.</doc:para>
        </doc:description>
        <doc:seealso><doc:ref type="interface" to="Seat">org.freedesktop.ConsoleKit.Seat</doc:ref></doc:seealso>
      </doc:doc>
    </method>

    <method name="GetSessions">
      <arg name="sessions" direction="out" type="ao">
        <doc:doc>
          <doc:summary>an array of Session IDs</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref>
          that are currently present on the system.</doc:para>
          <doc:para>Each Session ID is an D-Bus object path for the object that implements the
          <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para>
        </doc:description>
        <doc:seealso><doc:ref type="interface" to="Session">org.freedesktop.ConsoleKit.Session</doc:ref></doc:seealso>
      </doc:doc>
    </method>

    <method name="GetSessionForCookie">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="cookie" direction="in" type="s">
        <doc:doc>
          <doc:summary>The secret cookie that is used to identify the session</doc:summary>
        </doc:doc>
      </arg>
      <arg name="ssid" direction="out" type="o">
        <doc:doc>
          <doc:summary>The object identifier for the current session</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Returns the session ID that is associated with the specified cookie.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="GetSessionForUnixProcess">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="pid" direction="in" type="u">
        <doc:doc>
          <doc:summary>The POSIX process ID</doc:summary>
        </doc:doc>
      </arg>
      <arg name="ssid" direction="out" type="o">
        <doc:doc>
          <doc:summary>The object identifier for the current session</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Attempts to determine the session ID for the specified
          POSIX process ID (pid).
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="GetCurrentSession">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="ssid" direction="out" type="o">
        <doc:doc>
          <doc:summary>The object identifier for the current session</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Attempts to determine the session ID that the caller belongs to.
          </doc:para>
          <doc:para>See this example of using dbus-send:
          <doc:example language="shell" title="shell example"><doc:code>
  dbus-send --system --dest=org.freedesktop.ConsoleKit \
  --type=method_call --print-reply --reply-timeout=2000 \
  /org/freedesktop/ConsoleKit/Manager \
  org.freedesktop.ConsoleKit.Manager.GetCurrentSession
          </doc:code></doc:example></doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="GetSessionsForUnixUser">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="uid" direction="in" type="u">
         <doc:doc>
          <doc:summary>POSIX User identification</doc:summary>
        </doc:doc>
     </arg>
      <arg name="sessions" direction="out" type="ao">
        <doc:doc>
          <doc:summary>an array of Session IDs</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref>
          that are currently open for the specified user.</doc:para>
          <doc:para>Each Session ID is an D-Bus object path for the object that implements the
          <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="GetSessionsForUser">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg name="uid" direction="in" type="u">
         <doc:doc>
          <doc:summary>User identification</doc:summary>
        </doc:doc>
     </arg>
      <arg name="sessions" direction="out" type="ao">
        <doc:doc>
          <doc:summary>an array of Session IDs</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref>
          that are currently open for the specified user.</doc:para>
          <doc:para>Each Session ID is an D-Bus object path for the object that implements the
          <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para>
        </doc:description>
        <doc:deprecated version="0.1.3" instead="GetSessionsForUnixUser"/>
      </doc:doc>
    </method>

    <method name="GetSystemIdleHint">
      <arg name="idle_hint" type="b" direction="out">
        <doc:doc>
          <doc:summary>The value of the system-idle-hint</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Returns TRUE if the <doc:ref type="property" to="Session:idle-hint">idle-hint</doc:ref>
          property of every open session is TRUE or if there are no open sessions.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="GetSystemIdleSinceHint">
      <arg name="iso8601_datetime" type="s" direction="out">
        <doc:doc>
          <doc:summary>An ISO 8601 format date-type string</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Returns an ISO 8601 date-time string that corresponds to
          the time of the last change of the system-idle-hint.
          </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <signal name="SeatAdded">
      <arg name="sid" type="o">
        <doc:doc>
          <doc:summary>The Seat ID for the added seat</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Emitted when a Seat has been added to the system.
          </doc:para>
        </doc:description>
      </doc:doc>
    </signal>
    <signal name="SeatRemoved">
      <arg name="sid" type="o">
        <doc:doc>
          <doc:summary>The Seat ID for the removed seat</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Emitted when a Seat has been removed from the system.
          </doc:para>
        </doc:description>
      </doc:doc>
    </signal>
    <signal name="SystemIdleHintChanged">
      <arg name="hint" type="b">
        <doc:doc>
          <doc:summary>The value of the system-idle-hint</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Emitted when the value of the system-idle-hint has changed.
          </doc:para>
        </doc:description>
      </doc:doc>
    </signal>
  </interface>
</node>