~ubuntu-branches/ubuntu/precise/telepathy-mission-control-5/precise

« back to all changes in this revision

Viewing changes to xml/Channel_Dispatcher.xml

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2009-07-30 12:11:55 UTC
  • mto: (0.4.1 upstream) (7.1.1 lucid) (1.1.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20090730121155-6745f645s3fg1mpk
ImportĀ upstreamĀ versionĀ 5.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" ?>
 
2
<node name="/Channel_Dispatcher"
 
3
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
 
4
 
 
5
  <tp:copyright>Copyright Ā© 2008-2009 Collabora Ltd.</tp:copyright>
 
6
  <tp:copyright>Copyright Ā© 2008-2009 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, MA 02110-1301,
 
21
      USA.</p>
 
22
  </tp:license>
 
23
 
 
24
  <interface name="org.freedesktop.Telepathy.ChannelDispatcher"
 
25
    tp:causes-havoc="not yet final">
 
26
 
 
27
    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
28
      <p>The channel dispatcher is responsible for responding to new
 
29
        channels and launching client processes to handle them. It also
 
30
        provides functionality for client processes to request that new
 
31
        channels are created.</p>
 
32
 
 
33
      <p>If a channel dispatcher is running, it is responsible for dispatching
 
34
        new channels on all
 
35
        <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>s
 
36
        created by the
 
37
        <tp:dbus-ref namespace="org.freedesktop.Telepathy">AccountManager</tp:dbus-ref>.
 
38
        Connections not created by the AccountManager are outside the scope
 
39
        of the channel dispatcher.</p>
 
40
 
 
41
      <tp:rationale>
 
42
        <p>Connections created by standalone Telepathy clients
 
43
          that do not intend to interact with the channel dispatcher
 
44
          should be ignored - otherwise, the channel dispatcher would try
 
45
          to launch handlers for channels that the standalone client
 
46
          was already handling internally.</p>
 
47
      </tp:rationale>
 
48
 
 
49
      <p>The current channel dispatcher is defined to be the process that
 
50
        owns the well-known bus name
 
51
        <code>org.freedesktop.Telepathy.ChannelDispatcher</code> on
 
52
        the session bus. This process MUST export an object with this
 
53
        interface at the object path
 
54
        <code>/org/freedesktop/Telepathy/ChannelDispatcher</code>.</p>
 
55
 
 
56
      <p>Until a mechanism exists for making a reasonable automatic choice
 
57
        of ChannelDispatcher implementation, implementations SHOULD NOT
 
58
        register as an activatable service for the ChannelDispatcher's
 
59
        well-known bus name. Instead, it is RECOMMENDED that some component
 
60
        of the user's session will select and activate a particular
 
61
        implementation, and that other Telepathy-enabled programs
 
62
        can detect whether channel request/dispatch functionality is available
 
63
        by checking whether the ChannelDispatcher's well-known name is in use
 
64
        at runtime.</p>
 
65
 
 
66
      <p>There are three categories of client process defined by this
 
67
        specification:</p>
 
68
 
 
69
      <dl>
 
70
        <dt><tp:dbus-ref
 
71
            namespace="org.freedesktop.Telepathy.Client">Observer</tp:dbus-ref></dt>
 
72
        <dd><p>Observers monitor the creation of new channels. This
 
73
            functionality can be used for things like message logging.
 
74
            All observers are notified simultaneously.</p></dd>
 
75
 
 
76
        <dt><tp:dbus-ref
 
77
            namespace="org.freedesktop.Telepathy.Client">Approver</tp:dbus-ref></dt>p
 
78
        <dd>
 
79
          <p>Approvers notify the user that new channels have been created,
 
80
            and also select which channel handler will be used for the channel,
 
81
            either by asking the user or by choosing the most appropriate
 
82
            channel handler.</p>
 
83
        </dd>
 
84
 
 
85
        <dt><tp:dbus-ref
 
86
            namespace="org.freedesktop.Telepathy.Client">Handler</tp:dbus-ref></dt>
 
87
        <dd>
 
88
          <p>Each new channel or set of channels is passed to exactly one
 
89
            handler as its final destination. A typical channel handler is a
 
90
            user interface process handling channels of a particular type.</p>
 
91
        </dd>
 
92
      </dl>
 
93
    </tp:docstring>
 
94
 
 
95
    <property name="Interfaces" tp:name-for-bindings="Interfaces"
 
96
      type="as" access="read" tp:type="DBus_Interface[]">
 
97
      <tp:docstring>
 
98
        A list of the extra interfaces provided by this channel dispatcher.
 
99
      </tp:docstring>
 
100
    </property>
 
101
 
 
102
    <method name="CreateChannel" tp:name-for-bindings="Create_Channel">
 
103
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
104
        <p>Start a request to create a channel. This initially just creates a
 
105
          <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref>
 
106
          object, which can be used to continue the request and track its
 
107
          success or failure.</p>
 
108
 
 
109
        <tp:rationale>
 
110
          <p>The request can take a long time - in the worst case, the
 
111
            channel dispatcher has to ask the account manager to put the
 
112
            account online, the account manager has to ask the operating
 
113
            system to obtain an Internet connection, and the operating
 
114
            system has to ask the user whether to activate an Internet
 
115
            connection using an on-demand mechanism like dialup.</p>
 
116
 
 
117
          <p>This means that using a single D-Bus method call and response
 
118
            to represent the whole request will tend to lead to that call
 
119
            timing out, which is not the behaviour we want.</p>
 
120
        </tp:rationale>
 
121
 
 
122
        <p>If this method is called for an Account that is disabled, invalid
 
123
          or otherwise unusable, no error is signalled until
 
124
          <tp:dbus-ref
 
125
            namespace="org.freedesktop.Telepathy">ChannelRequest.Proceed</tp:dbus-ref>
 
126
          is called, at which point
 
127
          <tp:dbus-ref
 
128
            namespace="org.freedesktop.Telepathy">ChannelRequest.Failed</tp:dbus-ref>
 
129
          is emitted with an appropriate error.</p>
 
130
 
 
131
        <tp:rationale>
 
132
          <p>This means there's only one code path for errors, apart from
 
133
            InvalidArgument for "that request makes no sense".</p>
 
134
 
 
135
          <p>It also means that the request will proceed if the account is
 
136
            enabled after calling CreateChannel, but before calling
 
137
            Proceed.</p>
 
138
        </tp:rationale>
 
139
      </tp:docstring>
 
140
 
 
141
      <arg direction="in" name="Account" type="o">
 
142
        <tp:docstring>
 
143
          The
 
144
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>
 
145
          for which the new channel is to be created.
 
146
        </tp:docstring>
 
147
      </arg>
 
148
 
 
149
      <arg direction="in" name="Requested_Properties" type="a{sv}"
 
150
        tp:type="Qualified_Property_Value_Map">
 
151
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
152
          <p>A dictionary containing desirable properties. This has the same
 
153
            semantics as the corresponding parameter to
 
154
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.CreateChannel</tp:dbus-ref>.
 
155
          </p>
 
156
 
 
157
          <p>Certain properties will not necessarily make sense in this
 
158
            dictionary: for instance,
 
159
            <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref>
 
160
            can only be given if the requester is able to interact with a
 
161
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>
 
162
            to the desired account.</p>
 
163
        </tp:docstring>
 
164
      </arg>
 
165
 
 
166
      <arg direction="in" name="User_Action_Time" type="x"
 
167
        tp:type="Unix_Timestamp64">
 
168
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
169
          <p>The time at which user action occurred, or 0 if this channel
 
170
            request is for some reason not involving user action.
 
171
            The <tp:dbus-ref
 
172
              namespace="org.freedesktop.Telepathy.ChannelRequest">UserActionTime</tp:dbus-ref>
 
173
            property will be set to this value, and it will eventually be
 
174
            passed as the <code>User_Action_Time</code> parameter of <tp:dbus-ref
 
175
              namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref>.</p>
 
176
        </tp:docstring>
 
177
      </arg>
 
178
 
 
179
      <arg direction="in" name="Preferred_Handler" type="s"
 
180
        tp:type="DBus_Well_Known_Name">
 
181
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
182
          <p>Either the well-known bus name (starting with
 
183
            <code>org.freedesktop.Telepathy.Client.</code>)
 
184
            of the preferred handler for this
 
185
            channel, or an empty string to indicate that any handler would be
 
186
            acceptable. The channel dispatcher SHOULD dispatch as many as
 
187
            possible of the resulting channels (ideally, all of them)
 
188
            to that handler, and SHOULD remember the preferred handler
 
189
            so it can try to dispatch subsequent channels in the same bundle
 
190
            to the same handler.</p>
 
191
 
 
192
          <tp:rationale>
 
193
            <p>This must be the well-known bus name, not the unique name,
 
194
              to ensure that all handlers do indeed have the Client API,
 
195
              and the Client object on the handler can be located easily.</p>
 
196
 
 
197
            <p>This is partly so the channel dispatcher can call
 
198
              <tp:dbus-ref
 
199
                namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref>
 
200
              on it, and partly so the channel dispatcher
 
201
              can recover state if it crashes and is restarted.</p>
 
202
          </tp:rationale>
 
203
 
 
204
          <p>If this is a well-known bus name and the handler has the
 
205
            Requests interface, the channel dispatcher SHOULD
 
206
            call <tp:dbus-ref
 
207
              namespace="org.freedesktop.Telepathy.Client.Interface.Requests">AddRequest</tp:dbus-ref>
 
208
            on that Handler after this method has returned.</p>
 
209
 
 
210
          <tp:rationale>
 
211
            <p>This ordering allows a Handler which calls CreateChannel with
 
212
              itself as the preferred handler to associate the call to
 
213
              AddRequest with that call.</p>
 
214
          </tp:rationale>
 
215
 
 
216
          <p>This is copied to the ChannelRequest that is returned,
 
217
            as the <tp:dbus-ref
 
218
              namespace="org.freedesktop.Telepathy.ChannelRequest">PreferredHandler</tp:dbus-ref>
 
219
            property.</p>
 
220
        </tp:docstring>
 
221
      </arg>
 
222
 
 
223
      <arg direction="out" name="Request" type="o">
 
224
        <tp:docstring>
 
225
          A
 
226
          <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref>
 
227
          object.
 
228
        </tp:docstring>
 
229
      </arg>
 
230
 
 
231
      <tp:possible-errors>
 
232
        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
 
233
          <tp:docstring>
 
234
            The Preferred_Handler is syntactically invalid or does
 
235
            not start with <code>org.freedesktop.Telepathy.Client.</code>,
 
236
            the Account does not exist, or one of the Requested_Properties
 
237
            is invalid
 
238
          </tp:docstring>
 
239
        </tp:error>
 
240
      </tp:possible-errors>
 
241
 
 
242
    </method>
 
243
 
 
244
    <method name="EnsureChannel" tp:name-for-bindings="Ensure_Channel">
 
245
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
246
        <p>Start a request to ensure that a channel exists, creating it if
 
247
          necessary.  This initially just creates a <tp:dbus-ref
 
248
            namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref>
 
249
          object, which can be used to continue the request and track its
 
250
          success or failure.</p>
 
251
 
 
252
        <p>If this method is called for an Account that is disabled, invalid
 
253
          or otherwise unusable, no error is signalled until
 
254
          <tp:dbus-ref
 
255
            namespace="org.freedesktop.Telepathy">ChannelRequest.Proceed</tp:dbus-ref>
 
256
          is called, at which point
 
257
          <tp:dbus-ref
 
258
            namespace="org.freedesktop.Telepathy">ChannelRequest.Failed</tp:dbus-ref>
 
259
          is emitted with an appropriate error.</p>
 
260
 
 
261
        <tp:rationale>
 
262
          <p>The rationale is as for <tp:dbus-ref
 
263
              namespace='org.freedesktop.Telepathy.ChannelDispatcher'>CreateChannel</tp:dbus-ref>.</p>
 
264
        </tp:rationale>
 
265
      </tp:docstring>
 
266
 
 
267
      <arg direction="in" name="Account" type="o">
 
268
        <tp:docstring>
 
269
          The
 
270
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>
 
271
          for which the new channel is to be created.
 
272
        </tp:docstring>
 
273
      </arg>
 
274
 
 
275
      <arg direction="in" name="Requested_Properties" type="a{sv}"
 
276
        tp:type="Qualified_Property_Value_Map">
 
277
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
278
          <p>A dictionary containing desirable properties. This has the same
 
279
            semantics as the corresponding parameter to
 
280
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.EnsureChannel</tp:dbus-ref>.
 
281
          </p>
 
282
 
 
283
          <p>Certain properties will not necessarily make sense in this
 
284
            dictionary: for instance,
 
285
            <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref>
 
286
            can only be given if the requester is able to interact with a
 
287
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>
 
288
            to the desired account.</p>
 
289
        </tp:docstring>
 
290
      </arg>
 
291
 
 
292
      <arg direction="in" name="User_Action_Time" type="x"
 
293
        tp:type="Unix_Timestamp64">
 
294
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
295
          <p>The time at which user action occurred, or 0 if this channel
 
296
            request is for some reason not involving user action.</p>
 
297
 
 
298
          <p>This parameter is used in the same way as the corresponding
 
299
            parameter to <tp:member-ref>CreateChannel</tp:member-ref>.</p>
 
300
        </tp:docstring>
 
301
      </arg>
 
302
 
 
303
      <arg direction="in" name="Preferred_Handler" type="s"
 
304
        tp:type="DBus_Well_Known_Name">
 
305
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
 
306
          <p>Either the well-known bus name (starting with
 
307
            <code>org.freedesktop.Telepathy.Client.</code>)
 
308
            of the preferred handler for this
 
309
            channel, or an empty string to indicate that any handler would be
 
310
            acceptable. The behaviour and rationale are the same as for the
 
311
            corresponding parameter to
 
312
            <tp:member-ref>CreateChannel</tp:member-ref>, except as noted
 
313
            here.</p>
 
314
 
 
315
          <p>If any new channels are created in response to this
 
316
            request, the channel dispatcher SHOULD dispatch as many as
 
317
            possible of the resulting channels (ideally, all of them)
 
318
            to that handler, and SHOULD remember the preferred handler
 
319
            so it can try to dispatch subsequent channels in the same bundle
 
320
            to the same handler. If the requested channel already exists (that
 
321
            is, <tp:dbus-ref
 
322
              namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.EnsureChannel</tp:dbus-ref>
 
323
            returns <code>Yours=False</code>) then the channel dispatcher
 
324
            SHOULD re-dispatch the channel to its existing handler, and MUST
 
325
            NOT dispatch it to this client (unless it is the existing handler);
 
326
            the request is still deemed to have succeeded in this case.</p>
 
327
 
 
328
          <tp:rationale>
 
329
            <p>An address book application, for example, might call <tp:dbus-ref
 
330
                namespace='org.freedesktop.Telepathy.ChannelDispatcher'>EnsureChannel</tp:dbus-ref>
 
331
              to ensure that a text channel with a particular contact is
 
332
              displayed to the user; it does not care whether a new channel was
 
333
              made. An IM client might call <tp:dbus-ref
 
334
                namespace='org.freedesktop.Telepathy.ChannelDispatcher'>EnsureChannel</tp:dbus-ref>
 
335
              in response to the user double-clicking an entry in the contact
 
336
              list, with itself as the <code>Preferred_Handler</code>; if the
 
337
              user already has a conversation with that contact in another
 
338
              application, they would expect the existing window to be
 
339
              presented, rather than their double-click leading to an error
 
340
              message.  So the request should succeed, even if its
 
341
              <code>Preferred_Handler</code> is not used.</p>
 
342
          </tp:rationale>
 
343
 
 
344
        </tp:docstring>
 
345
      </arg>
 
346
 
 
347
      <arg direction="out" name="Request" type="o">
 
348
        <tp:docstring>
 
349
          A
 
350
          <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref>
 
351
          object.
 
352
        </tp:docstring>
 
353
      </arg>
 
354
 
 
355
      <tp:possible-errors>
 
356
        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
 
357
          <tp:docstring>
 
358
            The Preferred_Handler is syntactically invalid or does
 
359
            not start with <code>org.freedesktop.Telepathy.Client.</code>,
 
360
            the Account does not exist, or one of the Requested_Properties
 
361
            is invalid
 
362
          </tp:docstring>
 
363
        </tp:error>
 
364
      </tp:possible-errors>
 
365
 
 
366
    </method>
 
367
 
 
368
  </interface>
 
369
</node>
 
370
<!-- vim:set sw=2 sts=2 et ft=xml: -->