summaryrefslogtreecommitdiff
path: root/spec/Connection_Interface_Addressing.xml
blob: b61713499d7e84c9a7b6fab259ff8cd7e90417fc (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
<?xml version="1.0" ?>
<node name="/Connection_Interface_Addressing" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
  <tp:copyright> Copyright (C) 2010 Collabora Limited </tp:copyright>
  <tp:license xmlns="http://www.w3.org/1999/xhtml">
    <p>This library is free software; you can redistribute it and/or modify it
      under the terms of the GNU Lesser General Public License as published by
      the Free Software Foundation; either version 2.1 of the License, or (at
      your option) any later version.</p>

    <p>This library is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
      General Public License for more details.</p>

    <p>You should have received a copy of the GNU Lesser General Public License
      along with this library; if not, write to the Free Software Foundation,
      Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
  </tp:license>
  <interface name="im.telepathy1.Connection.Interface.Addressing1"
             tp:causes-havoc="experimental">
    <tp:requires interface="im.telepathy1.Connection"/>
    <tp:requires interface="im.telepathy1.Connection.Interface.Contacts"/>
    <tp:added version="0.19.12">(as draft)</tp:added>
    <tp:changed version="0.25.1">Both methods now return two dictionaries.</tp:changed>
    <tp:changed version="0.25.UNRELEASED">Replaced DRAFT with a version number
      (still keeping the causes-havoc annotation)</tp:changed>
    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>This interface deals with the multiple address types that can
      refer to the same contact, such as vCard fields and URIs.</p>

      <p>It can be used to retrieve contacts with a specific addresses
        through <tp:member-ref>GetContactsByVCardField</tp:member-ref> and
        <tp:member-ref>GetContactsByURI</tp:member-ref>, as well as
        defining the various addressing methods for a given contact
        through this interface's contact attributes.</p>
    </tp:docstring>

    <method name="GetContactsByVCardField"
            tp:name-for-bindings="Get_Contacts_By_VCard_Field">
      <arg direction="in" name="Field" type="s">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The vCard field of the addresses we are requesting. The
            field name SHOULD be in lower case. Supported
            fields can be found in
            <tp:dbus-ref namespace="im.telepathy1.Protocol.Interface.Addressing1">AddressableVCardFields</tp:dbus-ref>.</p>

          <p>The <code>url</code> vCard field MUST NOT appear here; see
            <tp:member-ref>GetContactsByURI</tp:member-ref> instead.</p>

          <tp:rationale>
            <p>In practice, protocols have a limited set of URI
              schemes that make sense to resolve as a contact.</p>
          </tp:rationale>

        </tp:docstring>
      </arg>
      <arg direction="in" name="Addresses" type="as">
        <tp:docstring>
          The addresses to get contact handles for. The address types
          should match the given vCard field.
        </tp:docstring>
      </arg>
      <arg direction="in" name="Interfaces" type="as"
        tp:type="DBus_Interface[]">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A list of strings indicating which D-Bus interfaces the calling
            process is interested in. All supported attributes from these
            interfaces, whose values can be obtained without additional network
            activity, will be in the reply.</p>

          <p>Attributes from this interface and from
            <tp:dbus-ref>im.telepathy1.Connection</tp:dbus-ref>
            are always returned, and need not be requested
            explicitly.</p>

          <p>The behavior of this parameter is similar to the same
            parameter in
            <tp:dbus-ref namespace="im.telepathy1.Connection.Interface">Contacts.GetContactAttributes</tp:dbus-ref>.</p>
          </tp:docstring>
      </arg>

      <arg direction="out" type="a{su}" name="Requested"
           tp:type="Addressing_Normalization_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A mapping from requested vCard addresses to the corresponding
            contact handles.</p>

          <p>Requested addresses that are not valid or understood for this protocol
            MUST be omitted from the mapping.</p>
        </tp:docstring>
      </arg>

      <arg direction="out" type="a{ua{sv}}" name="Attributes"
           tp:type="Contact_Attributes_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A dictionary mapping the contact handles to contact attributes.
            If any of the requested addresses are in fact invalid, they are
            simply omitted from this mapping. If contact attributes are not
            immediately known, the behaviour is defined by the interface;
            the attribute should either be omitted from the result or
            replaced with a default value.</p>

          <p>Requested addresses that are not valid or understood for this protocol
            MUST be omitted from the mapping.</p>

          <p>Each contact's attributes will always include at least the
            identifier that would be obtained by inspecting the handle
            (<code>im.telepathy1.Connection/contact-id</code>).
          </p>
        </tp:docstring>
      </arg>

      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Request contacts and retrieve their attributes using a given field
          in their vCards.</p>
      </tp:docstring>

      <tp:possible-errors>
        <tp:error name="im.telepathy1.Error.Disconnected"/>
      </tp:possible-errors>
    </method>

    <method name="GetContactsByURI"
            tp:name-for-bindings="Get_Contacts_By_URI">
      <arg direction="in" name="URIs" type="as">
        <tp:docstring>
          The URI addresses to get contact handles for. Supported
          schemes can be found in
          <tp:dbus-ref namespace="im.telepathy1.Protocol.Interface.Addressing1">AddressableURISchemes</tp:dbus-ref>.
        </tp:docstring>
      </arg>
      <arg direction="in" name="Interfaces" type="as"
        tp:type="DBus_Interface[]">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A list of strings indicating which D-Bus interfaces the calling
            process is interested in. All supported attributes from these
            interfaces, whose values can be obtained without additional network
            activity, will be in the reply.</p>

          <p>Attributes from this interface and from
            <tp:dbus-ref>im.telepathy1.Connection</tp:dbus-ref>
            are always returned, and need not be requested
            explicitly.</p>

          <p>The behavior of this parameter is similar to the same
            parameter in
            <tp:dbus-ref namespace="im.telepathy1.Connection.Interface">Contacts.GetContactAttributes</tp:dbus-ref>.</p>
          </tp:docstring>
      </arg>

      <arg direction="out" type="a{su}" name="Requested"
           tp:type="Addressing_Normalization_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A mapping of requested URIs to the corresponding contact handles.</p>

          <p>Requested URIs that are not valid or understood for this protocol
            MUST be omitted from the mapping.</p>
        </tp:docstring>
      </arg>

      <arg direction="out" type="a{ua{sv}}" name="Attributes"
           tp:type="Contact_Attributes_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A dictionary mapping the contact handles to contact attributes.
            If any of the requested addresses are in fact invalid, they are
            simply omitted from this mapping. If contact attributes are not
            immediately known, the behaviour is defined by the interface;
            the attribute should either be omitted from the result or
            replaced with a default value.</p>

          <p>Requested URIs that are not valid or understood for this protocol
            MUST be omitted from the mapping.</p>

          <p>Each contact's attributes will always include at least the
            identifier that would be obtained by inspecting the handle
            (<code>im.telepathy1.Connection/contact-id</code>).
          </p>
        </tp:docstring>
      </arg>

      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Request contacts and retrieve their attributes using URI addresses.</p>
      </tp:docstring>

      <tp:possible-errors>
        <tp:error name="im.telepathy1.Error.Disconnected"/>
      </tp:possible-errors>
    </method>

    <tp:mapping name="VCard_Field_Address_Map" array-name="">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>A mapping of vCard fields and addresses that repreent
          the given contact.</p>
      </tp:docstring>
      <tp:member type="s" name="VCard_Field"/>
      <tp:member type="s" name="Address"/>
    </tp:mapping>

    <tp:contact-attribute name="addresses" type="a{ss}"
                          tp:type="VCard_Field_Address_Map">
      <tp:docstring>
        The various vCard addresses that identify this contact.
      </tp:docstring>
    </tp:contact-attribute>

    <tp:contact-attribute name="uris" type="as">
      <tp:docstring>
        The various URI addresses that identify this contact.
      </tp:docstring>
    </tp:contact-attribute>

    <tp:mapping name="Addressing_Normalization_Map">
      <tp:docstring>
        A map from URIs/vCard addresses to the corresponding handle.
      </tp:docstring>
      <tp:added version="0.25.1"/>

      <tp:member type="s" name="Requested_String">
        <tp:docstring>
        The URI or vCard address that has been requested by
        <tp:member-ref>GetContactsByVCardField</tp:member-ref> or
        <tp:member-ref>GetContactsByURI</tp:member-ref>.
        </tp:docstring>
      </tp:member>
      <tp:member type="u" name="Handle" tp:type="Contact_Handle">
        <tp:docstring>
          A nonzero handle.
        </tp:docstring>
      </tp:member>
    </tp:mapping>

  </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->