~ubuntu-branches/ubuntu/wily/telepathy-glib/wily

« back to all changes in this revision

Viewing changes to spec/Channel_Dispatch_Operation.xml

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2009-03-24 22:06:52 UTC
  • mfrom: (1.3.1 upstream) (17.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20090324220652-c8dvom0nsqomp23d
Tags: 0.7.28-1
* New upstream version (ABI, API added)
* Put the -dbg package in section debug, as per recent archive changes
* Remove obsolete Conflicts/Replaces with libtelepathy-glib-static-dev, which
  was never in a stable release (and probably never in Debian at all)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" ?>
 
2
<node name="/Channel_Dispatch_Operation"
 
3
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
 
4
 
 
5
  <tp:copyright>Copyright (C) 2008 Collabora Ltd.</tp:copyright>
 
6
  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
 
7
  <tp:license xmlns="http://www.w3.org/1999/xhtml">
 
8
    <p>This library is free software; you can redistribute it and/or
 
9
      modify it under the terms of the GNU Lesser General Public
 
10
      License as published by the Free Software Foundation; either
 
11
      version 2.1 of the License, or (at your option) any later version.</p>
 
12
 
 
13
    <p>This library is distributed in the hope that it will be useful,
 
14
      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
      Lesser General Public License for more details.</p>
 
17
 
 
18
    <p>You should have received a copy of the GNU Lesser General Public
 
19
      License along with this library; if not, write to the Free Software
 
20
      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
21
      MA 02110-1301, USA.</p>
 
22
  </tp:license>
 
23
 
 
24
  <interface name="org.freedesktop.Telepathy.ChannelDispatchOperation.DRAFT"
 
25
    tp:causes-havoc="experimental">
 
26
 
 
27
    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
28
      <p>A channel dispatch operation is an object in the ChannelDispatcher
 
29
        representing a bundle of unrequested channels being announced to
 
30
        client
 
31
        <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client">Approver.DRAFT</tp:dbus-ref>
 
32
        processes.</p>
 
33
 
 
34
      <p>These objects can result from new incoming channels or channels
 
35
        which are automatically created for some reason, but cannot result
 
36
        from outgoing requests for channels.</p>
 
37
 
 
38
      <p>More specifically, whenever the
 
39
        <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.NewChannels</tp:dbus-ref>
 
40
        signal contains channels whose
 
41
        <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Requested</tp:dbus-ref>
 
42
        property is false, or whenever the
 
43
        <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.NewChannel</tp:dbus-ref>
 
44
        signal contains a channel with suppress_handler false,
 
45
        one or more ChannelDispatchOperation objects are created for those
 
46
        channels.</p>
 
47
 
 
48
      <p>(If some channels in a NewChannels signal are in different bundles,
 
49
        this is an error. The channel dispatcher SHOULD recover by treating
 
50
        the NewChannels signal as if it had been several NewChannels signals
 
51
        each containing one channel.)</p>
 
52
 
 
53
      <p>First, the channel dispatcher SHOULD construct a list of all the
 
54
        <tp:dbus-ref
 
55
          namespace="org.freedesktop.Telepathy.Client">Handler.DRAFT</tp:dbus-ref>s
 
56
        that could handle all the channels (based on their <tp:dbus-ref
 
57
          namespace="org.freedesktop.Telepathy.Client.Handler.DRAFT">HandlerChannelFilter</tp:dbus-ref>
 
58
        property), ordered by
 
59
        priority in some implementation-dependent way. If there are handlers
 
60
        which could handle all the channels, one channel dispatch operation
 
61
        SHOULD be created for all the channels. If there are not, one channel
 
62
        dispatch operation SHOULD be created for each channel, each with
 
63
        a list of channel handlers that could handle that channel.</p>
 
64
 
 
65
      <p>When listing channel handlers, priority SHOULD be given to
 
66
        channel handlers that are already handling channels from the same
 
67
        bundle.</p>
 
68
 
 
69
      <p>If a handler with <tp:dbus-ref
 
70
          namespace="org.freedesktop.Telepathy.Client.Handler.DRAFT">BypassApproval</tp:dbus-ref>
 
71
        <code>= True</code> could handle the channels in the dispatch
 
72
        operation, then the channel dispatcher SHOULD call <tp:dbus-ref
 
73
          namespace="org.freedesktop.Telepathy.Client.Handler.DRAFT">HandleChannels</tp:dbus-ref>
 
74
        on that handler, and (assuming the call succeeds) emit
 
75
        <tp:member-ref>Finished</tp:member-ref> and stop processing those
 
76
        channels without involving any approvers.</p>
 
77
 
 
78
      <tp:rationale>
 
79
        <p>Some channel types can be picked up "quietly" by an existing
 
80
          channel handler. If a <tp:dbus-ref
 
81
            namespace="org.freedesktop.Telepathy.Channel.Type">Text</tp:dbus-ref>
 
82
          channel is added to an existing bundle containing a <tp:dbus-ref
 
83
            namespace="org.freedesktop.Telepathy.Channel.Type">StreamedMedia</tp:dbus-ref>
 
84
          channel, there shouldn't be
 
85
          any approvers, flashing icons or notification bubbles, if the
 
86
          the UI for the StreamedMedia channel can just add a text box
 
87
          and display the message.</p>
 
88
      </tp:rationale>
 
89
 
 
90
      <p>Otherwise, the channel dispatcher SHOULD send the channel dispatch
 
91
        operation to all relevant approvers (in parallel) and wait for an
 
92
        approver to claim the channels or request that they are handled.
 
93
        See
 
94
        <tp:dbus-ref
 
95
          namespace="org.freedesktop.Telepathy.Client.Approver.DRAFT">AddDispatchOperation</tp:dbus-ref>
 
96
        for more details on this.</p>
 
97
 
 
98
      <p>Finally, if the approver requested it, the channel dispatcher SHOULD
 
99
        send the channels to a handler.</p>
 
100
    </tp:docstring>
 
101
 
 
102
    <property name="Interfaces" tp:name-for-bindings="Interfaces"
 
103
      type="as" access="read" tp:type="DBus_Interface[]">
 
104
      <tp:docstring>
 
105
        A list of the extra interfaces provided by this channel dispatch
 
106
        operation. This property cannot change.
 
107
      </tp:docstring>
 
108
    </property>
 
109
 
 
110
    <property name="Connection" tp:name-for-bindings="Connection"
 
111
      type="o" access="read">
 
112
      <tp:docstring>
 
113
        The <tp:dbus-ref
 
114
          namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>
 
115
        with which the <tp:member-ref>Channels</tp:member-ref> are
 
116
        associated. The well-known bus name to use can be derived from
 
117
        this object path by removing the leading '/' and replacing all
 
118
        subsequent '/' by '.'. This property cannot change.
 
119
      </tp:docstring>
 
120
    </property>
 
121
 
 
122
    <property name="Account" tp:name-for-bindings="Account"
 
123
      type="o" access="read">
 
124
      <tp:docstring>
 
125
        The <tp:dbus-ref
 
126
          namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>
 
127
        with which the <tp:member-ref>Connection</tp:member-ref>
 
128
        and <tp:member-ref>Channels</tp:member-ref> are
 
129
        associated. This property cannot change.
 
130
      </tp:docstring>
 
131
    </property>
 
132
 
 
133
    <property name="Channels" tp:name-for-bindings="Channels"
 
134
      type="a(oa{sv})" access="read" tp:type="Channel_Details[]">
 
135
      <tp:docstring>
 
136
        The <tp:dbus-ref
 
137
          namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref>s
 
138
        to be dispatched, and their properties. Change notification is via
 
139
        the <tp:member-ref>ChannelLost</tp:member-ref> signal (channels
 
140
        cannot be added to this property, only removed).
 
141
      </tp:docstring>
 
142
    </property>
 
143
 
 
144
    <signal name="ChannelLost" tp:name-for-bindings="Channel_Lost">
 
145
      <tp:docstring>
 
146
        A channel has closed before it could be claimed or handled. If this
 
147
        is emitted for the last remaining channel in a channel dispatch
 
148
        operation, it MUST immediately be followed by
 
149
        <tp:member-ref>Finished</tp:member-ref>.
 
150
      </tp:docstring>
 
151
 
 
152
      <arg name="Channel" type="o">
 
153
        <tp:docstring>
 
154
          The <tp:dbus-ref
 
155
            namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref>
 
156
          that closed.
 
157
        </tp:docstring>
 
158
      </arg>
 
159
 
 
160
      <arg name="Error" type="s" tp:type="DBus_Error_Name">
 
161
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
162
          <p>The name of a D-Bus error indicating why the channel closed. If
 
163
            no better reason can be found,
 
164
            <code>org.freedesktop.Telepathy.Error.NotAvailable</code> MAY
 
165
            be used as a fallback; this means that this error SHOULD NOT be
 
166
            given any more specific meaning.</p>
 
167
 
 
168
          <p>FIXME: or should we invent a new OtherError for that purpose?</p>
 
169
 
 
170
          <p>FIXME: we need to specify errors for these situations:</p>
 
171
 
 
172
          <ul>
 
173
            <li>kicked from a chatroom</li>
 
174
            <li>outgoing call rejected</li>
 
175
            <li>outgoing call timed out</li>
 
176
            <li>incoming call terminated</li>
 
177
          </ul>
 
178
        </tp:docstring>
 
179
      </arg>
 
180
 
 
181
      <arg name="Message" type="s">
 
182
        <tp:docstring>
 
183
          A string associated with the D-Bus error.
 
184
        </tp:docstring>
 
185
      </arg>
 
186
    </signal>
 
187
 
 
188
    <property name="PossibleHandlers" tp:name-for-bindings="Possible_Handlers"
 
189
      type="as" access="read" tp:type="DBus_Well_Known_Name[]">
 
190
      <tp:docstring>
 
191
        The well known bus names (starting with
 
192
        <code>org.freedesktop.Telepathy.Client.</code>) of the possible
 
193
        <tp:dbus-ref
 
194
          namespace="org.freedesktop.Telepathy.Client">Handler.DRAFT</tp:dbus-ref>s
 
195
        for these channels. The channel dispatcher MUST place the most
 
196
        preferred handlers first, according to some reasonable heuristic.
 
197
        As a result, approvers SHOULD use the first handler by default.
 
198
      </tp:docstring>
 
199
    </property>
 
200
 
 
201
    <method name="HandleWith" tp:name-for-bindings="Handle_With">
 
202
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
203
        <p>Called by an approver to accept a channel bundle and request that
 
204
          the given handler be used to handle it.</p>
 
205
 
 
206
        <p>If successful, this method will cause the ChannelDispatchOperation
 
207
          object to disappear, emitting
 
208
          <tp:member-ref>Finished</tp:member-ref>.</p>
 
209
 
 
210
        <p>However, this method may fail because the dispatch has already been
 
211
          completed and the object has already gone. If this occurs, it
 
212
          indicates that another approver has asked for the bundle to be
 
213
          handled by a particular handler. The approver MUST NOT attempt
 
214
          to interact with the channels further in this case, unless it is
 
215
          separately invoked as the handler.</p>
 
216
 
 
217
        <p>Approvers which are also channel handlers SHOULD use
 
218
          <tp:member-ref>Claim</tp:member-ref> instead
 
219
          of HandleWith to request that they can handle a channel bundle
 
220
          themselves.</p>
 
221
 
 
222
        <p>(FIXME: list some possible errors)</p>
 
223
 
 
224
        <p>If the channel handler raises an error from <tp:dbus-ref
 
225
            namespace="org.freedesktop.Telepathy.Client.Handler.DRAFT">HandleChannels</tp:dbus-ref>,
 
226
          this method
 
227
          MAY respond by raising that same error, even if it is not
 
228
          specifically documented here.</p>
 
229
      </tp:docstring>
 
230
 
 
231
      <arg direction="in" type="s" tp:type="DBus_Bus_Name" name="Handler">
 
232
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
233
          <p>The well-known bus name (starting with
 
234
            <code>org.freedesktop.Telepathy.Client.</code>) of the channel
 
235
            handler that should handle the channel.</p>
 
236
        </tp:docstring>
 
237
      </arg>
 
238
 
 
239
      <tp:possible-errors>
 
240
        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
 
241
          <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
242
            The selected handler is not a syntactically correct
 
243
            <tp:type>DBus_Bus_Name</tp:type> or does not start with
 
244
            "<code>org.freedesktop.Telepathy.Client.</code>".
 
245
          </tp:docstring>
 
246
        </tp:error>
 
247
        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
 
248
          <tp:docstring>
 
249
            The selected handler is temporarily unable to handle these
 
250
            channels.
 
251
          </tp:docstring>
 
252
        </tp:error>
 
253
        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
 
254
          <tp:docstring>
 
255
            The selected handler is syntactically correct, but will never
 
256
            be able to handle these channels (for instance because the channels
 
257
            do not match its HandlerChannelFilter, or because HandleChannels
 
258
            raised NotImplemented).
 
259
          </tp:docstring>
 
260
        </tp:error>
 
261
        <tp:error name="org.freedesktop.Telepathy.Error.NotYours">
 
262
          <tp:docstring>
 
263
            At the time that HandleWith was called, this dispatch operation was
 
264
            processing an earlier call to HandleWith. The earlier call has
 
265
            now succeeded, so some Handler nominated by another approver is
 
266
            now responsible for the channels. In this situation, the second
 
267
            call to HandleWith MUST NOT return until the first one has
 
268
            returned successfully or unsuccessfully, and if the first call
 
269
            to HandleChannels fails, the channel dispatcher SHOULD try to obey
 
270
            the choice of Handler made by the second call to HandleWith.
 
271
          </tp:docstring>
 
272
        </tp:error>
 
273
      </tp:possible-errors>
 
274
    </method>
 
275
 
 
276
    <method name="Claim" tp:name-for-bindings="Claim">
 
277
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
278
        <p>Called by an approver to claim channels for handling
 
279
          internally. If this method is called successfully, the process
 
280
          calling this method becomes the handler for the channel, but
 
281
          <em>does not</em> have the HandleChannels method called on it.</p>
 
282
        <!-- FIXME: tp:dbus-ref -->
 
283
 
 
284
        <p>Clients that call Claim on channels but do not immediately
 
285
          close them SHOULD implement the Handler interface and its
 
286
          CurrentlyHandledChannels property.</p>
 
287
        <!-- FIXME: tp:dbus-ref -->
 
288
 
 
289
        <p>Approvers wishing to reject channels MUST call this method to
 
290
          claim ownership of them, and MUST NOT call
 
291
          <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Close</tp:dbus-ref>
 
292
          on the channels unless/until this method returns successfully.</p>
 
293
 
 
294
        <tp:rationale>
 
295
          <p>The channel dispatcher can't know how best to close arbitrary
 
296
            channel types, so it leaves it up to the approver to do so.
 
297
            For instance, for Text channels it is necessary
 
298
            to acknowledge any messages that have already been displayed to
 
299
            the user first - ideally, the approver would display and then
 
300
            acknowledge the messages.</p>
 
301
        </tp:rationale>
 
302
 
 
303
        <p>If successful, this method will cause the ChannelDispatchOperation
 
304
          object to disappear, emitting
 
305
          <tp:member-ref>Finished</tp:member-ref>, in the same way as for
 
306
          <tp:member-ref>HandleWith</tp:member-ref>.</p>
 
307
 
 
308
        <p>This method may fail because the dispatch operation has already
 
309
          been completed. Again, see HandleWith for more details. The approver
 
310
          MUST NOT attempt to interact with the channels further in this
 
311
          case.</p>
 
312
 
 
313
        <p>(FIXME: list some other possible errors)</p>
 
314
      </tp:docstring>
 
315
 
 
316
      <tp:possible-errors>
 
317
        <tp:error name="org.freedesktop.Telepathy.Error.NotYours">
 
318
          <tp:docstring>
 
319
            At the time that Claim was called, this dispatch operation was
 
320
            processing a call to HandleWith which has now succeeded, so
 
321
            some Handler nominated by another approver is now responsible for
 
322
            the channel.
 
323
          </tp:docstring>
 
324
        </tp:error>
 
325
      </tp:possible-errors>
 
326
    </method>
 
327
 
 
328
    <signal name="Finished" tp:name-for-bindings="Finished">
 
329
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
330
        <p>Emitted when this dispatch operation finishes. The dispatch
 
331
          operation is no longer present and further methods must not be
 
332
          called on it.</p>
 
333
 
 
334
        <p>Its object path SHOULD NOT be reused for a subsequent dispatch
 
335
          operation; the ChannelDispatcher MUST choose object paths
 
336
          in a way that avoids immediate re-use.</p>
 
337
 
 
338
        <tp:rationale>
 
339
          <p>Otherwise, clients might accidentally call
 
340
            <tp:member-ref>HandleWith</tp:member-ref> or
 
341
            <tp:member-ref>Claim</tp:member-ref> on a new dispatch operation
 
342
            instead of the one they intended to handle.</p>
 
343
        </tp:rationale>
 
344
      </tp:docstring>
 
345
    </signal>
 
346
 
 
347
  </interface>
 
348
</node>
 
349
<!-- vim:set sw=2 sts=2 et ft=xml: -->