summaryrefslogtreecommitdiff
path: root/qt4/spec/Connection_Interface_Contacts.xml
blob: e04ea5f2d19426b7f00d64180608e4d616428264 (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
<?xml version="1.0" ?>
<node name="/Connection_Interface_Contacts" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
  <tp:copyright> Copyright (C) 2005-2008 Collabora Limited </tp:copyright>
  <tp:copyright> Copyright (C) 2005, 2006 Nokia Corporation </tp:copyright>
  <tp:copyright> Copyright (C) 2006 INdT </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="org.freedesktop.Telepathy.Connection.Interface.Contacts">
    <tp:requires interface="org.freedesktop.Telepathy.Connection"/>
    <tp:added version="0.17.9"/>

    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>This interface allows many attributes of many contacts to be
        obtained in a single D-Bus round trip.</p>

      <p>Each contact attribute has an string identifier
        (<tp:type>Contact_Attribute</tp:type>), which is namespaced
        by the D-Bus interface which defines it.</p>

      <p>An initial set of contact attributes is defined here:</p>

      <dl>
        <dt>org.freedesktop.Telepathy.Connection/contact-id
          (type s)</dt>
        <dd>The same string that would be returned by
          <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">InspectHandles</tp:dbus-ref>
          (always present in the result)
        </dd>
        <dt>org.freedesktop.Telepathy.Connection.Interface.Aliasing/alias
          (type s)</dt>
        <dd>The same string that would be returned by <tp:dbus-ref
            namespace="org.freedesktop.Telepathy.Connection.Interface.Aliasing">GetAliases</tp:dbus-ref>
          (always present with some value, possibly the
          same as Connection/contact-id, if information from the
          Aliasing interface was requested)
        </dd>
        <dt>org.freedesktop.Telepathy.Connection.Interface.Avatars/token
          (type s, <tp:type>Avatar_Token</tp:type>)</dt>
        <dd>The same string that would be returned by <tp:dbus-ref
            namespace="org.freedesktop.Telepathy.Connection.Interface.Avatars">GetKnownAvatarTokens</tp:dbus-ref>
          (omitted from the result if the contact's avatar token is not known,
          present as an empty string if the contact is known not to have
          an avatar). Unlike in the <tp:dbus-ref
            namespace="org.freedesktop.Telepathy.Connection.Interface.Avatars">GetKnownAvatarTokens</tp:dbus-ref>
            method, the avatar tokens for the self handle aren't required to be
            present. This attribute should not be used to determine whether or
            not the Avatar needs to be set.
        </dd>
        <dt>org.freedesktop.Telepathy.Connection.Interface.SimplePresence/presence
          (type (uss), <tp:type>Simple_Presence</tp:type>)</dt>
        <dd> The same struct that would be returned by
            <tp:dbus-ref
              namespace="org.freedesktop.Telepathy.Connection.Interface.SimplePresence">GetPresences</tp:dbus-ref>
          (always present with some value if information from the
          SimplePresence interface was requested)
          </dd>
        <dt>org.freedesktop.Telepathy.Connection.Interface.Capabilities/caps
          (type a(usuu), <tp:type>Contact_Capability</tp:type>)</dt>
        <dd>The same structs that would be returned by
          <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Capabilities">GetCapabilities</tp:dbus-ref>
          (all of them will redundantly have the contact's handle as the
          first member). Omitted from the result if the contact's capabilities
          are not known; present in the result as an empty array if the
          contact is known to have no capabilities at all.</dd>
        <dt>org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.DRAFT/caps
          (type a{ua(a{sv}as)},
          <tp:type>Contact_Capabilities_Map</tp:type>)</dt>
        <dd>The same structs that would be returned by
          <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.DRAFT">GetContactCapabilities</tp:dbus-ref>
          Omitted from the result if the contact's capabilities
          are not known; present in the result as an empty array if the
          contact is known to have no capabilities at all.</dd>
      </dl>
    </tp:docstring>

    <tp:simple-type name="Contact_Attribute" type="s">
      <tp:docstring>
        A <tp:type>DBus_Interface</tp:type>, followed by a slash '/' character
        and an identifier for an attribute defined by that interface. The
        attribute identifier SHOULD be in lower case.

        <tp:rationale>
          These aren't D-Bus core Properties, and we want them to look visibly
          different.
        </tp:rationale>
      </tp:docstring>
    </tp:simple-type>

    <tp:mapping name="Single_Contact_Attributes_Map">
      <tp:docstring>
        Some of the attributes of a single contact.
      </tp:docstring>

      <tp:member type="s" tp:type="Contact_Attribute" name="Attribute">
        <tp:docstring>
          The name of the attribute
        </tp:docstring>
      </tp:member>

      <tp:member type="v" name="Value">
        <tp:docstring>
          The value of the attribute
        </tp:docstring>
      </tp:member>
    </tp:mapping>

    <tp:mapping name="Contact_Attributes_Map">
      <tp:docstring>Mapping returned by
        <tp:member-ref>GetContactAttributes</tp:member-ref>, representing a
        collection of Contacts and their requested attributes.</tp:docstring>

      <tp:member type="u" tp:type="Contact_Handle" name="Contact">
        <tp:docstring>
          A contact
        </tp:docstring>
      </tp:member>

      <tp:member type="a{sv}" tp:type="Single_Contact_Attributes_Map"
        name="Attributes">
        <tp:docstring>
          Attributes of that contact
        </tp:docstring>
      </tp:member>
    </tp:mapping>

    <property name="ContactAttributeInterfaces" access="read" type="as"
      tp:type="DBus_Interface[]"
      tp:name-for-bindings="Contact_Attribute_Interfaces">
      <tp:docstring>
        A list of D-Bus interfaces for which
        <tp:member-ref>GetContactAttributes</tp:member-ref> is expected to work.
        This cannot change during the lifetime of the Connection.
      </tp:docstring>
    </property>

    <method name="GetContactAttributes"
      tp:name-for-bindings="Get_Contact_Attributes">
      <tp:docstring>
        Return any number of contact attributes for the given handles.
      </tp:docstring>

      <arg direction="in" name="Handles" type="au" tp:type="Contact_Handle[]">
        <tp:docstring>
          An array of handles representing contacts.
        </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>It is an error to request interfaces that are not supported by
            this Connection (i.e. mentioned in the
            <tp:member-ref>ContactAttributeInterfaces</tp:member-ref>
            property).</p>

          <tp:rationale>
            <p>This makes it possible to distinguish between interfaces for
              which the Connection has nothing to say (e.g. we don't know the
              avatar tokens of any of the contacts, so we omitted them all),
              and interfaces for which this API isn't supported.</p>
          </tp:rationale>

          <p>Attributes from the interface
            <tp:dbus-ref>org.freedesktop.Telepathy.Connection</tp:dbus-ref>
            are always returned, and need not be requested explicitly.</p>

          <p>As well as returning cached information immediately, the
            connection MAY start asynchronous requests to obtain better
            values for the contact attributes. If better values are later
            obtained by this process, they will be indicated with the usual
            signals (such as <tp:dbus-ref
              namespace="org.freedesktop.Telepathy.Connection.Interface.Aliasing">AliasesChanged</tp:dbus-ref>).</p>

          <tp:rationale>
            For instance, an XMPP connection manager could download vCards
            in response to a request for <tp:dbus-ref
              namespace="org.freedesktop.Telepathy.Connection.Interface">Aliasing</tp:dbus-ref>
            attributes.
          </tp:rationale>
        </tp:docstring>
      </arg>

      <arg direction="in" name="Hold" type="b">
        <tp:docstring>
          If true, all handles in the result have been held on behalf of the
          calling process, as if by a call to
          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.HoldHandles</tp:dbus-ref>.

          <tp:rationale>
            For further round-trip avoidance.
          </tp:rationale>
        </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 handles 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>Each contact's attributes will always include at least the
            identifier that would be obtained by inspecting the handle
            (<code>org.freedesktop.Telepathy.Connection/contact-id</code>).</p>
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
          <tp:docstring>
            One of the requested interfaces is not supported (mentioned in
            <tp:member-ref>ContactAttributeInterfaces</tp:member-ref>).
          </tp:docstring>
        </tp:error>
      </tp:possible-errors>
    </method>
  </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->