summaryrefslogtreecommitdiff
path: root/spec/Connection_Interface_Aliasing1.xml
blob: 139b306470a0662f4139d9baa912ff9d897d8d33 (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
<?xml version="1.0" ?>
<node name="/Connection_Interface_Aliasing1" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
  <tp:copyright> Copyright (C) 2005, 2006 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="im.telepathy.v1.Connection.Interface.Aliasing1">
    <tp:requires interface="im.telepathy.v1.Connection"/>

    <tp:mapping name="Alias_Map" array-name="">
      <tp:docstring>A dictionary whose keys are contact handles and whose
        values are aliases.</tp:docstring>
      <tp:member type="u" tp:type="Contact_Handle" name="Handle"/>
      <tp:member type="s" name="Alias"/>
    </tp:mapping>

    <signal name="AliasesChanged" tp:name-for-bindings="Aliases_Changed">
      <arg name="Aliases" type="a{us}" tp:type="Alias_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          A mapping from the handle representing the contact to the new alias
        </tp:docstring>
      </arg>
      <tp:docstring>
        Signal emitted when a contact's alias (or that of the user) is changed.
      </tp:docstring>
    </signal>
    <tp:flags name="Connection_Alias_Flags" value-prefix="Connection_Alias_Flag" type="u">
      <tp:flag suffix="User_Set" value="1">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The aliases of contacts on this connection may be changed by the
            user of the service, not just by the contacts themselves. This is
            the case on Jabber, for instance.</p>
          <p>It is possible that aliases can be changed by the contacts too -
            which alias takes precedence is not defined by this
            specification, and depends on the server and/or connection manager
            implementation.</p>
          <p>This flag only applies to the aliases of "globally valid" contact
            handles. At this time, clients should not expect to be able to
            change the aliases corresponding to any channel-specific
            handles. If this becomes possible in future, a new flag will
            be defined.</p>
        </tp:docstring>
      </tp:flag>
    </tp:flags>
    <property name="AliasFlags"
      tp:name-for-bindings="Alias_Flags" type="u" access="read"
      tp:immutable="yes">
      <tp:added version="0.99.1"/>
      <tp:docstring>
        A bitwise OR of flags from ConnectionAliasFlags detailing the behaviour
        of aliases on this connection.
      </tp:docstring>
    </property>
    <method name="RequestAliases" tp:name-for-bindings="Request_Aliases">
      <arg direction="in" name="Contacts" type="au" tp:type="Contact_Handle[]">
        <tp:docstring>
          An array of handles representing contacts
        </tp:docstring>
      </arg>
      <arg direction="out" type="as" name="Aliases">
        <tp:docstring>
          A list of aliases in the same order as the contact handles
        </tp:docstring>
      </arg>
      <tp:docstring>
        Request the value of several contacts' aliases at once.
      </tp:docstring>
      <tp:possible-errors>
        <tp:error name="im.telepathy.v1.Error.Disconnected"/>
        <tp:error name="im.telepathy.v1.Error.NetworkError"/>
        <tp:error name="im.telepathy.v1.Error.NotAvailable"/>
        <tp:error name="im.telepathy.v1.Error.InvalidHandle"/>
      </tp:possible-errors>
    </method>
    <method name="SetAliases" tp:name-for-bindings="Set_Aliases">
      <arg direction="in" name="Aliases" type="a{us}" tp:type="Alias_Map">
        <tp:docstring>
          A dictionary mapping integer handles of contacts
          to strings of the new alias to set.
        </tp:docstring>
      </arg>
      <tp:docstring>
        Request that the alias of the given contact be changed. Success will be
        indicated by emitting an <tp:member-ref>AliasesChanged</tp:member-ref>
        signal. On connections where the CONNECTION_ALIAS_FLAG_USER_SET flag is
        not set, this method will only ever succeed if the contact is the
        user's own handle (as returned by the <tp:dbus-ref
          namespace="im.telepathy.v1">Connection.SelfHandle</tp:dbus-ref>
        property).
      </tp:docstring>
      <tp:possible-errors>
        <tp:error name="im.telepathy.v1.Error.Disconnected"/>
        <tp:error name="im.telepathy.v1.Error.NetworkError"/>
        <tp:error name="im.telepathy.v1.Error.NotAvailable"/>
        <tp:error name="im.telepathy.v1.Error.InvalidArgument"/>
        <tp:error name="im.telepathy.v1.Error.PermissionDenied"/>
      </tp:possible-errors>
    </method>

    <tp:contact-attribute name="alias" type="s">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The contact's alias. This SHOULD only return cached aliases, falling
        back on the contact identifier (i.e. the string corresponding to the
        handle) if none is present. Also if there was no cached alias, a request
        SHOULD be started of which the result is later signalled by
        <tp:member-ref>AliasesChanged</tp:member-ref>.</p>
      </tp:docstring>
    </tp:contact-attribute>

    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>An interface on connections to support protocols where contacts have an
    alias which they can change at will. Provides a method for the user to set
    their own alias, and a signal which should be emitted when a contact's
    alias is changed or first discovered.</p>

    <p>On connections where the user is allowed to set aliases for contacts and
    store them on the server, the <tp:member-ref>AliasFlags</tp:member-ref>
    property will have the CONNECTION_ALIAS_FLAG_USER_SET flag set, and the
    <tp:member-ref>SetAliases</tp:member-ref> method may be called on contact
    handles other than the user themselves.</p>

    <p>Aliases are intended to be used as the main displayed name for the
    contact, where available.</p>
    </tp:docstring>
  </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->